diff --git a/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java b/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java index e79c47ebee..9db25b48d6 100644 --- a/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java +++ b/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java @@ -171,8 +171,8 @@ public final class VoiceInterpreter extends BaseVoiceInterpreter { private final State finished; // FSM. - // The conference manager. - private final ActorRef conferenceManager; + // The conference Ceneter. + private final ActorRef conferenceCenter; // State for outbound calls. private boolean isForking; @@ -219,6 +219,9 @@ public final class VoiceInterpreter extends BaseVoiceInterpreter { private String forwardedFrom; private Attribute action; + private String conferenceNameWithAccountAndFriendlyName; + private Sid callSid; + public VoiceInterpreter(final Configuration configuration, final Sid account, final Sid phone, final String version, final URI url, final String method, final URI fallbackUrl, final String fallbackMethod, final URI viStatusCallback, final String statusCallbackMethod, final String referTarget, final String transferor, final String transferee, @@ -374,6 +377,7 @@ public VoiceInterpreter(final Configuration configuration, final Sid account, fi transitions.add(new Transition(acquiringConferenceInfo, hangingUp)); transitions.add(new Transition(acquiringConferenceInfo, finished)); transitions.add(new Transition(joiningConference, conferencing)); + transitions.add(new Transition(joiningConference, acquiringConferenceInfo)); transitions.add(new Transition(joiningConference, hangingUp)); transitions.add(new Transition(joiningConference, finished)); transitions.add(new Transition(conferencing, finishConferencing)); @@ -422,7 +426,7 @@ public VoiceInterpreter(final Configuration configuration, final Sid account, fi this.emailAddress = emailAddress; this.configuration = configuration; this.callManager = callManager; - this.conferenceManager = conferenceManager; + this.conferenceCenter = conferenceManager; this.bridgeManager = bridgeManager; this.smsService = sms; this.smsSessions = new HashMap(); @@ -595,7 +599,7 @@ private void onForkMessage(Object message) throws TransitionFailedException, Tra } private void onConferenceCenterResponse(Object message) throws TransitionFailedException, TransitionNotFoundException, TransitionRollbackException { - if (is(startDialing)) { + if (is(startDialing) || is(joiningConference)) { ConferenceCenterResponse ccReponse = (ConferenceCenterResponse)message; if(ccReponse.succeeded()){ fsm.transition(message, acquiringConferenceInfo); @@ -697,6 +701,15 @@ private void onConferenceStateChanged(Object message) throws TransitionFailedExc if (!is(finished)) fsm.transition(message, finishConferencing); break; + case STOPPING: + conferenceState = event.state(); + if(is(joiningConference)){ + if(logger.isInfoEnabled()) { + logger.info("We tried to join a stopping conference. Will ask Conference Center to create a new conference for us."); + } + final CreateConference create = new CreateConference(conferenceNameWithAccountAndFriendlyName, callSid); + conferenceCenter.tell(create, self()); + } default: break; } @@ -1983,15 +1996,16 @@ public void execute(final Object message) throws Exception { //https://github.com/RestComm/Restcomm-Connect/issues/1939 Sid conferenceAccountId = phoneId == null? accountId : phoneId; buffer.append(conferenceAccountId.toString()).append(":").append(name); - Sid sid = null; + conferenceNameWithAccountAndFriendlyName = buffer.toString(); + callSid = null; if (callInfo != null && callInfo.sid() != null) { - sid = callInfo.sid(); + callSid = callInfo.sid(); } - if (sid == null && callRecord != null) { - sid = callRecord.getSid(); + if (callSid == null && callRecord != null) { + callSid = callRecord.getSid(); } - final CreateConference create = new CreateConference(buffer.toString(), sid); - conferenceManager.tell(create, source); + final CreateConference create = new CreateConference(conferenceNameWithAccountAndFriendlyName, callSid); + conferenceCenter.tell(create, source); } else { // Handle forking. dialBranches = new ArrayList(); @@ -2917,7 +2931,7 @@ public void execute(final Object message) throws Exception { ConferenceStateChanged confStateChanged = (ConferenceStateChanged) message; if (ConferenceStateChanged.State.COMPLETED.equals(confStateChanged.state())) { DestroyConference destroyConference = new DestroyConference(conferenceInfo.name()); - conferenceManager.tell(destroyConference, super.source); + conferenceCenter.tell(destroyConference, super.source); } } conference = null; diff --git a/restcomm/restcomm.telephony.api/src/main/java/org/restcomm/connect/telephony/api/ConferenceStateChanged.java b/restcomm/restcomm.telephony.api/src/main/java/org/restcomm/connect/telephony/api/ConferenceStateChanged.java index c903a00f41..bcb3c3eee8 100644 --- a/restcomm/restcomm.telephony.api/src/main/java/org/restcomm/connect/telephony/api/ConferenceStateChanged.java +++ b/restcomm/restcomm.telephony.api/src/main/java/org/restcomm/connect/telephony/api/ConferenceStateChanged.java @@ -22,10 +22,11 @@ /** * @author quintana.thomas@gmail.com (Thomas Quintana) * @author amit.bhayani@telestax.com (Amit Bhayani) + * @author maria.farooq@telestax.com (Maria Farooq) */ public final class ConferenceStateChanged { public enum State { - RUNNING_INITIALIZING, RUNNING_MODERATOR_ABSENT, RUNNING_MODERATOR_PRESENT, COMPLETED, FAILED + RUNNING_INITIALIZING, RUNNING_MODERATOR_ABSENT, RUNNING_MODERATOR_PRESENT, STOPPING, COMPLETED, FAILED }; private final String name; @@ -69,6 +70,10 @@ public static State translateState(String stateName, State defaultState) { converetedState=State.FAILED; break; + case "STOPPING": + converetedState=State.STOPPING; + break; + default: break; } diff --git a/restcomm/restcomm.telephony/resources/dao-manager.xml b/restcomm/restcomm.telephony/resources/dao-manager.xml new file mode 100644 index 0000000000..407f0cd578 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/dao-manager.xml @@ -0,0 +1,24 @@ + + + + + + ./src/test/resources/mybatis.xml + ./src/test/resources/data/hsql + ./src/test/resources/mappers + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/data/hsql/restcomm.log b/restcomm/restcomm.telephony/resources/data/hsql/restcomm.log new file mode 100644 index 0000000000..524c053bcd --- /dev/null +++ b/restcomm/restcomm.telephony/resources/data/hsql/restcomm.log @@ -0,0 +1,21 @@ +/*C6*/SET SCHEMA PUBLIC +DELETE FROM "restcomm_media_servers" WHERE "ms_id"=2 AND "local_ip"='127.0.0.1' AND "local_port"=2727 AND "remote_ip"='127.0.0.1' AND "remote_port"=2427 AND "compatibility" IS NULL AND "response_timeout"='1500' AND "external_address" IS NULL +INSERT INTO "restcomm_media_servers" VALUES(2,'127.0.0.1',2727,'127.0.0.1',2427,NULL,'1500',NULL) +COMMIT +INSERT INTO "restcomm_conference_detail_records" VALUES('CF81f7e156651244d8ae7728011841caf9','2017-04-04 12:28:07.312000','2017-04-04 12:28:07.313000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_INITIALIZING','69b86c28553d4341a5e9ff35ad1dde68','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF81f7e156651244d8ae7728011841caf9','2',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +COMMIT +DELETE FROM "restcomm_conference_detail_records" WHERE "sid"='CF81f7e156651244d8ae7728011841caf9' +INSERT INTO "restcomm_conference_detail_records" VALUES('CF81f7e156651244d8ae7728011841caf9','2017-04-04 12:28:07.312000','2017-04-04 12:28:07.404000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_INITIALIZING','69b86c28553d4341a5e9ff35ad1dde68','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF81f7e156651244d8ae7728011841caf9','2','mobicents/cnf/1',TRUE,'mobicents/ivr/2','2',NULL,NULL,NULL,'2') +COMMIT +DELETE FROM "restcomm_conference_detail_records" WHERE "sid"='CF81f7e156651244d8ae7728011841caf9' +INSERT INTO "restcomm_conference_detail_records" VALUES('CF81f7e156651244d8ae7728011841caf9','2017-04-04 12:28:07.312000','2017-04-04 12:28:07.410000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_MODERATOR_ABSENT','69b86c28553d4341a5e9ff35ad1dde68','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF81f7e156651244d8ae7728011841caf9','2','mobicents/cnf/1',TRUE,'mobicents/ivr/2','2',NULL,NULL,NULL,'2') +COMMIT +DELETE FROM "restcomm_conference_detail_records" WHERE "sid"='CF81f7e156651244d8ae7728011841caf9' +INSERT INTO "restcomm_conference_detail_records" VALUES('CF81f7e156651244d8ae7728011841caf9','2017-04-04 12:28:07.312000','2017-04-04 12:28:10.442000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_MODERATOR_ABSENT','69b86c28553d4341a5e9ff35ad1dde68','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF81f7e156651244d8ae7728011841caf9','2','mobicents/cnf/1',TRUE,'mobicents/ivr/2','2','mobicents/bridge/$','1','1d','2') +COMMIT +DELETE FROM "restcomm_conference_detail_records" WHERE "sid"='CF81f7e156651244d8ae7728011841caf9' +INSERT INTO "restcomm_conference_detail_records" VALUES('CF81f7e156651244d8ae7728011841caf9','2017-04-04 12:28:07.312000','2017-04-04 12:28:13.472000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_MODERATOR_ABSENT','69b86c28553d4341a5e9ff35ad1dde68','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF81f7e156651244d8ae7728011841caf9','2','mobicents/cnf/1',FALSE,'mobicents/ivr/2','2','mobicents/bridge/$','1','1d','2') +COMMIT +DELETE FROM "restcomm_conference_detail_records" WHERE "sid"='CF81f7e156651244d8ae7728011841caf9' +INSERT INTO "restcomm_conference_detail_records" VALUES('CF81f7e156651244d8ae7728011841caf9','2017-04-04 12:28:07.312000','2017-04-04 12:28:13.477000','ACae6e420f425248d6a26948c17a9e2acf','COMPLETED','69b86c28553d4341a5e9ff35ad1dde68','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF81f7e156651244d8ae7728011841caf9','2','mobicents/cnf/1',FALSE,'mobicents/ivr/2','2','mobicents/bridge/$','1','1d','2') +COMMIT diff --git a/restcomm/restcomm.telephony/resources/data/hsql/restcomm.properties b/restcomm/restcomm.telephony/resources/data/hsql/restcomm.properties new file mode 100644 index 0000000000..75e2e0294d --- /dev/null +++ b/restcomm/restcomm.telephony/resources/data/hsql/restcomm.properties @@ -0,0 +1,4 @@ +#HSQL Database Engine 2.3.2 +#Tue Apr 04 12:28:07 EEST 2017 +version=2.3.2 +modified=yes diff --git a/restcomm/restcomm.telephony/resources/data/hsql/restcomm.script b/restcomm/restcomm.telephony/resources/data/hsql/restcomm.script new file mode 100644 index 0000000000..55e26c1fb3 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/data/hsql/restcomm.script @@ -0,0 +1,107 @@ +SET DATABASE UNIQUE NAME HSQLDB5A4BD4D141 +SET DATABASE GC 0 +SET DATABASE DEFAULT RESULT MEMORY ROWS 0 +SET DATABASE EVENT LOG LEVEL 0 +SET DATABASE TRANSACTION CONTROL LOCKS +SET DATABASE DEFAULT ISOLATION LEVEL READ COMMITTED +SET DATABASE TRANSACTION ROLLBACK ON CONFLICT TRUE +SET DATABASE TEXT TABLE DEFAULTS '' +SET DATABASE SQL NAMES FALSE +SET DATABASE SQL REFERENCES FALSE +SET DATABASE SQL SIZE TRUE +SET DATABASE SQL TYPES FALSE +SET DATABASE SQL TDC DELETE TRUE +SET DATABASE SQL TDC UPDATE TRUE +SET DATABASE SQL TRANSLATE TTI TYPES TRUE +SET DATABASE SQL CONCAT NULLS TRUE +SET DATABASE SQL UNIQUE NULLS TRUE +SET DATABASE SQL CONVERT TRUNCATE TRUE +SET DATABASE SQL AVG SCALE 0 +SET DATABASE SQL DOUBLE NAN TRUE +SET FILES WRITE DELAY 0 +SET FILES BACKUP INCREMENT TRUE +SET FILES CACHE SIZE 10000 +SET FILES CACHE ROWS 50000 +SET FILES SCALE 32 +SET FILES LOB SCALE 32 +SET FILES DEFRAG 0 +SET FILES NIO TRUE +SET FILES NIO SIZE 256 +SET FILES LOG TRUE +SET FILES LOG SIZE 50 +CREATE USER SA PASSWORD DIGEST 'd41d8cd98f00b204e9800998ecf8427e' +ALTER USER SA SET LOCAL TRUE +CREATE SCHEMA PUBLIC AUTHORIZATION DBA +SET SCHEMA PUBLIC +CREATE MEMORY TABLE PUBLIC."restcomm_instance_id"("instance_id" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"host" VARCHAR(255) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_accounts"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"email_address" VARCHAR(16777216) NOT NULL,"friendly_name" VARCHAR(64) NOT NULL,"parent_sid" VARCHAR(34),"type" VARCHAR(8) NOT NULL,"status" VARCHAR(16) NOT NULL,"auth_token" VARCHAR(32) NOT NULL,"role" VARCHAR(64) NOT NULL,"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_announcements"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"account_sid" VARCHAR(34),"gender" VARCHAR(8) NOT NULL,"language" VARCHAR(16) NOT NULL,"text" VARCHAR(32) NOT NULL,"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_available_phone_numbers"("friendly_name" VARCHAR(64) NOT NULL,"phone_number" VARCHAR(15) NOT NULL PRIMARY KEY,"lata" SMALLINT,"rate_center" VARCHAR(32),"latitude" DOUBLE,"longitude" DOUBLE,"region" VARCHAR(2),"postal_code" INTEGER,"iso_country" VARCHAR(2) NOT NULL,"voice_capable" BOOLEAN,"sms_capable" BOOLEAN,"mms_capable" BOOLEAN,"fax_capable" BOOLEAN,"cost" VARCHAR(10)) +CREATE MEMORY TABLE PUBLIC."restcomm_outgoing_caller_ids"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"friendly_name" VARCHAR(64) NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"phone_number" VARCHAR(15) NOT NULL,"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_http_cookies"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"comment" VARCHAR(16777216),"domain" VARCHAR(16777216),"expiration_date" TIMESTAMP,"name" VARCHAR(16777216) NOT NULL,"path" VARCHAR(16777216),"value" VARCHAR(16777216),"version" INTEGER) +CREATE MEMORY TABLE PUBLIC."restcomm_incoming_phone_numbers"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"friendly_name" VARCHAR(64) NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"phone_number" VARCHAR(30) NOT NULL,"api_version" VARCHAR(10) NOT NULL,"voice_caller_id_lookup" BOOLEAN NOT NULL,"voice_url" VARCHAR(16777216),"voice_method" VARCHAR(4),"voice_fallback_url" VARCHAR(16777216),"voice_fallback_method" VARCHAR(4),"status_callback" VARCHAR(16777216),"status_callback_method" VARCHAR(4),"voice_application_sid" VARCHAR(34),"sms_url" VARCHAR(16777216),"sms_method" VARCHAR(4),"sms_fallback_url" VARCHAR(16777216),"sms_fallback_method" VARCHAR(4),"sms_application_sid" VARCHAR(34),"uri" VARCHAR(16777216) NOT NULL,"voice_capable" BOOLEAN,"sms_capable" BOOLEAN,"mms_capable" BOOLEAN,"fax_capable" BOOLEAN,"pure_sip" BOOLEAN,"cost" VARCHAR(10),"ussd_url" VARCHAR(16777216),"ussd_method" VARCHAR(4),"ussd_fallback_url" VARCHAR(16777216),"ussd_fallback_method" VARCHAR(4),"ussd_application_sid" VARCHAR(34)) +CREATE MEMORY TABLE PUBLIC."restcomm_applications"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"friendly_name" VARCHAR(64) NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"api_version" VARCHAR(10) NOT NULL,"voice_caller_id_lookup" BOOLEAN NOT NULL,"uri" VARCHAR(16777216) NOT NULL,"rcml_url" VARCHAR(16777216),"kind" VARCHAR(5)) +CREATE MEMORY TABLE PUBLIC."restcomm_call_detail_records"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"parent_call_sid" VARCHAR(34),"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"sender" VARCHAR(30) NOT NULL,"recipient" VARCHAR(64) NOT NULL,"phone_number_sid" VARCHAR(34),"status" VARCHAR(20) NOT NULL,"start_time" TIMESTAMP,"end_time" TIMESTAMP,"duration" INTEGER,"price" VARCHAR(8),"direction" VARCHAR(20) NOT NULL,"answered_by" VARCHAR(64),"api_version" VARCHAR(10) NOT NULL,"forwarded_from" VARCHAR(30),"caller_name" VARCHAR(50),"uri" VARCHAR(16777216) NOT NULL,"call_path" VARCHAR(255),"ring_duration" INTEGER,"instanceid" VARCHAR(255) NOT NULL,"conference_sid" VARCHAR(34),"muted" BOOLEAN,"start_conference_on_enter" BOOLEAN,"end_conference_on_exit" BOOLEAN,"on_hold" BOOLEAN,"ms_id" VARCHAR(34)) +CREATE MEMORY TABLE PUBLIC."restcomm_conference_detail_records"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"status" VARCHAR(100) NOT NULL,"friendly_name" VARCHAR(60),"api_version" VARCHAR(10) NOT NULL,"uri" VARCHAR(16777216) NOT NULL,"master_ms_id" VARCHAR(34),"master_conference_endpoint_id" VARCHAR(20),"master_present" BOOLEAN DEFAULT TRUE,"master_ivr_endpoint_id" VARCHAR(20),"master_ivr_endpoint_session_id" VARCHAR(200),"master_bridge_endpoint_id" VARCHAR(20),"master_bridge_endpoint_session_id" VARCHAR(200),"master_bridge_conn_id" VARCHAR(200),"master_ivr_conn_id" VARCHAR(200)) +CREATE MEMORY TABLE PUBLIC."restcomm_clients"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"api_version" VARCHAR(10) NOT NULL,"friendly_name" VARCHAR(64) NOT NULL,"login" VARCHAR(64) NOT NULL,"password" VARCHAR(64) NOT NULL,"status" INTEGER NOT NULL,"voice_url" VARCHAR(16777216),"voice_method" VARCHAR(4),"voice_fallback_url" VARCHAR(16777216),"voice_fallback_method" VARCHAR(4),"voice_application_sid" VARCHAR(34),"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_registrations"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"date_expires" TIMESTAMP NOT NULL,"address_of_record" VARCHAR(16777216) NOT NULL,"display_name" VARCHAR(255),"user_name" VARCHAR(64) NOT NULL,"user_agent" VARCHAR(16777216),"ttl" INTEGER NOT NULL,"location" VARCHAR(16777216) NOT NULL,"webrtc" BOOLEAN DEFAULT FALSE,"instanceid" VARCHAR(255),"isLBPresent" BOOLEAN DEFAULT FALSE) +CREATE MEMORY TABLE PUBLIC."restcomm_short_codes"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"friendly_name" VARCHAR(64) NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"short_code" INTEGER NOT NULL,"api_version" VARCHAR(10) NOT NULL,"sms_url" VARCHAR(16777216),"sms_method" VARCHAR(4),"sms_fallback_url" VARCHAR(16777216),"sms_fallback_method" VARCHAR(4),"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_sms_messages"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"date_sent" TIMESTAMP,"account_sid" VARCHAR(34) NOT NULL,"sender" VARCHAR(15) NOT NULL,"recipient" VARCHAR(64) NOT NULL,"body" VARCHAR(999) NOT NULL,"status" VARCHAR(20) NOT NULL,"direction" VARCHAR(14) NOT NULL,"price" VARCHAR(8) NOT NULL,"api_version" VARCHAR(10) NOT NULL,"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_recordings"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"call_sid" VARCHAR(34) NOT NULL,"duration" DOUBLE NOT NULL,"api_version" VARCHAR(10) NOT NULL,"uri" VARCHAR(16777216) NOT NULL,"file_uri" VARCHAR(16777216)) +CREATE MEMORY TABLE PUBLIC."restcomm_transcriptions"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"status" VARCHAR(11) NOT NULL,"recording_sid" VARCHAR(34) NOT NULL,"duration" DOUBLE NOT NULL,"transcription_text" VARCHAR(16777216),"price" VARCHAR(8) NOT NULL,"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_notifications"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"account_sid" VARCHAR(34) NOT NULL,"call_sid" VARCHAR(34),"api_version" VARCHAR(10) NOT NULL,"log" TINYINT NOT NULL,"error_code" SMALLINT NOT NULL,"more_info" VARCHAR(16777216) NOT NULL,"message_text" VARCHAR(16777216) NOT NULL,"message_date" TIMESTAMP NOT NULL,"request_url" VARCHAR(16777216) NOT NULL,"request_method" VARCHAR(4) NOT NULL,"request_variables" VARCHAR(16777216) NOT NULL,"response_headers" VARCHAR(16777216),"response_body" VARCHAR(16777216),"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_sand_boxes"("date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"pin" VARCHAR(8) NOT NULL,"account_sid" VARCHAR(34) NOT NULL PRIMARY KEY,"phone_number" VARCHAR(15) NOT NULL,"application_sid" VARCHAR(34) NOT NULL,"api_version" VARCHAR(10) NOT NULL,"voice_url" VARCHAR(16777216),"voice_method" VARCHAR(4),"sms_url" VARCHAR(16777216),"sms_method" VARCHAR(4),"status_callback" VARCHAR(16777216),"status_callback_method" VARCHAR(4),"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_gateways"("sid" VARCHAR(34) NOT NULL PRIMARY KEY,"date_created" TIMESTAMP NOT NULL,"date_updated" TIMESTAMP NOT NULL,"friendly_name" VARCHAR(255),"user_name" VARCHAR(255),"password" VARCHAR(255),"proxy" VARCHAR(16777216) NOT NULL,"register" BOOLEAN NOT NULL,"ttl" INTEGER NOT NULL,"uri" VARCHAR(16777216) NOT NULL) +CREATE MEMORY TABLE PUBLIC."restcomm_media_servers"("ms_id" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL,"local_ip" VARCHAR(34) NOT NULL,"local_port" INTEGER NOT NULL,"remote_ip" VARCHAR(34) NOT NULL,"remote_port" INTEGER NOT NULL,"compatibility" VARCHAR(34) DEFAULT 'rms',"response_timeout" VARCHAR(34),"external_address" VARCHAR(34),UNIQUE("remote_ip")) +ALTER TABLE PUBLIC."restcomm_media_servers" ALTER COLUMN "ms_id" RESTART WITH 4 +CREATE MEMORY TABLE PUBLIC."restcomm_media_resource_broker_entity"("conference_sid" VARCHAR(34) NOT NULL,"slave_ms_id" VARCHAR(34) NOT NULL,"slave_ms_bridge_ep_id" VARCHAR(34),"slave_ms_cnf_ep_id" VARCHAR(34),"is_bridged_together" BOOLEAN DEFAULT FALSE,PRIMARY KEY("conference_sid","slave_ms_id")) +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) +CREATE PROCEDURE PUBLIC."addConferenceDetailRecord"(IN "in_sid" VARCHAR(34),IN "in_date_created" TIMESTAMP,IN "in_date_updated" TIMESTAMP,IN "in_account_sid" VARCHAR(34),IN "in_status" VARCHAR(100),IN "in_friendly_name" VARCHAR(60),IN "in_api_version" VARCHAR(10),IN "in_uri" VARCHAR(16777216),IN "in_master_ms_id" VARCHAR(34),IN "master_present" BOOLEAN) SPECIFIC "addConferenceDetailRecord_10446" LANGUAGE SQL NOT DETERMINISTIC MODIFIES SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC IF NOT EXISTS(SELECT PUBLIC."restcomm_conference_detail_records"."sid",PUBLIC."restcomm_conference_detail_records"."date_created",PUBLIC."restcomm_conference_detail_records"."date_updated",PUBLIC."restcomm_conference_detail_records"."account_sid",PUBLIC."restcomm_conference_detail_records"."status",PUBLIC."restcomm_conference_detail_records"."friendly_name",PUBLIC."restcomm_conference_detail_records"."api_version",PUBLIC."restcomm_conference_detail_records"."uri",PUBLIC."restcomm_conference_detail_records"."master_ms_id",PUBLIC."restcomm_conference_detail_records"."master_conference_endpoint_id",PUBLIC."restcomm_conference_detail_records"."master_present",PUBLIC."restcomm_conference_detail_records"."master_ivr_endpoint_id",PUBLIC."restcomm_conference_detail_records"."master_ivr_endpoint_session_id",PUBLIC."restcomm_conference_detail_records"."master_bridge_endpoint_id",PUBLIC."restcomm_conference_detail_records"."master_bridge_endpoint_session_id",PUBLIC."restcomm_conference_detail_records"."master_bridge_conn_id",PUBLIC."restcomm_conference_detail_records"."master_ivr_conn_id" FROM PUBLIC."restcomm_conference_detail_records" WHERE "friendly_name"="in_friendly_name" AND "status" LIKE'RUNNING%')THEN INSERT INTO PUBLIC."restcomm_conference_detail_records"("sid","date_created","date_updated","account_sid","status","friendly_name","api_version","uri","master_ms_id","master_present")VALUES("in_sid","in_date_created","in_date_updated","in_account_sid","in_status","in_friendly_name","in_api_version","in_uri","in_master_ms_id","master_present");END IF;END +ALTER SEQUENCE SYSTEM_LOBS.LOB_ID RESTART WITH 1 +SET DATABASE DEFAULT INITIAL SCHEMA PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.SQL_IDENTIFIER TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.YES_OR_NO TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.TIME_STAMP TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CARDINAL_NUMBER TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CHARACTER_DATA TO PUBLIC +GRANT DBA TO SA +SET SCHEMA SYSTEM_LOBS +INSERT INTO BLOCKS VALUES(0,2147483647,0) +SET SCHEMA PUBLIC +INSERT INTO "restcomm_incoming_phone_numbers" VALUES('PN46678e5b01d44973bf184f6527bc33f7','2014-02-17 22:37:08.709000','2014-02-17 22:37:08.709000','This is an IVR app that maps user input to specific action','ACae6e420f425248d6a26948c17a9e2acf','+1240','2012-04-24',FALSE,NULL,'POST',NULL,'POST',NULL,'POST','AP00000000000000000000000000000000',NULL,'POST',NULL,'POST','AP11111111111111111111111111111111','/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/IncomingPhoneNumbers/PN46678e5b01d44973bf184f6527bc33f7',NULL,NULL,NULL,NULL,TRUE,'0.0',NULL,NULL,NULL,NULL,'AP22222222222222222222222222222222') +INSERT INTO "restcomm_applications" VALUES('AP00000000000000000000000000000000','2015-09-23 06:56:04.108000','2015-09-23 06:56:04.108000','app0','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24',FALSE,'/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Applications/AP73926e7113fa4d95981aa96b76eca854','/restcomm-rvd/services/apps/AP73926e7113fa4d95981aa96b76eca854/controller','voice') +INSERT INTO "restcomm_applications" VALUES('AP11111111111111111111111111111111','2015-09-23 06:56:04.108000','2015-09-23 06:56:04.108000','app1','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24',FALSE,'/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Applications/AP73926e7113fa4d95981aa96b76eca854','/restcomm-rvd/services/apps/AP73926e7113fa4d95981aa96b76eca854/controller','sms') +INSERT INTO "restcomm_applications" VALUES('AP22222222222222222222222222222222','2015-09-23 06:56:04.108000','2015-09-23 06:56:04.108000','app2','ACae6e420f425248d6a26948c17a9e2acf','2012-04-24',FALSE,'/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Applications/AP73926e7113fa4d95981aa96b76eca854','/restcomm-rvd/services/apps/AP73926e7113fa4d95981aa96b76eca854/controller','ussd') +INSERT INTO "restcomm_call_detail_records" VALUES('CA01a09068a1f348269b6670ef599a6e57',NULL,'2013-08-23 14:30:07.820000','2017-04-04 12:27:48.433000','ACae6e420f425248d6a26948c17a9e2acf','Anonymous','+15126002188',NULL,'in-progress','2013-08-23 14:30:08.081000',NULL,NULL,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA01a09068a1f348269b6670ef599a6e57',NULL,NULL,'IN1',NULL,NULL,NULL,NULL,NULL,'2') +INSERT INTO "restcomm_call_detail_records" VALUES('CA0263e1e3ff024c03a66af08419f171e7',NULL,'2013-08-05 18:50:17.769000','2013-08-05 18:50:17.818000','ACae6e420f425248d6a26948c17a9e2acf','13522703400','+13052406432',NULL,'in-progress','2013-08-05 18:50:17.818000',NULL,NULL,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA0263e1e3ff024c03a66af08419f171e7',NULL,NULL,'IN1',NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA0274d5da7193430f9b5b566fde81f924',NULL,'2013-08-27 14:02:23.775000','2013-08-27 14:02:23.900000','ACae6e420f425248d6a26948c17a9e2acf','+302109762259','+15126002188',NULL,'in-progress','2013-08-27 14:02:23.900000',NULL,NULL,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA0274d5da7193430f9b5b566fde81f924',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA042b13b97e9044eda8e2c1290b40ecae',NULL,'2013-07-31 14:20:39.804000','2013-07-31 14:20:40.186000','ACae6e420f425248d6a26948c17a9e2acf','+1011420534008567','+15126002188',NULL,'in-progress','2013-07-31 14:20:40.186000',NULL,NULL,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA042b13b97e9044eda8e2c1290b40ecae',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA04625ae86bf441b8a2d0aebb4d129537',NULL,'2013-09-10 14:03:36.496000','2013-09-10 14:03:36.871000','ACae6e420f425248d6a26948c17a9e2acf','+302109762259','+15126002188',NULL,'in-progress','2013-09-10 14:03:36.871000',NULL,NULL,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA04625ae86bf441b8a2d0aebb4d129537',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA04f4ed662d2d4d278486392670eab469',NULL,'2013-08-22 14:00:20.400000','2013-08-22 14:00:21.179000','ACae6e420f425248d6a26948c17a9e2acf','+302109762259','+15126002188',NULL,'in-progress','2013-08-22 14:00:21.179000',NULL,NULL,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA04f4ed662d2d4d278486392670eab469',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA04fe49f7cfc74a86a25121f3fe6ef0cc',NULL,'2013-08-23 13:58:46.454000','2013-08-23 13:58:46.561000','ACae6e420f425248d6a26948c17a9e2acf','19524007323','+15126002188',NULL,'in-progress','2013-08-23 13:58:46.561000',NULL,NULL,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA04fe49f7cfc74a86a25121f3fe6ef0cc',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA0587fa4500f746a8bddca55efc53011c',NULL,'2013-08-30 16:28:33.403000','2013-08-30 16:28:44.376000','ACae6e420f425248d6a26948c17a9e2acf','+302118009620','+15126002188',NULL,'completed','2013-08-30 16:28:33.500000','2013-08-30 16:28:44.376000',10,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA0587fa4500f746a8bddca55efc53011c',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA05c8c9f48a2c48aca682c75f06e0c0ae',NULL,'2013-08-22 14:14:24.479000','2013-08-22 14:14:24.582000','ACae6e420f425248d6a26948c17a9e2acf','Anonymous','+15126002188',NULL,'in-progress','2013-08-22 14:14:24.582000',NULL,NULL,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA05c8c9f48a2c48aca682c75f06e0c0ae',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA066055a5680c43129d3d9d5ce8c2b839',NULL,'2013-07-30 15:08:21.228000','2013-07-30 15:08:21.601000','ACae6e420f425248d6a26948c17a9e2acf','15123663011','+15126002188',NULL,'in-progress','2013-07-30 15:08:21.601000',NULL,NULL,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA066055a5680c43129d3d9d5ce8c2b839',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA074b489546484e009b645c7c71a24fb3',NULL,'2013-08-09 15:25:31.303000','2013-08-09 15:25:40.835000','ACae6e420f425248d6a26948c17a9e2acf','alice','+17863580884',NULL,'in-progress','2013-08-09 15:25:32.320000','2013-08-09 15:25:40.835000',8,'0.00','outbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA074b489546484e009b645c7c71a24fb7',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA074b489546484e009b645c7c71a24fb4',NULL,'2013-08-09 15:25:31.303000','2013-08-09 15:25:40.835000','ACae6e420f425248d6a26948c17a9e2acf','alice','+17863580885',NULL,'in-progress','2013-08-09 15:25:32.320000','2013-08-09 15:25:40.835000',8,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA074b489546484e009b645c7c71a24fb7',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA074b489546484e009b645c7c71a24fb5',NULL,'2013-08-09 15:25:31.303000','2013-08-09 15:25:40.835000','ACae6e420f425248d6a26948c17a9e2ace','bob','+17863580884',NULL,'in-progress','2013-08-09 15:25:32.320000','2013-08-09 15:25:40.835000',8,'0.00','outbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2ace/Calls/CA074b489546484e009b645c7c71a24fb7',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA074b489546484e009b645c7c71a24fb6',NULL,'2013-08-09 15:25:31.303000','2013-08-09 15:25:40.835000','ACae6e420f425248d6a26948c17a9e2ace','bob','+17863580885',NULL,'in-progress','2013-08-09 15:25:32.320000','2013-08-09 15:25:40.835000',8,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2ace/Calls/CA074b489546484e009b645c7c71a24fb7',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA074b489546484e009b645c7c71a24fb7',NULL,'2013-08-09 15:25:31.303000','2013-08-09 15:25:40.835000','ACae6e420f425248d6a26948c17a9e2ace','bob','+17863580884',NULL,'completed','2013-08-09 15:25:32.320000','2013-08-09 15:25:40.835000',8,'0.00','outbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2ace/Calls/CA074b489546484e009b645c7c71a24fb7',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA074b489546484e009b645c7c71a24fb8',NULL,'2013-08-09 15:25:31.303000','2013-08-09 15:25:40.835000','ACae6e420f425248d6a26948c17a9e2acf','14582010335','+17863580884',NULL,'completed','2013-08-09 15:25:32.320000','2013-08-09 15:25:40.835000',8,'0.00','inbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA074b489546484e009b645c7c71a24fb7',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CA074b489546484e009b645c7c71a24fb9',NULL,'2013-08-09 15:25:31.303000','2013-08-09 15:25:40.835000','ACae6e420f425248d6a26948c17a9e2acf','alice','+17863580884',NULL,'completed','2013-08-09 15:25:32.320000','2013-08-09 15:25:40.835000',8,'0.00','outbound',NULL,'2012-04-24',NULL,NULL,'/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CA074b489546484e009b645c7c71a24fb7',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CAe59f8cad0acf42d2b99945b24dafff67',NULL,'2016-11-01 00:28:42.532000','2016-11-01 00:28:43.007000','ACae6e420f425248d6a26948c17a9e2acz','+15126002188','bob',NULL,'IN_PROGRESS','2016-11-01 00:28:42.966000',NULL,NULL,'0.00','outbound-api','bob','2012-04-24',NULL,'+15126002188','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CAe59f8cad0acf42d2b99945b24dafff67','akka://RestComm/user/$k',0,'ID4f87e51994824d13b90a2c54a77f4624',NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_call_detail_records" VALUES('CAf11920a1b4a244bfa9e34121e92dc508',NULL,'2016-11-01 00:28:43.297000','2016-11-01 00:28:43.417000','ACae6e420f425248d6a26948c17a9e2acz','+13055872294','+131313',NULL,'IN_PROGRESS','2016-11-01 00:28:43.410000',NULL,NULL,'0.00','outbound-api','+131313','2012-04-24',NULL,'+13055872294','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls/CAf11920a1b4a244bfa9e34121e92dc508','akka://RestComm/user/$n',0,'ID4f87e51994824d13b90a2c54a77f4624',NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CF2682b90b79a54818bec0081a5030f00d','2017-02-17 16:50:02.739000','2017-02-17 16:50:02.740000','ACae6e420f425248d6a26948c17a9e2acf','COMPLETED','1111','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF2682b90b79a54818bec0081a5030f00d','2',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CF383f8a850864463eba42f54607abeffb','2017-02-17 17:43:24.605000','2017-02-17 17:43:24.606000','ACae6e420f425248d6a26948c17a9e2acf','COMPLETED','1122','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF383f8a850864463eba42f54607abeffb','2',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CF431fe269bcc74a578681a8f9c21ad914','2017-02-17 18:54:00.854000','2017-02-17 18:54:00.855000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_INITIALIZING','1122','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF431fe269bcc74a578681a8f9c21ad914','1',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CF7ee62a850850417caefd2cd247e355c8','2017-02-17 19:12:53.635000','2017-02-17 19:12:53.637000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_INITIALIZING','165f60557e7c400690b166acd39dd353','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF7ee62a850850417caefd2cd247e355c8','2',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CF86850b916f294797b4d52dff754712c8','2017-02-22 20:55:44.759000','2017-02-22 20:55:44.762000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_INITIALIZING','b6c14fa3278a450f839def4fd80d0877','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF86850b916f294797b4d52dff754712c8','2',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CF8b6fcc9a69054e58812a6732d177755e','2017-04-04 12:27:49.062000','2017-04-04 12:27:49.063000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_INITIALIZING','96c0efd1772f4ba08c3657ea7cfa3dc4','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF8b6fcc9a69054e58812a6732d177755e','2',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CF9fd1ad462f77424bab2ae1343b281655','2017-02-22 18:30:38.079000','2017-02-22 18:30:38.080000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_INITIALIZING','1111','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CF9fd1ad462f77424bab2ae1343b281655','2',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CFc44f6de563544911889a5358eaa0e6a8','2017-02-17 19:13:35.159000','2017-02-17 19:13:35.160000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_INITIALIZING','f7d9b013aaa34a92855cbf400909015e','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CFc44f6de563544911889a5358eaa0e6a8','2',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CFcab3cf660bc9490fa51b888fb87f9911','2017-02-22 18:30:33.812000','2017-02-22 18:30:33.813000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_INITIALIZING','eabfef1a007e41d68ae966c8ab629140','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CFcab3cf660bc9490fa51b888fb87f9911','2',NULL,TRUE,NULL,NULL,NULL,NULL,NULL,NULL) +INSERT INTO "restcomm_conference_detail_records" VALUES('CFfd544f994f2e4402a216b4651e3a6d4c','2017-02-17 19:14:28.570000','2017-02-17 19:14:28.572000','ACae6e420f425248d6a26948c17a9e2acf','RUNNING_MODERATOR_ABSENT','8cbcddb1b6e645f49b75b9deeaabbe5f','2012-04-24','/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Conferences/CFfd544f994f2e4402a216b4651e3a6d4c','3','mobicents/cnf/1',TRUE,'mobicents/ivr/2','2',NULL,NULL,NULL,'2') +INSERT INTO "restcomm_clients" VALUES('CL673db011517d40528a5e78ce8fbf07e5','2013-09-13 11:36:24.916000','2013-09-13 11:36:24.916000','ACa60def3495a345e99973aeca0976be0c','2012-04-24','Alice','alice','1234',1,'http://127.0.0.1:8080/restcomm/demos/hello-world.xml','GET','http://127.0.0.1:8080/restcomm/demos/hello-world.xml','GET','AP2aa6d5236b704afeae960a222a481ea4','http://127.0.0.1:8080/restcomm/demos/hello-world.xml') +INSERT INTO "restcomm_media_servers" VALUES(3,'127.0.0.3',2727,'127.0.0.3',2427,NULL,'1500',NULL) +INSERT INTO "restcomm_media_servers" VALUES(1,'127.0.0.2',2728,'127.0.0.2',2428,NULL,'1500',NULL) +INSERT INTO "restcomm_media_servers" VALUES(2,'127.0.0.1',2727,'127.0.0.1',2427,NULL,'1500',NULL) diff --git a/restcomm/restcomm.telephony/resources/log4j.xml b/restcomm/restcomm.telephony/resources/log4j.xml new file mode 100644 index 0000000000..b3677225e2 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/log4j.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/accounts.xml b/restcomm/restcomm.telephony/resources/mappers/accounts.xml new file mode 100644 index 0000000000..76d26efaf0 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/accounts.xml @@ -0,0 +1,32 @@ + + + + + + INSERT INTO "restcomm_accounts" ("sid", "date_created", "date_updated", "email_address", "friendly_name", "account_sid", "type", "status", "auth_token", "role", "uri") + VALUES(#{sid}, #{date_created}, #{date_updated}, #{email_address}, #{friendly_name}, #{account_sid}, #{type}, #{status}, #{auth_token}, #{role}, #{uri}); + + + + + + + + + + DELETE FROM "restcomm_accounts" WHERE "sid"=#{sid}; + + + + UPDATE "restcomm_accounts" SET "date_updated"=#{date_updated}, "email_address"=#{email_address}, "friendly_name"=#{friendly_name}, + "type"=#{type}, "status"=#{status}, "auth_token"=#{auth_token}, "role"=#{role} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/announcements.xml b/restcomm/restcomm.telephony/resources/mappers/announcements.xml new file mode 100644 index 0000000000..62a5a7bae9 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/announcements.xml @@ -0,0 +1,23 @@ + + + + + + INSERT INTO "restcomm_announcements" ("sid", "date_created", "account_sid", "gender", "language", "text", "uri") + VALUES(#{sid}, #{date_created}, #{account_sid}, #{gender}, #{language}, #{text}, #{uri}); + + + + + + + + DELETE FROM "restcomm_announcements" WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/applications.xml b/restcomm/restcomm.telephony/resources/mappers/applications.xml new file mode 100644 index 0000000000..7b63129a7b --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/applications.xml @@ -0,0 +1,38 @@ + + + + + + INSERT INTO "restcomm_applications" ("sid", "date_created", "date_updated", "friendly_name", "account_sid", "api_version", + "voice_caller_id_lookup", "uri", "rcml_url", "kind") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{friendly_name}, #{account_sid}, #{api_version}, + #{voice_caller_id_lookup}, #{uri}, #{rcml_url}, #{kind}); + + + + + + + + + + DELETE FROM "restcomm_applications" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_applications" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_applications" SET "friendly_name"=#{friendly_name}, "date_updated"=#{date_updated}, + "voice_caller_id_lookup"=#{voice_caller_id_lookup}, "rcml_url"=#{rcml_url}, "kind"=#{kind} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/available-phone-numbers.xml b/restcomm/restcomm.telephony/resources/mappers/available-phone-numbers.xml new file mode 100644 index 0000000000..f5cb452d90 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/available-phone-numbers.xml @@ -0,0 +1,35 @@ + + + + + + INSERT INTO "restcomm_available_phone_numbers" ("friendly_name", "phone_number", "lata", "rate_center", "latitude", "longitude", "region", "postal_code", "iso_country", "cost") + VALUES (#{friendly_name}, #{phone_number}, #{lata}, #{rate_center}, #{latitude}, #{longitude}, #{region}, #{postal_code}, #{iso_country}, #{cost}); + + + + + + + + + + + + + + DELETE FROM "restcomm_available_phone_numbers" WHERE "phone_number"=#{phone_number}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/call-detail-records.xml b/restcomm/restcomm.telephony/resources/mappers/call-detail-records.xml new file mode 100644 index 0000000000..dd870e94b4 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/call-detail-records.xml @@ -0,0 +1,203 @@ + + + + + + INSERT INTO "restcomm_call_detail_records" ("sid", "instanceid", "parent_call_sid", "date_created", "date_updated", "account_sid", "recipient", "sender", "phone_number_sid", "status", + "start_time", "end_time", "duration", "price", "direction", "answered_by", "api_version", "forwarded_from", "caller_name", "uri", "call_path", "ring_duration", "conference_sid", "muted", "start_conference_on_enter", "end_conference_on_exit", "on_hold", "ms_id") + VALUES (#{sid}, #{instanceid}, #{parent_call_sid}, #{date_created}, + #{date_updated}, #{account_sid}, #{to}, #{from}, #{phone_number_sid}, #{status}, #{start_time}, #{end_time}, #{duration}, #{price}, #{direction}, + #{answered_by}, #{api_version}, #{forwarded_from}, #{caller_name}, #{uri}, #{call_path}, #{ring_duration}, #{conference_sid}, #{muted}, #{start_conference_on_enter}, #{end_conference_on_exit}, #{on_hold}, #{ms_id}); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM "restcomm_call_detail_records" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_call_detail_records" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_call_detail_records" + SET "date_updated"=#{date_updated}, "status"=#{status}, "start_time"=#{start_time}, "end_time"=#{end_time}, "duration"=#{duration}, + "price"=#{price}, "answered_by"=#{answered_by}, "forwarded_from"=#{forwarded_from}, "ring_duration"=#{ring_duration}, "conference_sid"=#{conference_sid}, "muted"=#{muted}, "start_conference_on_enter"=#{start_conference_on_enter}, + "end_conference_on_exit"=#{end_conference_on_exit}, "on_hold"=#{on_hold}, "ms_id"=#{ms_id} + WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/clients.xml b/restcomm/restcomm.telephony/resources/mappers/clients.xml new file mode 100644 index 0000000000..c52b4c780d --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/clients.xml @@ -0,0 +1,39 @@ + + + + + + INSERT INTO "restcomm_clients" ("sid", "date_created", "date_updated", "account_sid", "api_version", "friendly_name", "login", "password", + "status", "voice_url", "voice_method", "voice_fallback_url", "voice_fallback_method", "voice_application_sid", "uri") VALUES (#{sid}, + #{date_created}, #{date_updated}, #{account_sid}, #{api_version}, #{friendly_name}, #{login}, #{password}, #{status}, #{voice_url}, + #{voice_method}, #{voice_fallback_url}, #{voice_fallback_method}, #{voice_application_sid}, #{uri}); + + + + + + + + + + DELETE FROM "restcomm_clients" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_clients" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_clients" SET "friendly_name"=#{friendly_name}, "password"=#{password}, "status"=#{status}, "voice_url"=#{voice_url}, + "voice_method"=#{voice_method}, "voice_fallback_url"=#{voice_fallback_url}, "voice_fallback_method"=#{voice_fallback_method}, + "voice_application_sid"=#{voice_application_sid} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/conference-detail-records.xml b/restcomm/restcomm.telephony/resources/mappers/conference-detail-records.xml new file mode 100644 index 0000000000..38f38348fa --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/conference-detail-records.xml @@ -0,0 +1,110 @@ + + + + + + + call "addConferenceDetailRecord"( #{sid}, #{date_created}, #{date_updated}, #{account_sid}, #{status}, #{friendly_name}, #{api_version}, #{uri}, #{master_ms_id}, #{master_present} ); + + + + + + + + + + + DELETE FROM "restcomm_conference_detail_records" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_conference_detail_records" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_conference_detail_records" SET "date_updated"=#{date_updated}, "status"=#{status} WHERE "sid"=#{sid}; + + + + UPDATE + "restcomm_conference_detail_records" + SET "status"=#{status}, "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + + UPDATE + "restcomm_conference_detail_records" + SET + "master_conference_endpoint_id"=#{master_conference_endpoint_id}, + "master_ivr_endpoint_id"=#{master_ivr_endpoint_id}, + "master_ivr_endpoint_session_id"=#{master_ivr_endpoint_session_id}, + "master_ivr_conn_id"=#{master_ivr_conn_id}, + "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + + UPDATE + "restcomm_conference_detail_records" + SET + "master_bridge_endpoint_id"=#{master_bridge_endpoint_id}, + "master_bridge_endpoint_session_id"=#{master_bridge_endpoint_session_id}, + "master_bridge_conn_id"=#{master_bridge_conn_id}, + "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + + UPDATE + "restcomm_conference_detail_records" + SET "master_present"=#{master_present}, "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + + UPDATE + "restcomm_conference_detail_records" + SET "moderator_present"=#{moderator_present}, "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + diff --git a/restcomm/restcomm.telephony/resources/mappers/extensions-configuration.xml b/restcomm/restcomm.telephony/resources/mappers/extensions-configuration.xml new file mode 100644 index 0000000000..b67080c851 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/extensions-configuration.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + INSERT INTO "restcomm_extensions_configuration" ("sid", "extension", "configuration_data", "configuration_type", + "date_created", "date_updated") VALUES (#{sid}, #{extension}, #{configuration_data}, #{configuration_type}, + #{date_created}, #{date_updated}); + + + + UPDATE "restcomm_extensions_configuration" SET "configuration_data"=#{configuration_data}, "configuration_type"=#{configuration_type}, "date_updated"=#{date_updated} + WHERE "extension"=#{extension} + + + + + + + + + + DELETE FROM "restcomm_extensions_configuration" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_extensions_configuration" WHERE "extension"=#{extension}; + + + + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/gateways.xml b/restcomm/restcomm.telephony/resources/mappers/gateways.xml new file mode 100644 index 0000000000..999c8fed4e --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/gateways.xml @@ -0,0 +1,28 @@ + + + + + + INSERT INTO "restcomm_gateways" ("sid", "date_created", "date_updated", "friendly_name", "password", "proxy", "register", "user_name", "ttl", + "uri") VALUES (#{sid}, #{date_created}, #{date_updated}, #{friendly_name}, #{password}, #{proxy}, #{register}, #{user_name}, #{ttl}, #{uri}); + + + + + + + + DELETE FROM "restcomm_gateways" WHERE "sid"=#{sid}; + + + + UPDATE "restcomm_gateways" SET "date_updated"=#{date_updated}, "friendly_name"=#{friendly_name}, "password"=#{password}, + "proxy"=#{proxy}, "register"=#{register}, "user_name"=#{user_name}, "ttl"=#{ttl} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/http-cookies.xml b/restcomm/restcomm.telephony/resources/mappers/http-cookies.xml new file mode 100644 index 0000000000..0ed6546f96 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/http-cookies.xml @@ -0,0 +1,36 @@ + + + + + + INSERT INTO "restcomm_http_cookies" ("sid", "comment", "domain", "expiration_date", "name", "path", "value", "version") + VALUES (#{sid}, #{comment}, #{domain}, #{expiration_date}, #{name}, #{path}, #{value}, #{version}); + + + + + + + + + + DELETE FROM "restcomm_http_cookies" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_http_cookies" WHERE "sid"=#{sid} AND "expiration_date" <= NOW(); + + + + UPDATE "restcomm_http_cookies" SET "comment"=#{comment}, "expiration_date"=#{expiration_date}, + "value"=#{value} WHERE "sid"=#{sid} AND "name"=#{name}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/incoming-phone-numbers.xml b/restcomm/restcomm.telephony/resources/mappers/incoming-phone-numbers.xml new file mode 100644 index 0000000000..aa6f5ea0af --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/incoming-phone-numbers.xml @@ -0,0 +1,77 @@ + + + + + + INSERT INTO "restcomm_incoming_phone_numbers" ("sid", "date_created", "date_updated", "friendly_name", "account_sid", "phone_number", "cost", "api_version", + "voice_caller_id_lookup", "voice_url", "voice_method", "voice_fallback_url", "voice_fallback_method", "status_callback", "status_callback_method", + "voice_application_sid", "sms_url", "sms_method", "sms_fallback_url", "sms_fallback_method", "sms_application_sid", "uri", "voice_capable", "sms_capable", + "mms_capable", "fax_capable", "pure_sip") VALUES(#{sid}, + #{date_created}, #{date_updated}, #{friendly_name}, #{account_sid}, #{phone_number}, #{cost}, #{api_version}, #{voice_caller_id_lookup}, + #{voice_url}, #{voice_method}, #{voice_fallback_url}, #{voice_fallback_method}, #{status_callback}, #{status_callback_method}, + #{voice_application_sid}, #{sms_url}, #{sms_method}, #{sms_fallback_url}, #{sms_fallback_method}, #{sms_application_sid}, #{uri}, + #{voice_capable}, #{sms_capable}, #{mms_capable}, #{fax_capable}, #{pure_sip}); + + + + + + + + + + + + + + + DELETE FROM "restcomm_incoming_phone_numbers" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_incoming_phone_numbers" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_incoming_phone_numbers" SET "friendly_name"=#{friendly_name}, "voice_caller_id_lookup"=#{voice_caller_id_lookup}, "voice_url"=#{voice_url}, + "voice_method"=#{voice_method}, "voice_fallback_url"=#{voice_fallback_url}, "voice_fallback_method"=#{voice_fallback_method}, "status_callback"=#{status_callback}, + "status_callback_method"=#{status_callback_method}, "voice_application_sid"=#{voice_application_sid}, "sms_url"=#{sms_url}, "sms_method"=#{sms_method}, + "sms_fallback_url"=#{sms_fallback_url}, "sms_fallback_method"=#{sms_fallback_method}, "sms_application_sid"=#{sms_application_sid}, "voice_capable"=#{voice_capable}, + "sms_capable"=#{sms_capable}, "mms_capable"=#{mms_capable}, "fax_capable"=#{fax_capable} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/media-resource-broker-entity.xml b/restcomm/restcomm.telephony/resources/mappers/media-resource-broker-entity.xml new file mode 100644 index 0000000000..7ea6a90668 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/media-resource-broker-entity.xml @@ -0,0 +1,36 @@ + + + + + + + INSERT INTO + "restcomm_media_resource_broker_entity" + ("conference_sid", "slave_ms_id", "slave_ms_bridge_ep_id", "slave_ms_cnf_ep_id", + "is_bridged_together") + VALUES + (#{conference_sid}, #{slave_ms_id}, #{slave_ms_bridge_ep_id}, #{slave_ms_cnf_ep_id}, + #{is_bridged_together}); + + + + + + + DELETE FROM "restcomm_media_resource_broker_entity" WHERE "conference_sid"=#{conferenceSid} AND "slave_ms_id"=#{slaveMsId}; + + + + UPDATE "restcomm_media_resource_broker_entity" + SET "slave_ms_bridge_ep_id"=#{slave_ms_bridge_ep_id}, + "slave_ms_cnf_ep_id"=#{slave_ms_cnf_ep_id}, "is_bridged_together"=#{is_bridged_together} + WHERE "conference_sid"=#{conference_sid} AND "slave_ms_id"=#{slave_ms_id}; + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/media-servers.xml b/restcomm/restcomm.telephony/resources/mappers/media-servers.xml new file mode 100644 index 0000000000..5236ca3d2a --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/media-servers.xml @@ -0,0 +1,36 @@ + + + + + + + INSERT INTO "restcomm_media_servers" ("local_ip", "local_port", "remote_ip", "remote_port", "compatibility", "response_timeout", "external_address") + VALUES (#{local_ip}, #{local_port}, #{remote_ip}, #{remote_port}, #{compatibility}, #{response_timeout}, #{external_address}); + + + + + + + + + + DELETE FROM "restcomm_media_servers" WHERE "ms_id"=#{ms_id}; + + + + UPDATE "restcomm_media_servers" + SET "local_ip"=#{local_ip}, "local_port"=#{local_port}, "remote_ip"=#{remote_ip}, "remote_port"=#{remote_port}, + "compatibility"=#{compatibility}, "response_timeout"=#{response_timeout}, "external_address"=#{external_address} + WHERE "ms_id"=#{ms_id}; + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/notifications.xml b/restcomm/restcomm.telephony/resources/mappers/notifications.xml new file mode 100644 index 0000000000..b4f814a7c6 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/notifications.xml @@ -0,0 +1,45 @@ + + + + + + INSERT INTO "restcomm_notifications" ("sid", "date_created", "date_updated", "account_sid", "call_sid", "api_version", "log", "error_code", "more_info", "message_text", + "message_date", "request_url", "request_method", "request_variables", "response_headers", "response_body", "uri") VALUES (#{sid}, #{date_created}, #{date_updated}, + #{account_sid}, #{call_sid}, #{api_version}, #{log}, #{error_code}, #{more_info}, #{message_text}, #{message_date}, #{request_url}, #{request_method}, + #{request_variables}, #{response_headers}, #{response_body}, #{uri}); + + + + + + + + + + + + + + DELETE FROM "restcomm_notifications" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_notifications" WHERE "account_sid"=#{account_sid}; + + + + DELETE FROM "restcomm_notifications" WHERE "call_sid"=#{call_sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/outgoing-caller-ids.xml b/restcomm/restcomm.telephony/resources/mappers/outgoing-caller-ids.xml new file mode 100644 index 0000000000..bcb692cde8 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/outgoing-caller-ids.xml @@ -0,0 +1,31 @@ + + + + + + INSERT INTO "restcomm_outgoing_caller_ids" ("sid", "date_created", "date_updated", "friendly_name", "account_sid", "phone_number", "uri") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{friendly_name}, #{account_sid}, #{phone_number}, #{uri}); + + + + + + + + DELETE FROM "restcomm_outgoing_caller_ids" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_outgoing_caller_ids" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_outgoing_caller_ids" SET "date_updated"=#{date_updated}, "friendly_name"=#{friendly_name} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/recordings.xml b/restcomm/restcomm.telephony/resources/mappers/recordings.xml new file mode 100644 index 0000000000..eb7ea28130 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/recordings.xml @@ -0,0 +1,31 @@ + + + + + + INSERT INTO "restcomm_recordings" ("sid", "date_created", "date_updated", "account_sid", "call_sid", "duration", "api_version", "uri") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{account_sid}, #{call_sid}, #{duration}, #{api_version}, #{uri}); + + + + + + + + + + DELETE FROM "restcomm_recordings" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_recordings" WHERE "account_sid"=#{account_sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/registrations.xml b/restcomm/restcomm.telephony/resources/mappers/registrations.xml new file mode 100644 index 0000000000..e19e25cf63 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/registrations.xml @@ -0,0 +1,35 @@ + + + + + + INSERT INTO "restcomm_registrations" ("sid", "date_created", "date_updated", "date_expires", "address_of_record", "display_name", + "user_name", "user_agent", "ttl", "location", "webrtc") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{date_expires}, #{address_of_record}, #{display_name}, #{user_name}, #{user_agent}, + #{ttl}, #{location}, #{webrtc}); + + + + + + + + + + DELETE FROM "restcomm_registrations" WHERE "location"=#{location} AND "address_of_record"=#{address_of_record}; + + + + UPDATE "restcomm_registrations" SET "ttl"=#{ttl}, "date_expires"=#{date_expires} WHERE "address_of_record"=#{address_of_record} AND + "display_name"=#{display_name} AND "location"=#{location} AND "user_agent"=#{user_agent}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/sand-boxes.xml b/restcomm/restcomm.telephony/resources/mappers/sand-boxes.xml new file mode 100644 index 0000000000..f0eedc8602 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/sand-boxes.xml @@ -0,0 +1,25 @@ + + + + + + INSERT INTO "restcomm_sand_boxes" ("date_created", "date_updated", "pin", "account_sid", "phone_number", "application_sid", "api_version", "voice_url", "voice_method", + "sms_url", "sms_method", "status_callback", "status_callback_method", "uri") VALUES (#{date_created}, #{date_updated}, #{pin}, #{account_sid}, #{phone_number} + #{application_sid}, #{api_version}, #{voice_url}, #{voice_method}, #{sms_url}, #{sms_method}, #{status_callback}, #{status_callback_method}, #{uri}); + + + + + + DELETE FROM "restcomm_sand_boxes" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_sand_boxes" SET "date_updated"=#{date_updated}, "voice_url"=#{voice_url}, "voice_method"=#{voice_method}, "sms_url"=#{sms_url}, "sms_method"=#{sms_method} + "status_callback"=#{status_callback}, "status_callback_method"=#{status_callback_method} WHERE "account_sid"=#{account_sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/short-codes.xml b/restcomm/restcomm.telephony/resources/mappers/short-codes.xml new file mode 100644 index 0000000000..7a7b6ed892 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/short-codes.xml @@ -0,0 +1,33 @@ + + + + + + INSERT INTO "restcomm_short_codes" ("sid", "date_created", "date_updated", "friendly_name", "account_sid", "short_code", "api_version", "sms_url", "sms_method", + "sms_fallback_url", "sms_fallback_method", "uri") VALUES (#{sid}, #{date_created}, #{date_updated}, #{frienly_name}, #{account_sid}, #{short_code}, + #{api_version}, #{sms_url}, #{sms_method}, #{sms_fallback_url}, #{sms_fallback_method}, #{uri}); + + + + + + + + DELETE FROM "restcomm_short_codes" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_short_codes" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_short_codes" SET "date_updated"=#{date_updated}, "friendly_name"=#{friendly_name}, "api_version"=#{api_version}, "sms_url"=#{sms_url}, + "sms_method"=#{sms_method}, "sms_fallback_url"=#{sms_fallback_url}, "sms_fallback_method"=#{sms_fallback_method} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/sms-messages.xml b/restcomm/restcomm.telephony/resources/mappers/sms-messages.xml new file mode 100644 index 0000000000..1d0d1d6d87 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/sms-messages.xml @@ -0,0 +1,32 @@ + + + + + + INSERT INTO "restcomm_sms_messages" ("sid", "date_created", "date_updated", "date_sent", "account_sid", "sender", "recipient", "body", "status", "direction", "price", + "api_version", "uri") VALUES (#{sid}, #{date_created}, #{date_updated}, #{date_sent}, #{account_sid}, #{sender}, #{recipient}, #{body}, + #{status}, #{direction}, #{price}, #{api_version}, #{uri}); + + + + + + + + DELETE FROM "restcomm_sms_messages" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_sms_messages" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_sms_messages" SET "date_sent"=#{date_sent}, "status"=#{status}, "price"=#{price} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mappers/transcriptions.xml b/restcomm/restcomm.telephony/resources/mappers/transcriptions.xml new file mode 100644 index 0000000000..087a362eb5 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mappers/transcriptions.xml @@ -0,0 +1,35 @@ + + + + + + INSERT INTO "restcomm_transcriptions" ("sid", "date_created", "date_updated", "account_sid", "status", "recording_sid", "duration", "transcription_text", "price", "uri") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{account_sid}, #{status}, #{recording_sid}, #{duration}, #{transcription_text}, #{price}, #{uri}); + + + + + + + + + + DELETE FROM "restcomm_transcriptions" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_transcriptions" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_transcriptions" SET "status"=#{status} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/mybatis.xml b/restcomm/restcomm.telephony/resources/mybatis.xml new file mode 100644 index 0000000000..54c7285325 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/mybatis.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/restcomm-node2.xml b/restcomm/restcomm.telephony/resources/restcomm-node2.xml new file mode 100644 index 0000000000..082883b745 --- /dev/null +++ b/restcomm/restcomm.telephony/resources/restcomm-node2.xml @@ -0,0 +1,414 @@ + + + + + + 2012-04-24 + + + false + + + /restcomm/audio + + + ${restcomm:home}/cache + /restcomm/cache + + + file://${restcomm:home}/recordings + /restcomm/recordings + + + /restcomm/errors + + + + + + true + + + false + + + true + + + 60 + + + true + + true + + + + true + + + + + + 127.0.0.1:5070 + + + + + 127.0.0.1:5090 + + + + true + + + true + + + true + + 20 + + true + + + + false + restcomm + restcomm + restcomm_instance_id + http://127.0.0.1:2080 + + + + + 127.0.0.1:5090 + + + + + + + + RestComm:*:Accounts + RestComm:*:Applications + RestComm:*:Announcements + RestComm:Read:AvailablePhoneNumbers + RestComm:*:Calls + RestComm:*:Clients + RestComm:*:Conferences + RestComm:Create,Delete,Read:Faxes + RestComm:*:IncomingPhoneNumbers + RestComm:Read:Notifications + RestComm:*:OutgoingCallerIds + RestComm:Delete,Read:Recordings + RestComm:Read,Modify:SandBoxes + RestComm:*:ShortCodes + RestComm:Read:SmsMessages + RestComm:Read:Transcriptions + RestComm:*:OutboundProxies + + + RestComm:Read:Accounts + + + + + + + + + + + + + + + + + + https://backoffice.voipinnovations.com/api2.pl + + + + + + + + + + + + + + + + + + + + + + ${restcomm:home}/WEB-INF/conf/mybatis.xml + + ${restcomm:home}/WEB-INF/data/hsql + ${restcomm:home}/WEB-INF/sql + + + + false + restcomm-recordings + + + + false + 180 + true + + + + + rms + +
127.0.0.1
+ 5060 + udp + 5 +
+
+ + + + + 127.0.0.2 + 2728 + 127.0.0.2 + 2428 + 1500 + + 60 + im + + + + + + + + 5000 + + strict + + true + + + + + + + + 127.0.0.1:5090 + + + + + + + + + test + test + 127.0.0.1 + 2776 + TRANSCEIVER + + test + sms + + 0x34 + -1 + -1 + + + 1 + + 60000 + + 10000 + + 30000 + + 15000 + true + true + + 30000 + + + + + + + + + + + + + + + + + + + + http://vaas.acapela-group.com/Services/Synthesizer + + + + + justine8k + marcia8k + rachel8k graham8k + louise8k + eliska8k + mette8krasmus8k + heather8k ryan8k + sanna8k + claire8k bruno8k + sarah8k klaus8k + dimitris8k + chiara8k vittorio8k + jasmijn8k daan8k + kari8k olav8k + ania8k + celia8k + alyona8k + salma8k mehdi8k + laia8k + maria8k antonio8k + elin8k emil8k + ipek8k + + + + + http://api.voicerss.org + + + ca-es + zh-cn + zh-hk + zh-tw + da-dk + nl-nl + en-au + en-ca + en-gb + en-in + en-us + fi-fi + fr-ca + fr-fr + de-de + it-it + ja-jp + ko-kr + nb-no + pl-pl + pt-br + pt-pt + ru-ru + es-mx + es-es + sv-se + + + + + + +
\ No newline at end of file diff --git a/restcomm/restcomm.telephony/resources/restcomm.xml b/restcomm/restcomm.telephony/resources/restcomm.xml new file mode 100644 index 0000000000..9c513d19da --- /dev/null +++ b/restcomm/restcomm.telephony/resources/restcomm.xml @@ -0,0 +1,414 @@ + + + + + + 2012-04-24 + + + false + + + /restcomm/audio + + + ${restcomm:home}/cache + /restcomm/cache + + + file://${restcomm:home}/recordings + /restcomm/recordings + + + /restcomm/errors + + + + + + true + + + false + + + true + + + 60 + + + true + + true + + + + true + + + + + + 127.0.0.1:5070 + + + + + 127.0.0.1:5090 + + + + true + + + true + + + true + + 20 + + true + + + + false + restcomm + restcomm + restcomm_instance_id + http://127.0.0.1:2080 + + + + + 127.0.0.1:5090 + + + + + + + + RestComm:*:Accounts + RestComm:*:Applications + RestComm:*:Announcements + RestComm:Read:AvailablePhoneNumbers + RestComm:*:Calls + RestComm:*:Clients + RestComm:*:Conferences + RestComm:Create,Delete,Read:Faxes + RestComm:*:IncomingPhoneNumbers + RestComm:Read:Notifications + RestComm:*:OutgoingCallerIds + RestComm:Delete,Read:Recordings + RestComm:Read,Modify:SandBoxes + RestComm:*:ShortCodes + RestComm:Read:SmsMessages + RestComm:Read:Transcriptions + RestComm:*:OutboundProxies + + + RestComm:Read:Accounts + + + + + + + + + + + + + + + + + + https://backoffice.voipinnovations.com/api2.pl + + + + + + + + + + + + + + + + + + + + + + ${restcomm:home}/WEB-INF/conf/mybatis.xml + + ${restcomm:home}/WEB-INF/data/hsql + ${restcomm:home}/WEB-INF/sql + + + + false + restcomm-recordings + + + + false + 180 + true + + + + + rms + +
127.0.0.1
+ 5060 + udp + 5 +
+
+ + + + + 127.0.0.1 + 2727 + 127.0.0.1 + 2427 + 1500 + + 60 + im + + + + + + + + 5000 + + strict + + true + + + + + + + + 127.0.0.1:5090 + + + + + + + + + test + test + 127.0.0.1 + 2776 + TRANSCEIVER + + test + sms + + 0x34 + -1 + -1 + + + 1 + + 60000 + + 10000 + + 30000 + + 15000 + true + true + + 30000 + + + + + + + + + + + + + + + + + + + + http://vaas.acapela-group.com/Services/Synthesizer + + + + + justine8k + marcia8k + rachel8k graham8k + louise8k + eliska8k + mette8krasmus8k + heather8k ryan8k + sanna8k + claire8k bruno8k + sarah8k klaus8k + dimitris8k + chiara8k vittorio8k + jasmijn8k daan8k + kari8k olav8k + ania8k + celia8k + alyona8k + salma8k mehdi8k + laia8k + maria8k antonio8k + elin8k emil8k + ipek8k + + + + + http://api.voicerss.org + + + ca-es + zh-cn + zh-hk + zh-tw + da-dk + nl-nl + en-au + en-ca + en-gb + en-in + en-us + fi-fi + fr-ca + fr-fr + de-de + it-it + ja-jp + ko-kr + nb-no + pl-pl + pt-br + pt-pt + ru-ru + es-mx + es-es + sv-se + + + + + + +
\ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Conference.java b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Conference.java index e877f430e0..1fe597f423 100644 --- a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Conference.java +++ b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Conference.java @@ -105,7 +105,9 @@ public final class Conference extends UntypedActor { private ConferenceStateChanged.State waitingState; - public Conference(final String name, final ActorRef msController, final DaoManager storage) { + private final ActorRef conferenceCenter; + + public Conference(final String name, final ActorRef msController, final DaoManager storage, final ActorRef conferenceCenter) { super(); final ActorRef source = self(); @@ -145,6 +147,7 @@ public Conference(final String name, final ActorRef msController, final DaoManag this.storage = storage; + this.conferenceCenter = conferenceCenter; //generate it later at MRB level, by watching if same conference is running on another RC instance. //this.sid = Sid.generate(Sid.Type.CONFERENCE); this.mscontroller = msController; @@ -319,6 +322,10 @@ public void execute(Object message) throws Exception { // Ask the MS Controller to stop // This will stop any current media operations and clean media resources mscontroller.tell(new Stop(), super.source); + + // Tell conferenceCentre that conference is in stopping state. + // https://github.com/RestComm/Restcomm-Connect/issues/2312 + conferenceCenter.tell(new ConferenceStateChanged(name, ConferenceStateChanged.State.STOPPING), self()); } } @@ -396,6 +403,8 @@ private ConferenceInfo createConferenceInfo() throws Exception{ private void onStartConference(StartConference message, ActorRef self, ActorRef sender) throws Exception { if (is(uninitialized)) { this.fsm.transition(message, initializing); + }else{ + logger.warning("Received StartConference from sender : "+sender.path()+" but the state is: "+fsm.state().toString()); } } @@ -404,6 +413,8 @@ private void onStopConference(StopConference message, ActorRef self, ActorRef se this.fsm.transition(message, stopped); } else if (is(waiting) || is(running)) { this.fsm.transition(message, evicting); + }else{ + logger.warning("Received StopConference from sender : "+sender.path()+" but the state is: "+fsm.state().toString()); } } @@ -418,6 +429,9 @@ private void onAddParticipant(AddParticipant message, ActorRef self, ActorRef se if (isRunning()) { final JoinCall joinCall = new JoinCall(message.call(), ConnectionMode.Confrnce, this.sid); this.mscontroller.tell(joinCall, self); + }else{ + logger.error("Received AddParticipant for Call: "+message.call().path()+" but the state is: "+fsm.state().toString()); + sender.tell(new ConferenceStateChanged(name, ConferenceStateChanged.State.STOPPING), self()); } } @@ -431,9 +445,7 @@ private void onRemoveParticipant(RemoveParticipant message, ActorRef self, Actor final Leave leave = new Leave(); call.tell(leave, self); } else { - if (logger.isDebugEnabled()) { - logger.debug("Received RemoveParticipants for Call: "+message.call().path()+" but the state is: "+fsm.state().toString()); - } + logger.warning("Received RemoveParticipants for Call: "+message.call().path()+" but the state is: "+fsm.state().toString()); } } @@ -441,6 +453,9 @@ private void onLeft(Left message, ActorRef self, ActorRef sender) throws Excepti if (is(running) || is(waiting) || is(evicting)) { // Participant successfully left the conference. boolean removed = calls.remove(sender); + if(!removed) + logger.error("Call was not in conference participant list. Call: "+sender.path()); + int participantsNr = calls.size(); if(logger.isInfoEnabled()) { logger.info("################################## Conference " + name + " has " + participantsNr + " participants"); @@ -452,7 +467,7 @@ private void onLeft(Left message, ActorRef self, ActorRef sender) throws Excepti } // Stop the conference when ALL participants have been evicted - if (removed && calls.isEmpty()) { + if (calls.isEmpty()) { fsm.transition(message, stopping); } } @@ -478,7 +493,7 @@ private void onMediaServerControllerStateChanged(MediaServerConferenceController } break; default: - // ignore unknown state + logger.warning("received an unknown state from MediaServerController: "+state); break; } } @@ -513,7 +528,7 @@ private void onPlay(Play message, ActorRef self, ActorRef sender) { this.mscontroller.tell(message, sender); } else { if (logger.isInfoEnabled()) { - logger.info("Play will not be processed for conference: "+this.name+" , number of local participants: "+this.calls.size()+ " globalNoOfParticipants: "+globalNoOfParticipants+" , isRunning: false, isModeratorPresent: "+this.moderatorPresent+ " iterations: "+message.iterations()); + logger.info("Play will not be processed for conference since its not in running state: "+this.name+" , number of local participants: "+this.calls.size()+ " globalNoOfParticipants: "+globalNoOfParticipants+" , isRunning: false, isModeratorPresent: "+this.moderatorPresent+ " iterations: "+message.iterations()); } } } @@ -522,6 +537,8 @@ private void onStartRecording(StartRecording message, ActorRef self, ActorRef se if (isRunning()) { // Forward message to media server controller this.mscontroller.tell(message, sender); + }else{ + logger.warning("Received StartRecording from sender : "+sender.path()+" but the state is: "+fsm.state().toString()); } } @@ -529,6 +546,8 @@ private void onStopRecording(StopRecording message, ActorRef self, ActorRef send if (isRunning()) { // Forward message to media server controller this.mscontroller.tell(message, sender); + }else{ + logger.warning("Received StopRecording from sender : "+sender.path()+" but the state is: "+fsm.state().toString()); } } diff --git a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/ConferenceCenter.java b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/ConferenceCenter.java index ac794b4108..2c88516de7 100644 --- a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/ConferenceCenter.java +++ b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/ConferenceCenter.java @@ -44,6 +44,7 @@ /** * @author quintana.thomas@gmail.com (Thomas Quintana) * @author amit.bhayani@telestax.com (Amit Bhayani) + * @author maria.farooq@telestax.com (Maria Farooq) */ public final class ConferenceCenter extends UntypedActor { @@ -71,7 +72,7 @@ private ActorRef getConference(final String name) { @Override public UntypedActor create() throws Exception { //Here Here we can pass Gateway where call is connected - return new Conference(name, factory.provideConferenceController(), storage); + return new Conference(name, factory.provideConferenceController(), storage, self()); } }); return system.actorOf(props); @@ -129,8 +130,17 @@ private void notify(final Object message, final ActorRef sender) { if(logger.isInfoEnabled()) { logger.info("Conference " + name + " completed without issues"); } - ActorRef conference = conferences.remove(update.name()); - context().stop(conference); + conferences.remove(update.name()); + //stop sender(conference who sent this msg) bcz it was already removed from map in Stopping state + context().stop(sender); + } else if (ConferenceStateChanged.State.STOPPING.equals(update.state())) { + // A conference is in stopping state + // Remove it from conference collection + // https://github.com/RestComm/Restcomm-Connect/issues/2312 + if(logger.isInfoEnabled()) { + logger.info("Conference " + name + " is going to stop, will remove it from available conferences."); + } + conferences.remove(update.name()); } else if (ConferenceStateChanged.State.FAILED.equals(update.state())) { if (conferences.containsKey(name)) { // A conference completed with errors diff --git a/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockFailingMmsConferenceController.java b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockFailingMmsConferenceController.java new file mode 100644 index 0000000000..165dc55810 --- /dev/null +++ b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockFailingMmsConferenceController.java @@ -0,0 +1,125 @@ +/* + * TeleStax, Open Source Cloud Communications + * Copyright 2011-2013, Telestax Inc and individual contributors + * by the @authors tag. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.restcomm.connect.mscontrol.mms; + +import java.util.ArrayList; +import java.util.List; + +import org.mobicents.servlet.restcomm.mscontrol.messages.MediaServerConferenceControllerStateChanged; +import org.restcomm.connect.commons.annotations.concurrency.Immutable; +import org.restcomm.connect.commons.dao.Sid; +import org.restcomm.connect.commons.patterns.Observe; +import org.restcomm.connect.commons.patterns.Observing; +import org.restcomm.connect.commons.patterns.StopObserving; +import org.restcomm.connect.mscontrol.api.MediaServerController; +import org.restcomm.connect.mscontrol.api.messages.CloseMediaSession; +import org.restcomm.connect.mscontrol.api.messages.CreateMediaSession; +import org.restcomm.connect.mscontrol.api.messages.JoinCall; +import org.restcomm.connect.mscontrol.api.messages.JoinComplete; +import org.restcomm.connect.mscontrol.api.messages.JoinConference; +import org.restcomm.connect.mscontrol.api.messages.MediaServerControllerStateChanged.MediaServerControllerState; +import org.restcomm.connect.mscontrol.api.messages.Stop; +import org.restcomm.connect.telephony.api.ConferenceStateChanged; + +import akka.actor.ActorRef; +import akka.event.Logging; +import akka.event.LoggingAdapter; + +/** + * @author Maria Farooq (maria.farooq@telestax.com) + */ +@Immutable +public final class MockFailingMmsConferenceController extends MediaServerController { + + // Logging + private final LoggingAdapter logger = Logging.getLogger(getContext().system(), this); + // Observers + private final List observers; + private Sid conferenceSid; + + public MockFailingMmsConferenceController(final ActorRef mrb) { + super(); + // Observers + this.observers = new ArrayList(2); + } + + private void broadcast(Object message) { + if (!this.observers.isEmpty()) { + final ActorRef self = self(); + synchronized (this.observers) { + for (ActorRef observer : observers) { + observer.tell(message, self); + } + } + } + } + + /* + * EVENTS + */ + @Override + public void onReceive(Object message) throws Exception { + final Class klass = message.getClass(); + final ActorRef sender = sender(); + final ActorRef self = self(); + + if(logger.isInfoEnabled()) { + logger.info(" ********** MockFailingMmsConferenceController Conference Controller Processing Message: " + klass.getName()); + } + + if (Observe.class.equals(klass)) { + onObserve((Observe) message, self, sender); + } else if (StopObserving.class.equals(klass)) { + onStopObserving((StopObserving) message, self, sender); + } else if (CreateMediaSession.class.equals(klass)) { + broadcast(new MediaServerConferenceControllerStateChanged(MediaServerControllerState.ACTIVE, conferenceSid, ""+ConferenceStateChanged.State.RUNNING_MODERATOR_ABSENT, true)); + } else if (Stop.class.equals(klass)) { + //do nothing so conference stay in stopping state + } else if(JoinCall.class.equals(klass)){ + onJoinCall((JoinCall)message, self, sender); + } else{ + logger.error("Unhanldles Request Received."); + } + } + + private void onJoinCall(JoinCall message, ActorRef self, ActorRef sender) { + sender.tell(new JoinComplete(), message.getCall()); + } + + private void onObserve(Observe message, ActorRef self, ActorRef sender) { + final ActorRef observer = message.observer(); + if (observer != null) { + synchronized (this.observers) { + this.observers.add(observer); + observer.tell(new Observing(self), self); + } + } + } + + private void onStopObserving(StopObserving message, ActorRef self, ActorRef sender) { + final ActorRef observer = message.observer(); + if (observer != null) { + this.observers.remove(observer); + } + } + +} diff --git a/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockFailingMmsControllerFactory.java b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockFailingMmsControllerFactory.java new file mode 100644 index 0000000000..61f44207ad --- /dev/null +++ b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockFailingMmsControllerFactory.java @@ -0,0 +1,108 @@ +/* + * TeleStax, Open Source Cloud Communications + * Copyright 2011-2013, Telestax Inc and individual contributors + * by the @authors tag. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.restcomm.connect.mscontrol.mms; + +import org.apache.log4j.Logger; +import org.restcomm.connect.mscontrol.api.MediaServerControllerFactory; + +import akka.actor.Actor; +import akka.actor.ActorRef; +import akka.actor.ActorSystem; +import akka.actor.Props; +import akka.actor.UntypedActorFactory; + +/** + * Provides controllers for Mobicents Media Server. + * + * @author Maria Farooq (maria.farooq@telestax.com) + * + */ +public class MockFailingMmsControllerFactory implements MediaServerControllerFactory { + + private static Logger logger = Logger.getLogger(MockFailingMmsControllerFactory.class); + private final ActorSystem system; + private final CallControllerFactory callControllerFactory; + private final ConferenceControllerFactory conferenceControllerFactory; + private final BridgeControllerFactory bridgeControllerFactory; + private final ActorRef mrb; + + public MockFailingMmsControllerFactory(ActorSystem system, ActorRef mrb) { + super(); + this.system = system; + this.callControllerFactory = new CallControllerFactory(); + this.conferenceControllerFactory = new ConferenceControllerFactory(); + this.bridgeControllerFactory = new BridgeControllerFactory(); + this.mrb = mrb; + } + + @Override + public ActorRef provideCallController() { + final Props props = new Props(this.callControllerFactory); + return system.actorOf(props); + } + + @Override + public ActorRef provideConferenceController() { + final Props props = new Props(this.conferenceControllerFactory); + return system.actorOf(props); + } + + @Override + public ActorRef provideBridgeController() { + final Props props = new Props(this.bridgeControllerFactory); + return system.actorOf(props); + } + + private final class CallControllerFactory implements UntypedActorFactory { + + private static final long serialVersionUID = -4649683839304615853L; + + @Override + public Actor create() throws Exception { + return null; + } + + } + + private final class ConferenceControllerFactory implements UntypedActorFactory { + + private static final long serialVersionUID = -919317656354678281L; + + @Override + public Actor create() throws Exception { + return new MockFailingMmsConferenceController(mrb); + } + + } + + private final class BridgeControllerFactory implements UntypedActorFactory { + + private static final long serialVersionUID = 8999152285760508857L; + + @Override + public Actor create() throws Exception { + return null; + } + + } + +} diff --git a/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockMmsConferenceController.java b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockMmsConferenceController.java new file mode 100644 index 0000000000..9895981ee2 --- /dev/null +++ b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockMmsConferenceController.java @@ -0,0 +1,124 @@ +/* + * TeleStax, Open Source Cloud Communications + * Copyright 2011-2013, Telestax Inc and individual contributors + * by the @authors tag. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.restcomm.connect.mscontrol.mms; + +import java.util.ArrayList; +import java.util.List; + +import org.mobicents.servlet.restcomm.mscontrol.messages.MediaServerConferenceControllerStateChanged; +import org.restcomm.connect.commons.annotations.concurrency.Immutable; +import org.restcomm.connect.commons.dao.Sid; +import org.restcomm.connect.commons.patterns.Observe; +import org.restcomm.connect.commons.patterns.Observing; +import org.restcomm.connect.commons.patterns.StopObserving; +import org.restcomm.connect.mscontrol.api.MediaServerController; +import org.restcomm.connect.mscontrol.api.messages.CloseMediaSession; +import org.restcomm.connect.mscontrol.api.messages.CreateMediaSession; +import org.restcomm.connect.mscontrol.api.messages.JoinCall; +import org.restcomm.connect.mscontrol.api.messages.JoinComplete; +import org.restcomm.connect.mscontrol.api.messages.Stop; +import org.restcomm.connect.mscontrol.api.messages.MediaServerControllerStateChanged.MediaServerControllerState; +import org.restcomm.connect.telephony.api.ConferenceStateChanged; + +import akka.actor.ActorRef; +import akka.event.Logging; +import akka.event.LoggingAdapter; + +/** + * @author Maria Farooq (maria.farooq@telestax.com) + */ +@Immutable +public final class MockMmsConferenceController extends MediaServerController { + + // Logging + private final LoggingAdapter logger = Logging.getLogger(getContext().system(), this); + // Observers + private final List observers; + private Sid conferenceSid; + + public MockMmsConferenceController(final ActorRef mrb) { + super(); + // Observers + this.observers = new ArrayList(2); + } + + private void broadcast(Object message) { + if (!this.observers.isEmpty()) { + final ActorRef self = self(); + synchronized (this.observers) { + for (ActorRef observer : observers) { + observer.tell(message, self); + } + } + } + } + + /* + * EVENTS + */ + @Override + public void onReceive(Object message) throws Exception { + final Class klass = message.getClass(); + final ActorRef sender = sender(); + final ActorRef self = self(); + + if(logger.isInfoEnabled()) { + logger.info(" ********** Conference Controller Processing Message: " + klass.getName()); + } + + if (Observe.class.equals(klass)) { + onObserve((Observe) message, self, sender); + } else if (StopObserving.class.equals(klass)) { + onStopObserving((StopObserving) message, self, sender); + } else if (CreateMediaSession.class.equals(klass)) { + broadcast(new MediaServerConferenceControllerStateChanged(MediaServerControllerState.ACTIVE, conferenceSid, ""+ConferenceStateChanged.State.RUNNING_MODERATOR_ABSENT, true)); + } else if (Stop.class.equals(klass)) { + broadcast(new MediaServerConferenceControllerStateChanged(MediaServerControllerState.INACTIVE, conferenceSid)); + } else if(JoinCall.class.equals(klass)){ + onJoinCall((JoinCall)message, self, sender); + } else{ + logger.error("Unhanldles Request Received."); + } + } + + private void onJoinCall(JoinCall message, ActorRef self, ActorRef sender) { + sender.tell(new JoinComplete(), message.getCall()); + } + + private void onObserve(Observe message, ActorRef self, ActorRef sender) { + final ActorRef observer = message.observer(); + if (observer != null) { + synchronized (this.observers) { + this.observers.add(observer); + observer.tell(new Observing(self), self); + } + } + } + + private void onStopObserving(StopObserving message, ActorRef self, ActorRef sender) { + final ActorRef observer = message.observer(); + if (observer != null) { + this.observers.remove(observer); + } + } + +} diff --git a/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockMmsControllerFactory.java b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockMmsControllerFactory.java new file mode 100644 index 0000000000..9f59bf907a --- /dev/null +++ b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/mscontrol/mms/MockMmsControllerFactory.java @@ -0,0 +1,108 @@ +/* + * TeleStax, Open Source Cloud Communications + * Copyright 2011-2013, Telestax Inc and individual contributors + * by the @authors tag. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.restcomm.connect.mscontrol.mms; + +import org.apache.log4j.Logger; +import org.restcomm.connect.mscontrol.api.MediaServerControllerFactory; + +import akka.actor.Actor; +import akka.actor.ActorRef; +import akka.actor.ActorSystem; +import akka.actor.Props; +import akka.actor.UntypedActorFactory; + +/** + * Provides controllers for Mobicents Media Server. + * + * @author Maria Farooq (maria.farooq@telestax.com) + * + */ +public class MockMmsControllerFactory implements MediaServerControllerFactory { + + private static Logger logger = Logger.getLogger(MockMmsControllerFactory.class); + private final ActorSystem system; + private final CallControllerFactory callControllerFactory; + private final ConferenceControllerFactory conferenceControllerFactory; + private final BridgeControllerFactory bridgeControllerFactory; + private final ActorRef mrb; + + public MockMmsControllerFactory(ActorSystem system, ActorRef mrb) { + super(); + this.system = system; + this.callControllerFactory = new CallControllerFactory(); + this.conferenceControllerFactory = new ConferenceControllerFactory(); + this.bridgeControllerFactory = new BridgeControllerFactory(); + this.mrb = mrb; + } + + @Override + public ActorRef provideCallController() { + final Props props = new Props(this.callControllerFactory); + return system.actorOf(props); + } + + @Override + public ActorRef provideConferenceController() { + final Props props = new Props(this.conferenceControllerFactory); + return system.actorOf(props); + } + + @Override + public ActorRef provideBridgeController() { + final Props props = new Props(this.bridgeControllerFactory); + return system.actorOf(props); + } + + private final class CallControllerFactory implements UntypedActorFactory { + + private static final long serialVersionUID = -4649683839304615853L; + + @Override + public Actor create() throws Exception { + return null; + } + + } + + private final class ConferenceControllerFactory implements UntypedActorFactory { + + private static final long serialVersionUID = -919317656354678281L; + + @Override + public Actor create() throws Exception { + return new MockMmsConferenceController(mrb); + } + + } + + private final class BridgeControllerFactory implements UntypedActorFactory { + + private static final long serialVersionUID = 8999152285760508857L; + + @Override + public Actor create() throws Exception { + return null; + } + + } + +} diff --git a/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/telephony/ConferenceTest.java b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/telephony/ConferenceTest.java new file mode 100644 index 0000000000..e9ca448edd --- /dev/null +++ b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/telephony/ConferenceTest.java @@ -0,0 +1,194 @@ +package org.restcomm.connect.telephony; + +import static org.junit.Assert.assertTrue; + +import java.net.MalformedURLException; +import java.net.UnknownHostException; + +import org.apache.commons.configuration.ConfigurationException; +import org.apache.log4j.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.restcomm.connect.commons.dao.Sid; +import org.restcomm.connect.commons.patterns.Observe; +import org.restcomm.connect.commons.patterns.Observing; +import org.restcomm.connect.dao.DaoManager; +import org.restcomm.connect.mscontrol.api.MediaServerControllerFactory; +import org.restcomm.connect.mscontrol.api.messages.JoinComplete; +import org.restcomm.connect.mscontrol.api.messages.Left; +import org.restcomm.connect.mscontrol.mms.MockFailingMmsControllerFactory; +import org.restcomm.connect.mscontrol.mms.MockMmsControllerFactory; +import org.restcomm.connect.telephony.api.AddParticipant; +import org.restcomm.connect.telephony.api.ConferenceCenterResponse; +import org.restcomm.connect.telephony.api.ConferenceResponse; +import org.restcomm.connect.telephony.api.ConferenceStateChanged; +import org.restcomm.connect.telephony.api.CreateConference; +import org.restcomm.connect.telephony.util.ConferenceTestUtil; + +import akka.actor.ActorRef; +import akka.actor.Props; +import akka.actor.UntypedActor; +import akka.actor.UntypedActorFactory; +import akka.testkit.JavaTestKit; + +public class ConferenceTest extends ConferenceTestUtil{ + private final static Logger logger = Logger.getLogger(ConferenceTest.class.getName()); + + @Before + public void before() throws UnknownHostException, ConfigurationException, MalformedURLException { + configurationNode1 = createCfg(CONFIG_PATH_NODE_1); + + startDaoManager(); + } + + @After + public void after(){ + daoManager.shutdown(); + } + + @Test + public void testJoinStoppingConference() { + new JavaTestKit(system) { + { + final ActorRef tester = getRef(); + // Create MockFailingMmsControllerFactory + MediaServerControllerFactory factory = new MockFailingMmsControllerFactory(system, null); + // Create ConferenceCenter + final ActorRef conferenceCenter = conferenceCenter(factory, daoManager); + + // get a fresh conference from conferenecneter + final CreateConference create = new CreateConference(CONFERENCE_FRIENDLY_NAME_1, new Sid(CALL_SID)); + conferenceCenter.tell(create, tester); + ConferenceCenterResponse conferenceCenterResponse = expectMsgClass(ConferenceCenterResponse.class); + ActorRef conferene = conferenceCenterResponse.get(); + + // start observing conference + conferene.tell(new Observe(tester), tester); + Observing observingResponse = expectMsgClass(Observing.class); + assertTrue(observingResponse.succeeded()); + + // addparticipant in conference + conferene.tell(new AddParticipant(tester), tester); + //receieve sent to observers + expectMsgClass(ConferenceResponse.class); + //receieve sent to call (since we are pretending to call&VoiceInterpreter) + expectMsgClass(ConferenceResponse.class); + expectMsgClass(JoinComplete.class); + + // stop conference + conferene.tell(new Left(), tester); + expectMsgClass(ConferenceResponse.class); + + // get same conference again from conferenecneter + conferenceCenter.tell(create, tester); + conferenceCenterResponse = expectMsgClass(ConferenceCenterResponse.class); + ActorRef conferene2 = conferenceCenterResponse.get(); + + if(!conferene2.path().equals(conferene.path())){ + assertTrue(!conferene2.path().equals(conferene.path())); + // start observing conference + conferene2.tell(new Observe(tester), tester); + observingResponse = expectMsgClass(Observing.class); + assertTrue(observingResponse.succeeded()); + + // addparticipant in conference + conferene2.tell(new AddParticipant(tester), tester); + + expectMsgClass(ConferenceResponse.class); + expectMsgClass(ConferenceResponse.class); + expectMsgClass(JoinComplete.class); + }else{ + logger.info("testing VI impl"); + // start observing conference + conferene2.tell(new Observe(tester), tester); + observingResponse = expectMsgClass(Observing.class); + assertTrue(observingResponse.succeeded()); + + // addparticipant in conference + conferene2.tell(new AddParticipant(tester), tester); + + ConferenceStateChanged csc = expectMsgClass(ConferenceStateChanged.class); + assertTrue(csc.state().equals(ConferenceStateChanged.State.STOPPING)); + + // get same conference again from conferenecneter + conferenceCenter.tell(create, tester); + conferenceCenterResponse = expectMsgClass(ConferenceCenterResponse.class); + conferene2 = conferenceCenterResponse.get(); + + assertTrue(!conferene2.path().equals(conferene.path())); + } + + + }}; + } + + @Test + public void testJoinCompletedConference() { + new JavaTestKit(system) { + { + final ActorRef tester = getRef(); + // Create MockFailingMmsControllerFactory + MediaServerControllerFactory factory = new MockMmsControllerFactory(system, null); + // Create ConferenceCenter + final ActorRef conferenceCenter = conferenceCenter(factory, daoManager); + + // get a fresh conference from conferenecneter + final CreateConference create = new CreateConference(CONFERENCE_FRIENDLY_NAME_1, new Sid(CALL_SID)); + conferenceCenter.tell(create, tester); + ConferenceCenterResponse conferenceCenterResponse = expectMsgClass(ConferenceCenterResponse.class); + ActorRef conferene = conferenceCenterResponse.get(); + + // start observing conference + conferene.tell(new Observe(tester), tester); + Observing observingResponse = expectMsgClass(Observing.class); + assertTrue(observingResponse.succeeded()); + + // addparticipant in conference + conferene.tell(new AddParticipant(tester), tester); + //receieve sent to observers + expectMsgClass(ConferenceResponse.class); + //receieve sent to call (since we are pretending to call&VoiceInterpreter) + expectMsgClass(ConferenceResponse.class); + expectMsgClass(JoinComplete.class); + + // stop conference + conferene.tell(new Left(), tester); + expectMsgClass(ConferenceResponse.class); + expectMsgClass(ConferenceStateChanged.class); + + // get same conference again from conferenecneter + conferenceCenter.tell(create, tester); + conferenceCenterResponse = expectMsgClass(ConferenceCenterResponse.class); + logger.info("conferenceCenterResponse 2: "+conferenceCenterResponse); + ActorRef conferene2 = conferenceCenterResponse.get(); + + assertTrue(!conferene2.path().equals(conferene.path())); + // start observing conference + conferene2.tell(new Observe(tester), tester); + observingResponse = expectMsgClass(Observing.class); + assertTrue(observingResponse.succeeded()); + + // addparticipant in conference + conferene2.tell(new AddParticipant(tester), tester); + + expectMsgClass(ConferenceResponse.class); + expectMsgClass(ConferenceResponse.class); + expectMsgClass(JoinComplete.class); + + }}; + } + + private ActorRef conferenceCenter(final MediaServerControllerFactory factory, final DaoManager daoManager) { + + final Props props = new Props(new UntypedActorFactory() { + private static final long serialVersionUID = 1L; + @Override + public UntypedActor create() throws Exception { + return new ConferenceCenter(factory, daoManager); + } + }); + return system.actorOf(props); + } + +} diff --git a/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/telephony/util/ConferenceTestUtil.java b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/telephony/util/ConferenceTestUtil.java new file mode 100644 index 0000000000..3f280178c0 --- /dev/null +++ b/restcomm/restcomm.telephony/src/main/test/org/restcomm/connect/telephony/util/ConferenceTestUtil.java @@ -0,0 +1,82 @@ +package org.restcomm.connect.telephony.util; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.List; + +import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.configuration.XMLConfiguration; +import org.apache.log4j.Logger; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.restcomm.connect.commons.dao.Sid; +import org.restcomm.connect.dao.ConferenceDetailRecordsDao; +import org.restcomm.connect.dao.entities.ConferenceDetailRecord; +import org.restcomm.connect.dao.mybatis.MybatisDaoManager; +import org.restcomm.connect.telephony.api.ConferenceStateChanged; + +import akka.actor.ActorSystem; + +/** + * @author maria.farooq@telestax.com (Maria Farooq) + */ +public class ConferenceTestUtil { + private final static Logger logger = Logger.getLogger(ConferenceTestUtil.class.getName()); + + protected static ActorSystem system; + + protected static Configuration configurationNode1; + protected static Configuration configurationNode2; + protected XMLConfiguration daoManagerConf = null; + + protected static MybatisDaoManager daoManager; + protected static final String CONFIG_PATH_NODE_1 = "/restcomm.xml"; + protected static final String CONFIG_PATH_NODE_2 = "/restcomm-node2.xml"; + protected static final String CONFIG_PATH_DAO_MANAGER = "/dao-manager.xml"; + + protected static final String CONFERENCE_FRIENDLY_NAME_1 ="ACae6e420f425248d6a26948c17a9e2acf:1111"; + protected static final String CONFERENCE_FRIENDLY_NAME_2 ="ACae6e420f425248d6a26948c17a9e2acf:1122"; + + protected static final String CALL_SID ="CAae6e420f425248d6a26948c17a9e2acf"; + + protected static final String ACCOUNT_SID_1 ="ACae6e420f425248d6a26948c17a9e2acf"; + + @BeforeClass + public static void beforeClass() throws Exception { + system = ActorSystem.create(); + } + + @AfterClass + public static void afterClass() throws Exception { + system.shutdown(); + } + + protected Configuration createCfg(final String cfgFileName) throws ConfigurationException, MalformedURLException { + URL url = this.getClass().getResource(cfgFileName); + return new XMLConfiguration(url); + } + + protected Configuration createDaoManagerCfg(final String cfgFileName) throws ConfigurationException, MalformedURLException { + URL url = this.getClass().getResource(cfgFileName); + return new XMLConfiguration(url); + } + + private void cleanAllConferences() { + ConferenceDetailRecordsDao dao = daoManager.getConferenceDetailRecordsDao(); + List records = (List) dao.getConferenceDetailRecords(new Sid(ACCOUNT_SID_1)); + for(int i=0; i + + + + + ./src/test/resources/mybatis.xml + ./src/test/resources/data/hsql + ./src/test/resources/mappers + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/log4j.xml b/restcomm/restcomm.telephony/src/test/resources/log4j.xml new file mode 100644 index 0000000000..b3677225e2 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/log4j.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/accounts.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/accounts.xml new file mode 100644 index 0000000000..76d26efaf0 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/accounts.xml @@ -0,0 +1,32 @@ + + + + + + INSERT INTO "restcomm_accounts" ("sid", "date_created", "date_updated", "email_address", "friendly_name", "account_sid", "type", "status", "auth_token", "role", "uri") + VALUES(#{sid}, #{date_created}, #{date_updated}, #{email_address}, #{friendly_name}, #{account_sid}, #{type}, #{status}, #{auth_token}, #{role}, #{uri}); + + + + + + + + + + DELETE FROM "restcomm_accounts" WHERE "sid"=#{sid}; + + + + UPDATE "restcomm_accounts" SET "date_updated"=#{date_updated}, "email_address"=#{email_address}, "friendly_name"=#{friendly_name}, + "type"=#{type}, "status"=#{status}, "auth_token"=#{auth_token}, "role"=#{role} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/announcements.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/announcements.xml new file mode 100644 index 0000000000..62a5a7bae9 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/announcements.xml @@ -0,0 +1,23 @@ + + + + + + INSERT INTO "restcomm_announcements" ("sid", "date_created", "account_sid", "gender", "language", "text", "uri") + VALUES(#{sid}, #{date_created}, #{account_sid}, #{gender}, #{language}, #{text}, #{uri}); + + + + + + + + DELETE FROM "restcomm_announcements" WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/applications.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/applications.xml new file mode 100644 index 0000000000..7b63129a7b --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/applications.xml @@ -0,0 +1,38 @@ + + + + + + INSERT INTO "restcomm_applications" ("sid", "date_created", "date_updated", "friendly_name", "account_sid", "api_version", + "voice_caller_id_lookup", "uri", "rcml_url", "kind") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{friendly_name}, #{account_sid}, #{api_version}, + #{voice_caller_id_lookup}, #{uri}, #{rcml_url}, #{kind}); + + + + + + + + + + DELETE FROM "restcomm_applications" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_applications" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_applications" SET "friendly_name"=#{friendly_name}, "date_updated"=#{date_updated}, + "voice_caller_id_lookup"=#{voice_caller_id_lookup}, "rcml_url"=#{rcml_url}, "kind"=#{kind} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/available-phone-numbers.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/available-phone-numbers.xml new file mode 100644 index 0000000000..f5cb452d90 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/available-phone-numbers.xml @@ -0,0 +1,35 @@ + + + + + + INSERT INTO "restcomm_available_phone_numbers" ("friendly_name", "phone_number", "lata", "rate_center", "latitude", "longitude", "region", "postal_code", "iso_country", "cost") + VALUES (#{friendly_name}, #{phone_number}, #{lata}, #{rate_center}, #{latitude}, #{longitude}, #{region}, #{postal_code}, #{iso_country}, #{cost}); + + + + + + + + + + + + + + DELETE FROM "restcomm_available_phone_numbers" WHERE "phone_number"=#{phone_number}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/call-detail-records.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/call-detail-records.xml new file mode 100644 index 0000000000..dd870e94b4 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/call-detail-records.xml @@ -0,0 +1,203 @@ + + + + + + INSERT INTO "restcomm_call_detail_records" ("sid", "instanceid", "parent_call_sid", "date_created", "date_updated", "account_sid", "recipient", "sender", "phone_number_sid", "status", + "start_time", "end_time", "duration", "price", "direction", "answered_by", "api_version", "forwarded_from", "caller_name", "uri", "call_path", "ring_duration", "conference_sid", "muted", "start_conference_on_enter", "end_conference_on_exit", "on_hold", "ms_id") + VALUES (#{sid}, #{instanceid}, #{parent_call_sid}, #{date_created}, + #{date_updated}, #{account_sid}, #{to}, #{from}, #{phone_number_sid}, #{status}, #{start_time}, #{end_time}, #{duration}, #{price}, #{direction}, + #{answered_by}, #{api_version}, #{forwarded_from}, #{caller_name}, #{uri}, #{call_path}, #{ring_duration}, #{conference_sid}, #{muted}, #{start_conference_on_enter}, #{end_conference_on_exit}, #{on_hold}, #{ms_id}); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM "restcomm_call_detail_records" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_call_detail_records" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_call_detail_records" + SET "date_updated"=#{date_updated}, "status"=#{status}, "start_time"=#{start_time}, "end_time"=#{end_time}, "duration"=#{duration}, + "price"=#{price}, "answered_by"=#{answered_by}, "forwarded_from"=#{forwarded_from}, "ring_duration"=#{ring_duration}, "conference_sid"=#{conference_sid}, "muted"=#{muted}, "start_conference_on_enter"=#{start_conference_on_enter}, + "end_conference_on_exit"=#{end_conference_on_exit}, "on_hold"=#{on_hold}, "ms_id"=#{ms_id} + WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/clients.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/clients.xml new file mode 100644 index 0000000000..c52b4c780d --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/clients.xml @@ -0,0 +1,39 @@ + + + + + + INSERT INTO "restcomm_clients" ("sid", "date_created", "date_updated", "account_sid", "api_version", "friendly_name", "login", "password", + "status", "voice_url", "voice_method", "voice_fallback_url", "voice_fallback_method", "voice_application_sid", "uri") VALUES (#{sid}, + #{date_created}, #{date_updated}, #{account_sid}, #{api_version}, #{friendly_name}, #{login}, #{password}, #{status}, #{voice_url}, + #{voice_method}, #{voice_fallback_url}, #{voice_fallback_method}, #{voice_application_sid}, #{uri}); + + + + + + + + + + DELETE FROM "restcomm_clients" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_clients" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_clients" SET "friendly_name"=#{friendly_name}, "password"=#{password}, "status"=#{status}, "voice_url"=#{voice_url}, + "voice_method"=#{voice_method}, "voice_fallback_url"=#{voice_fallback_url}, "voice_fallback_method"=#{voice_fallback_method}, + "voice_application_sid"=#{voice_application_sid} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/conference-detail-records.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/conference-detail-records.xml new file mode 100644 index 0000000000..38f38348fa --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/conference-detail-records.xml @@ -0,0 +1,110 @@ + + + + + + + call "addConferenceDetailRecord"( #{sid}, #{date_created}, #{date_updated}, #{account_sid}, #{status}, #{friendly_name}, #{api_version}, #{uri}, #{master_ms_id}, #{master_present} ); + + + + + + + + + + + DELETE FROM "restcomm_conference_detail_records" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_conference_detail_records" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_conference_detail_records" SET "date_updated"=#{date_updated}, "status"=#{status} WHERE "sid"=#{sid}; + + + + UPDATE + "restcomm_conference_detail_records" + SET "status"=#{status}, "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + + UPDATE + "restcomm_conference_detail_records" + SET + "master_conference_endpoint_id"=#{master_conference_endpoint_id}, + "master_ivr_endpoint_id"=#{master_ivr_endpoint_id}, + "master_ivr_endpoint_session_id"=#{master_ivr_endpoint_session_id}, + "master_ivr_conn_id"=#{master_ivr_conn_id}, + "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + + UPDATE + "restcomm_conference_detail_records" + SET + "master_bridge_endpoint_id"=#{master_bridge_endpoint_id}, + "master_bridge_endpoint_session_id"=#{master_bridge_endpoint_session_id}, + "master_bridge_conn_id"=#{master_bridge_conn_id}, + "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + + UPDATE + "restcomm_conference_detail_records" + SET "master_present"=#{master_present}, "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + + UPDATE + "restcomm_conference_detail_records" + SET "moderator_present"=#{moderator_present}, "date_updated"=#{date_updated} + WHERE "sid"=#{sid}; + + diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/extensions-configuration.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/extensions-configuration.xml new file mode 100644 index 0000000000..b67080c851 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/extensions-configuration.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + INSERT INTO "restcomm_extensions_configuration" ("sid", "extension", "configuration_data", "configuration_type", + "date_created", "date_updated") VALUES (#{sid}, #{extension}, #{configuration_data}, #{configuration_type}, + #{date_created}, #{date_updated}); + + + + UPDATE "restcomm_extensions_configuration" SET "configuration_data"=#{configuration_data}, "configuration_type"=#{configuration_type}, "date_updated"=#{date_updated} + WHERE "extension"=#{extension} + + + + + + + + + + DELETE FROM "restcomm_extensions_configuration" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_extensions_configuration" WHERE "extension"=#{extension}; + + + + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/gateways.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/gateways.xml new file mode 100644 index 0000000000..999c8fed4e --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/gateways.xml @@ -0,0 +1,28 @@ + + + + + + INSERT INTO "restcomm_gateways" ("sid", "date_created", "date_updated", "friendly_name", "password", "proxy", "register", "user_name", "ttl", + "uri") VALUES (#{sid}, #{date_created}, #{date_updated}, #{friendly_name}, #{password}, #{proxy}, #{register}, #{user_name}, #{ttl}, #{uri}); + + + + + + + + DELETE FROM "restcomm_gateways" WHERE "sid"=#{sid}; + + + + UPDATE "restcomm_gateways" SET "date_updated"=#{date_updated}, "friendly_name"=#{friendly_name}, "password"=#{password}, + "proxy"=#{proxy}, "register"=#{register}, "user_name"=#{user_name}, "ttl"=#{ttl} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/http-cookies.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/http-cookies.xml new file mode 100644 index 0000000000..0ed6546f96 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/http-cookies.xml @@ -0,0 +1,36 @@ + + + + + + INSERT INTO "restcomm_http_cookies" ("sid", "comment", "domain", "expiration_date", "name", "path", "value", "version") + VALUES (#{sid}, #{comment}, #{domain}, #{expiration_date}, #{name}, #{path}, #{value}, #{version}); + + + + + + + + + + DELETE FROM "restcomm_http_cookies" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_http_cookies" WHERE "sid"=#{sid} AND "expiration_date" <= NOW(); + + + + UPDATE "restcomm_http_cookies" SET "comment"=#{comment}, "expiration_date"=#{expiration_date}, + "value"=#{value} WHERE "sid"=#{sid} AND "name"=#{name}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/incoming-phone-numbers.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/incoming-phone-numbers.xml new file mode 100644 index 0000000000..aa6f5ea0af --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/incoming-phone-numbers.xml @@ -0,0 +1,77 @@ + + + + + + INSERT INTO "restcomm_incoming_phone_numbers" ("sid", "date_created", "date_updated", "friendly_name", "account_sid", "phone_number", "cost", "api_version", + "voice_caller_id_lookup", "voice_url", "voice_method", "voice_fallback_url", "voice_fallback_method", "status_callback", "status_callback_method", + "voice_application_sid", "sms_url", "sms_method", "sms_fallback_url", "sms_fallback_method", "sms_application_sid", "uri", "voice_capable", "sms_capable", + "mms_capable", "fax_capable", "pure_sip") VALUES(#{sid}, + #{date_created}, #{date_updated}, #{friendly_name}, #{account_sid}, #{phone_number}, #{cost}, #{api_version}, #{voice_caller_id_lookup}, + #{voice_url}, #{voice_method}, #{voice_fallback_url}, #{voice_fallback_method}, #{status_callback}, #{status_callback_method}, + #{voice_application_sid}, #{sms_url}, #{sms_method}, #{sms_fallback_url}, #{sms_fallback_method}, #{sms_application_sid}, #{uri}, + #{voice_capable}, #{sms_capable}, #{mms_capable}, #{fax_capable}, #{pure_sip}); + + + + + + + + + + + + + + + DELETE FROM "restcomm_incoming_phone_numbers" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_incoming_phone_numbers" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_incoming_phone_numbers" SET "friendly_name"=#{friendly_name}, "voice_caller_id_lookup"=#{voice_caller_id_lookup}, "voice_url"=#{voice_url}, + "voice_method"=#{voice_method}, "voice_fallback_url"=#{voice_fallback_url}, "voice_fallback_method"=#{voice_fallback_method}, "status_callback"=#{status_callback}, + "status_callback_method"=#{status_callback_method}, "voice_application_sid"=#{voice_application_sid}, "sms_url"=#{sms_url}, "sms_method"=#{sms_method}, + "sms_fallback_url"=#{sms_fallback_url}, "sms_fallback_method"=#{sms_fallback_method}, "sms_application_sid"=#{sms_application_sid}, "voice_capable"=#{voice_capable}, + "sms_capable"=#{sms_capable}, "mms_capable"=#{mms_capable}, "fax_capable"=#{fax_capable} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/media-resource-broker-entity.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/media-resource-broker-entity.xml new file mode 100644 index 0000000000..7ea6a90668 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/media-resource-broker-entity.xml @@ -0,0 +1,36 @@ + + + + + + + INSERT INTO + "restcomm_media_resource_broker_entity" + ("conference_sid", "slave_ms_id", "slave_ms_bridge_ep_id", "slave_ms_cnf_ep_id", + "is_bridged_together") + VALUES + (#{conference_sid}, #{slave_ms_id}, #{slave_ms_bridge_ep_id}, #{slave_ms_cnf_ep_id}, + #{is_bridged_together}); + + + + + + + DELETE FROM "restcomm_media_resource_broker_entity" WHERE "conference_sid"=#{conferenceSid} AND "slave_ms_id"=#{slaveMsId}; + + + + UPDATE "restcomm_media_resource_broker_entity" + SET "slave_ms_bridge_ep_id"=#{slave_ms_bridge_ep_id}, + "slave_ms_cnf_ep_id"=#{slave_ms_cnf_ep_id}, "is_bridged_together"=#{is_bridged_together} + WHERE "conference_sid"=#{conference_sid} AND "slave_ms_id"=#{slave_ms_id}; + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/media-servers.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/media-servers.xml new file mode 100644 index 0000000000..5236ca3d2a --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/media-servers.xml @@ -0,0 +1,36 @@ + + + + + + + INSERT INTO "restcomm_media_servers" ("local_ip", "local_port", "remote_ip", "remote_port", "compatibility", "response_timeout", "external_address") + VALUES (#{local_ip}, #{local_port}, #{remote_ip}, #{remote_port}, #{compatibility}, #{response_timeout}, #{external_address}); + + + + + + + + + + DELETE FROM "restcomm_media_servers" WHERE "ms_id"=#{ms_id}; + + + + UPDATE "restcomm_media_servers" + SET "local_ip"=#{local_ip}, "local_port"=#{local_port}, "remote_ip"=#{remote_ip}, "remote_port"=#{remote_port}, + "compatibility"=#{compatibility}, "response_timeout"=#{response_timeout}, "external_address"=#{external_address} + WHERE "ms_id"=#{ms_id}; + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/notifications.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/notifications.xml new file mode 100644 index 0000000000..b4f814a7c6 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/notifications.xml @@ -0,0 +1,45 @@ + + + + + + INSERT INTO "restcomm_notifications" ("sid", "date_created", "date_updated", "account_sid", "call_sid", "api_version", "log", "error_code", "more_info", "message_text", + "message_date", "request_url", "request_method", "request_variables", "response_headers", "response_body", "uri") VALUES (#{sid}, #{date_created}, #{date_updated}, + #{account_sid}, #{call_sid}, #{api_version}, #{log}, #{error_code}, #{more_info}, #{message_text}, #{message_date}, #{request_url}, #{request_method}, + #{request_variables}, #{response_headers}, #{response_body}, #{uri}); + + + + + + + + + + + + + + DELETE FROM "restcomm_notifications" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_notifications" WHERE "account_sid"=#{account_sid}; + + + + DELETE FROM "restcomm_notifications" WHERE "call_sid"=#{call_sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/outgoing-caller-ids.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/outgoing-caller-ids.xml new file mode 100644 index 0000000000..bcb692cde8 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/outgoing-caller-ids.xml @@ -0,0 +1,31 @@ + + + + + + INSERT INTO "restcomm_outgoing_caller_ids" ("sid", "date_created", "date_updated", "friendly_name", "account_sid", "phone_number", "uri") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{friendly_name}, #{account_sid}, #{phone_number}, #{uri}); + + + + + + + + DELETE FROM "restcomm_outgoing_caller_ids" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_outgoing_caller_ids" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_outgoing_caller_ids" SET "date_updated"=#{date_updated}, "friendly_name"=#{friendly_name} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/recordings.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/recordings.xml new file mode 100644 index 0000000000..eb7ea28130 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/recordings.xml @@ -0,0 +1,31 @@ + + + + + + INSERT INTO "restcomm_recordings" ("sid", "date_created", "date_updated", "account_sid", "call_sid", "duration", "api_version", "uri") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{account_sid}, #{call_sid}, #{duration}, #{api_version}, #{uri}); + + + + + + + + + + DELETE FROM "restcomm_recordings" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_recordings" WHERE "account_sid"=#{account_sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/registrations.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/registrations.xml new file mode 100644 index 0000000000..e19e25cf63 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/registrations.xml @@ -0,0 +1,35 @@ + + + + + + INSERT INTO "restcomm_registrations" ("sid", "date_created", "date_updated", "date_expires", "address_of_record", "display_name", + "user_name", "user_agent", "ttl", "location", "webrtc") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{date_expires}, #{address_of_record}, #{display_name}, #{user_name}, #{user_agent}, + #{ttl}, #{location}, #{webrtc}); + + + + + + + + + + DELETE FROM "restcomm_registrations" WHERE "location"=#{location} AND "address_of_record"=#{address_of_record}; + + + + UPDATE "restcomm_registrations" SET "ttl"=#{ttl}, "date_expires"=#{date_expires} WHERE "address_of_record"=#{address_of_record} AND + "display_name"=#{display_name} AND "location"=#{location} AND "user_agent"=#{user_agent}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/sand-boxes.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/sand-boxes.xml new file mode 100644 index 0000000000..f0eedc8602 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/sand-boxes.xml @@ -0,0 +1,25 @@ + + + + + + INSERT INTO "restcomm_sand_boxes" ("date_created", "date_updated", "pin", "account_sid", "phone_number", "application_sid", "api_version", "voice_url", "voice_method", + "sms_url", "sms_method", "status_callback", "status_callback_method", "uri") VALUES (#{date_created}, #{date_updated}, #{pin}, #{account_sid}, #{phone_number} + #{application_sid}, #{api_version}, #{voice_url}, #{voice_method}, #{sms_url}, #{sms_method}, #{status_callback}, #{status_callback_method}, #{uri}); + + + + + + DELETE FROM "restcomm_sand_boxes" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_sand_boxes" SET "date_updated"=#{date_updated}, "voice_url"=#{voice_url}, "voice_method"=#{voice_method}, "sms_url"=#{sms_url}, "sms_method"=#{sms_method} + "status_callback"=#{status_callback}, "status_callback_method"=#{status_callback_method} WHERE "account_sid"=#{account_sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/short-codes.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/short-codes.xml new file mode 100644 index 0000000000..7a7b6ed892 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/short-codes.xml @@ -0,0 +1,33 @@ + + + + + + INSERT INTO "restcomm_short_codes" ("sid", "date_created", "date_updated", "friendly_name", "account_sid", "short_code", "api_version", "sms_url", "sms_method", + "sms_fallback_url", "sms_fallback_method", "uri") VALUES (#{sid}, #{date_created}, #{date_updated}, #{frienly_name}, #{account_sid}, #{short_code}, + #{api_version}, #{sms_url}, #{sms_method}, #{sms_fallback_url}, #{sms_fallback_method}, #{uri}); + + + + + + + + DELETE FROM "restcomm_short_codes" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_short_codes" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_short_codes" SET "date_updated"=#{date_updated}, "friendly_name"=#{friendly_name}, "api_version"=#{api_version}, "sms_url"=#{sms_url}, + "sms_method"=#{sms_method}, "sms_fallback_url"=#{sms_fallback_url}, "sms_fallback_method"=#{sms_fallback_method} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/sms-messages.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/sms-messages.xml new file mode 100644 index 0000000000..1d0d1d6d87 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/sms-messages.xml @@ -0,0 +1,32 @@ + + + + + + INSERT INTO "restcomm_sms_messages" ("sid", "date_created", "date_updated", "date_sent", "account_sid", "sender", "recipient", "body", "status", "direction", "price", + "api_version", "uri") VALUES (#{sid}, #{date_created}, #{date_updated}, #{date_sent}, #{account_sid}, #{sender}, #{recipient}, #{body}, + #{status}, #{direction}, #{price}, #{api_version}, #{uri}); + + + + + + + + DELETE FROM "restcomm_sms_messages" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_sms_messages" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_sms_messages" SET "date_sent"=#{date_sent}, "status"=#{status}, "price"=#{price} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mappers/transcriptions.xml b/restcomm/restcomm.telephony/src/test/resources/mappers/transcriptions.xml new file mode 100644 index 0000000000..087a362eb5 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mappers/transcriptions.xml @@ -0,0 +1,35 @@ + + + + + + INSERT INTO "restcomm_transcriptions" ("sid", "date_created", "date_updated", "account_sid", "status", "recording_sid", "duration", "transcription_text", "price", "uri") + VALUES (#{sid}, #{date_created}, #{date_updated}, #{account_sid}, #{status}, #{recording_sid}, #{duration}, #{transcription_text}, #{price}, #{uri}); + + + + + + + + + + DELETE FROM "restcomm_transcriptions" WHERE "sid"=#{sid}; + + + + DELETE FROM "restcomm_transcriptions" WHERE "account_sid"=#{account_sid}; + + + + UPDATE "restcomm_transcriptions" SET "status"=#{status} WHERE "sid"=#{sid}; + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/mybatis.xml b/restcomm/restcomm.telephony/src/test/resources/mybatis.xml new file mode 100644 index 0000000000..54c7285325 --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/mybatis.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/restcomm/restcomm.telephony/src/test/resources/restcomm.xml b/restcomm/restcomm.telephony/src/test/resources/restcomm.xml new file mode 100644 index 0000000000..9c513d19da --- /dev/null +++ b/restcomm/restcomm.telephony/src/test/resources/restcomm.xml @@ -0,0 +1,414 @@ + + + + + + 2012-04-24 + + + false + + + /restcomm/audio + + + ${restcomm:home}/cache + /restcomm/cache + + + file://${restcomm:home}/recordings + /restcomm/recordings + + + /restcomm/errors + + + + + + true + + + false + + + true + + + 60 + + + true + + true + + + + true + + + + + + 127.0.0.1:5070 + + + + + 127.0.0.1:5090 + + + + true + + + true + + + true + + 20 + + true + + + + false + restcomm + restcomm + restcomm_instance_id + http://127.0.0.1:2080 + + + + + 127.0.0.1:5090 + + + + + + + + RestComm:*:Accounts + RestComm:*:Applications + RestComm:*:Announcements + RestComm:Read:AvailablePhoneNumbers + RestComm:*:Calls + RestComm:*:Clients + RestComm:*:Conferences + RestComm:Create,Delete,Read:Faxes + RestComm:*:IncomingPhoneNumbers + RestComm:Read:Notifications + RestComm:*:OutgoingCallerIds + RestComm:Delete,Read:Recordings + RestComm:Read,Modify:SandBoxes + RestComm:*:ShortCodes + RestComm:Read:SmsMessages + RestComm:Read:Transcriptions + RestComm:*:OutboundProxies + + + RestComm:Read:Accounts + + + + + + + + + + + + + + + + + + https://backoffice.voipinnovations.com/api2.pl + + + + + + + + + + + + + + + + + + + + + + ${restcomm:home}/WEB-INF/conf/mybatis.xml + + ${restcomm:home}/WEB-INF/data/hsql + ${restcomm:home}/WEB-INF/sql + + + + false + restcomm-recordings + + + + false + 180 + true + + + + + rms + +
127.0.0.1
+ 5060 + udp + 5 +
+
+ + + + + 127.0.0.1 + 2727 + 127.0.0.1 + 2427 + 1500 + + 60 + im + + + + + + + + 5000 + + strict + + true + + + + + + + + 127.0.0.1:5090 + + + + + + + + + test + test + 127.0.0.1 + 2776 + TRANSCEIVER + + test + sms + + 0x34 + -1 + -1 + + + 1 + + 60000 + + 10000 + + 30000 + + 15000 + true + true + + 30000 + + + + + + + + + + + + + + + + + + + + http://vaas.acapela-group.com/Services/Synthesizer + + + + + justine8k + marcia8k + rachel8k graham8k + louise8k + eliska8k + mette8krasmus8k + heather8k ryan8k + sanna8k + claire8k bruno8k + sarah8k klaus8k + dimitris8k + chiara8k vittorio8k + jasmijn8k daan8k + kari8k olav8k + ania8k + celia8k + alyona8k + salma8k mehdi8k + laia8k + maria8k antonio8k + elin8k emil8k + ipek8k + + + + + http://api.voicerss.org + + + ca-es + zh-cn + zh-hk + zh-tw + da-dk + nl-nl + en-au + en-ca + en-gb + en-in + en-us + fi-fi + fr-ca + fr-fr + de-de + it-it + ja-jp + ko-kr + nb-no + pl-pl + pt-br + pt-pt + ru-ru + es-mx + es-es + sv-se + + + + + + +
\ No newline at end of file