Skip to content

Commit 5603585

Browse files
author
Maria Farooq
committed
added stored procedure and missing jdoc
1 parent 38b99cf commit 5603585

5 files changed

Lines changed: 22 additions & 1 deletion

File tree

restcomm/restcomm.application/src/main/webapp/WEB-INF/data/hsql/restcomm.script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ CREATE MEMORY TABLE "restcomm_media_resource_broker_entity" ("conference_sid" VA
2424
CREATE MEMORY TABLE PUBLIC."restcomm_extensions_configuration"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"extension" VARCHAR(255) NOT NULL,"configuration_data" VARCHAR(16777216),"configuration_type" VARCHAR(255) NOT NULL,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP, "enabled" BOOLEAN DEFAULT TRUE NOT NULL)
2525
CREATE MEMORY TABLE PUBLIC."restcomm_accounts_extensions" ("account_sid" VARCHAR(34) NOT NULL, "extension_sid" VARCHAR(34) NOT NULL, PRIMARY KEY("account_sid", "extension_sid"), "configuration_data" VARCHAR(16777216))
2626
CREATE MEMORY TABLE "restcomm_geolocation"("sid" VARCHAR(34) NOT NULL PRIMARY KEY, "date_created" DATETIME NOT NULL, "date_updated" DATETIME NOT NULL, "date_executed" DATETIME NOT NULL, "account_sid" VARCHAR(34) NOT NULL, "source" VARCHAR(30), "device_identifier" VARCHAR(30) NOT NULL, "geolocation_type" VARCHAR(15) NOT NULL, "response_status" VARCHAR(30), "cell_id" VARCHAR(10), "location_area_code" VARCHAR(10), "mobile_country_code" INTEGER, "mobile_network_code" VARCHAR(3), "network_entity_address" BIGINT, "age_of_location_info" INTEGER, "device_latitude" VARCHAR(15), "device_longitude" VARCHAR(15), "accuracy" BIGINT, "physical_address" VARCHAR(50), "internet_address" VARCHAR(50), "formatted_address" VARCHAR(200), "location_timestamp" DATETIME, "event_geofence_latitude" VARCHAR(15), "event_geofence_longitude" VARCHAR(15), "radius" BIGINT, "geolocation_positioning_type" VARCHAR(15), "last_geolocation_response" VARCHAR(10), "cause" VARCHAR(150), "api_version" VARCHAR(10) NOT NULL, "uri" LONGVARCHAR NOT NULL)
27+
CREATE PROCEDURE PUBLIC."completeConferenceDetailRecord"(IN "in_sid" VARCHAR(100),IN "in_status" VARCHAR(100),IN "in_slave_ms_id" VARCHAR(100),IN "in_date_updated" TIMESTAMP,IN "amIMaster" BOOLEAN,OUT "completed" BOOLEAN) SPECIFIC "completeConferenceDetailRecord_10482" LANGUAGE SQL NOT DETERMINISTIC MODIFIES SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC SET "completed"=FALSE;IF("amIMaster")THEN UPDATE PUBLIC."restcomm_conference_detail_records" SET PUBLIC."restcomm_conference_detail_records"."master_present"=FALSE,PUBLIC."restcomm_conference_detail_records"."date_updated"="in_date_updated" WHERE PUBLIC."restcomm_conference_detail_records"."sid"="in_sid";IF NOT EXISTS(SELECT PUBLIC."restcomm_media_resource_broker_entity"."conference_sid",PUBLIC."restcomm_media_resource_broker_entity"."slave_ms_id",PUBLIC."restcomm_media_resource_broker_entity"."slave_ms_bridge_ep_id",PUBLIC."restcomm_media_resource_broker_entity"."slave_ms_cnf_ep_id",PUBLIC."restcomm_media_resource_broker_entity"."is_bridged_together" FROM PUBLIC."restcomm_media_resource_broker_entity" WHERE "conference_sid"="in_sid")THEN UPDATE PUBLIC."restcomm_conference_detail_records" SET "status"="in_status","date_updated"="in_date_updated" WHERE "sid"="in_sid";SET "completed"=TRUE;END IF;ELSE DELETE FROM PUBLIC."restcomm_media_resource_broker_entity" WHERE "conference_sid"="in_sid" AND "slave_ms_id"="in_slave_ms_id";IF NOT(SELECT "master_present" FROM PUBLIC."restcomm_conference_detail_records" WHERE "sid"="in_sid")THEN IF NOT EXISTS(SELECT PUBLIC."restcomm_media_resource_broker_entity"."conference_sid",PUBLIC."restcomm_media_resource_broker_entity"."slave_ms_id",PUBLIC."restcomm_media_resource_broker_entity"."slave_ms_bridge_ep_id",PUBLIC."restcomm_media_resource_broker_entity"."slave_ms_cnf_ep_id",PUBLIC."restcomm_media_resource_broker_entity"."is_bridged_together" FROM PUBLIC."restcomm_media_resource_broker_entity" WHERE "conference_sid"="in_sid")THEN UPDATE PUBLIC."restcomm_conference_detail_records" SET "status"="in_status","date_updated"="in_date_updated" WHERE "sid"="in_sid";SET "completed"=TRUE;END IF;END IF;END IF;END
2728
CREATE USER SA PASSWORD ""
2829
GRANT DBA TO SA
2930
SET WRITE_DELAY 10

