Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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<Sid, ActorRef>();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<ActorRef>();
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -69,6 +70,10 @@ public static State translateState(String stateName, State defaultState) {
converetedState=State.FAILED;
break;

case "STOPPING":
converetedState=State.STOPPING;
break;

default:
break;
}
Expand Down
24 changes: 24 additions & 0 deletions restcomm/restcomm.telephony/resources/dao-manager.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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. -->

<restcomm>
<dao-manager class="org.restcomm.connect.dao.mybatis.MybatisDaoManager">
<configuration-file>./src/test/resources/mybatis.xml</configuration-file>
<data-files>./src/test/resources/data/hsql</data-files>
<sql-files>./src/test/resources/mappers</sql-files>
</dao-manager>
<!-- <dao-manager class="org.restcomm.connect.dao.mybatis.MybatisDaoManager">
<configuration-file>${restcomm:home}/WEB-INF/conf/mybatis.xml</configuration-file>
<data-files></data-files>
<sql-files>${restcomm:home}/WEB-INF/scripts/mariadb/sql</sql-files>
</dao-manager> -->
</restcomm>
21 changes: 21 additions & 0 deletions restcomm/restcomm.telephony/resources/data/hsql/restcomm.log
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#HSQL Database Engine 2.3.2
#Tue Apr 04 12:28:07 EEST 2017
version=2.3.2
modified=yes
Loading