restcomm/restcomm.application/src/main/webapp/WEB-INF/scripts/mariadb/init.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,10 @@ CREATE PROCEDURE completeConferenceDetailRecord
487487
,IN in_date_updated TIMESTAMP
488488
,IN amIMaster BOOLEAN
489489
,OUT completed BOOLEAN)
490-
490+
491491
BEGIN
492+
493+
START TRANSACTION;
492494
SET completed=FALSE;
493495
IF(amIMaster) THEN
494496
UPDATE restcomm_conference_detail_records SET restcomm_conference_detail_records.master_present=FALSE,restcomm_conference_detail_records.date_updated=in_date_updated WHERE restcomm_conference_detail_records.sid=in_sid;
@@ -505,5 +507,7 @@ BEGIN
505507
END IF;
506508
END IF;
507509
END IF;
510+
COMMIT;
511+
508512
END //
509513
DELIMITER ;

restcomm/restcomm.application/src/main/webapp/WEB-INF/scripts/mariadb/sql/conference-detail-records.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<insert id="addConferenceDetailRecord" parameterType="map">
88
call addConferenceDetailRecord( #{sid}, #{date_created}, #{date_updated}, #{account_sid}, #{status}, #{friendly_name}, #{api_version}, #{uri}, #{master_ms_id}, #{master_present} );
99
</insert>
10+
<select id="completeConferenceDetailRecord" parameterType="map" statementType="CALLABLE">
11+
call completeConferenceDetailRecord( #{sid, mode=IN, jdbcType=VARCHAR}, #{status, mode=IN, jdbcType=VARCHAR}, #{slaveMsId, mode=IN, jdbcType=VARCHAR}, #{dateUpdated, mode=IN, jdbcType=TIMESTAMP}, #{amIMaster, mode=IN, jdbcType=BOOLEAN}, #{completed, mode=OUT, jdbcType=BOOLEAN} );
12+
</select>
1013
<select id="getConferenceDetailRecord" parameterType="string" resultType="hashmap">
1114
SELECT * FROM restcomm_conference_detail_records WHERE sid=#{sid};
1215
</select>

restcomm/restcomm.application/src/main/webapp/WEB-INF/sql/conference-detail-records.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<insert id="addConferenceDetailRecord" parameterType="map">
88
INSERT INTO "restcomm_conference_detail_records" ("sid", "date_created", "date_updated", "account_sid", "status", "friendly_name", "api_version", "uri", "master_ms_id", "master_present") VALUES (#{sid}, #{date_created}, #{date_updated}, #{account_sid}, #{status}, #{friendly_name}, #{api_version}, #{uri}, #{master_ms_id}, #{master_present});
99
</insert>
10+
<select id="completeConferenceDetailRecord" parameterType="map" statementType="CALLABLE">
11+
call "completeConferenceDetailRecord"( #{sid, mode=IN, jdbcType=VARCHAR}, #{status, mode=IN, jdbcType=VARCHAR}, #{slaveMsId, mode=IN, jdbcType=VARCHAR}, #{dateUpdated, mode=IN, jdbcType=TIMESTAMP}, #{amIMaster, mode=IN, jdbcType=BOOLEAN}, #{completed, mode=OUT, jdbcType=BOOLEAN} );
12+
</select>
1013
<select id="getConferenceDetailRecord" parameterType="string" resultType="hashmap">
1114
SELECT * FROM "restcomm_conference_detail_records" WHERE "sid"=#{sid};
1215
</select>

restcomm/restcomm.dao/src/main/java/org/restcomm/connect/dao/ConferenceDetailRecordsDao.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,15 @@ public interface ConferenceDetailRecordsDao {
6464

6565
void updateModeratorPresent(ConferenceDetailRecord cdr);
6666

67+
/**
68+
* @param params
69+
* {sid, mode=IN, jdbcType=VARCHAR}
70+
* {status, mode=IN, jdbcType=VARCHAR}
71+
* {slaveMsId, mode=IN, jdbcType=VARCHAR}
72+
* {dateUpdated, mode=IN, jdbcType=TIMESTAMP}
73+
* {amIMaster, mode=IN, jdbcType=BOOLEAN}
74+
* {completed, mode=OUT, jdbcType=BOOLEAN}
75+
* @return true/false depending on if calling agent was able to complete the conference or not.
76+
*/
6777
boolean completeConferenceDetailRecord(Map params);
6878
}

0 commit comments

Comments
 (0)