right  Talk To Us!

connect to conference Action

Connects an existing inbound or outbound (primary) call to a conference as a conference participant via an outbound (secondary) call. It allows you to tailor how the participant influences the conference and how it interacts with other participants in the conference.

language wrappers and examples

Note that web apps that use the connect to conference action require Extra Channels to be set to one or more in the service configuration.

The connect to conference properties are:

PropertyRequired/OptionalDefaultDescription
namerequiredThe name of the conference to call.
hold mediaoptional-A play action. Media to play repeatedly to the primary call until the secondary call is connected. null signifies playing ringing to the call.
seconds answer timeoutoptional30An integer. The time to wait for the secondary call to be answered.
conference participantoptional-A conference participant object that determines how the participant interacts with the conference.
secondary calloptional-A secondary call object that specifies pages and properties that are related to the lifetime of the secondary call.
next pageoptional-A web page request object that defines the web page to be requested once the connect to conference action has finished. If null or no page is specified or the conference fails to connect, then the subsequent action in the action array will be executed.

Returns

The result of a successful connect to conference action will be returned via the subsequent http request to the next page in action result as follows:

PropertyAvailabilityDescription
seconds connected durationalwaysA floating point value to one decimal place. The duration for which the call was connected to the conference.

Remarks

The connect to conference action makes a single outbound (secondary) call to a specified conference. If it is answered it is typically immediately connected to the primary call.

Setting the secondary call first page allows the application to interact with the conference before it is connected. See the connect action for more details.



  • Examples:

    • Call up conference BobsChatRoom using the default settings:

          "connect_to_conference" :
          {
              "name" : "BobsChatRoom"
          }
      
    • Call up conference BobsChatRoom and connect to it for a maximum of 45 minutes. Record both sides of the audio and specify some features of the conference participant. Request conferenceNextPage after leaving the conference:

          "connect_to_conference" :
          {
              "name" : "BobsChatRoom",
              "hold_media" : {"play" : { "play_list" : [ { "file_to_play" : "cool_jazz.wav" } ] } },
              "seconds_answer_timeout" : 40,
              "secondary_call" :
              {
                  "call_recording" : true,
                  "minutes_max_call_duration" : 45
              },
              "conference_participant" :
              {
                  "talker" : true,
                  "start_on_entry" : true,
                  "destroy_on_exit" : true,
                  "beep_on_entry" : true,
                  "mute_digit" : "#",
                  "unmute_digit" : "*",
                  "exit_digit" : "9",
                  "while_stopped_media" : { "play" : { "play_list" : [ { "file_to_play" : "cool_jazz.wav" } ] } },
                  "name" : { "play" : { "play_list" : [ { "text_to_say" : "Bob" } ] } },
                  "has_joined_message" : { "play" : { "play_list" : [ { "text_to_say" : "has joined the conference." } ] } },
                  "has_left_message" : { "play" : { "play_list" : [ { "text_to_say" : "has left the conference." } ] } }
              },
              "next_page" : 
              {
                  "url" : "conferenceNextPage"
              }
          }
      

      Once the connect to conference action has finished the duration for which the call was connected to the conference is specified in the request to the next page:

      "action_result" :
      {
          "action" : "connect_to_conference",
          "result" :
          {
              "seconds_connected_duration" : "131.1"
          }
      }
      
    • Call up conference BobsChatRoom, requesting conferenceFirstPage when the call to the conference is answered. Connect to the conference once all conferenceFirstPage's actions have run. Carry on with the next action once the connect to conference has finished:

          "connect_to_conference" :
          {
              "name" : "BobsChatRoom",
              "hold_media" : {"play" : { "play_list" : [ { "file_to_play" : "cool_jazz.wav" } ] } },
              "secondary_call" :
              {
                  "call_recording" : true,
                  "first_page" : "conferenceFirstPage",
                  "final_page" : "conferenceFinalPage",
                  "error_page" : "conferenceErrorPage"
              }
          }
      
  • ConnectToConference Class
    Namespace: Aculab.Cloud.RestAPIWrapper
    Assembly: Aculab.Cloud.RestAPIWrapper.dll

    An action to connect an existing inbound or outbound (primary) call to a conference as a conference participant via an outbound (secondary) call.

    • public class ConnectToConference : TelephonyAction
      {
          // Constructors
          public ConnectToConference(string name);
      
          // Members
          public Play HoldMedia;
          public int SecondsAnswerTimeout;
          public ConferenceParticipant Participant;
          public SecondaryCall SecondaryCall;
          public WebPageRequest NextPage;
      }
      

      Examples:

      • Call up conference BobsChatRoom using the default settings:

        List<TelephonyAction> actions = new List<TelephonyAction>();
        
        var connectToConferenceAction = new ConnectToConference("BobsChatRoom");
        
      • Call up conference BobsChatRoom and connect to it for a maximum of 45 minutes. Record both sides of the audio and specify some features of the conference participant. Request conferenceNextPage after leaving the conference:

        List<TelephonyAction> actions = new List<TelephonyAction>();
        
        var connectToConferenceAction = new ConnectToConference("BobsChatRoom");
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav");
        connectToConferenceAction.SecondsAnswerTimeout = 40;
        connectToConferenceAction.SecondaryCall = new SecondaryCall(null, 45, true);
        connectToConferenceAction.NextPage = new WebPageRequest("ConferenceNextPage.aspx");
        
        var participant = new ConferenceParticipant();
        participant.Talker = true;
        participant.StartOnEntry = true;
        participant.DestroyOnExit = true;
        participant.BeepOnEntry = true;
        participant.MuteDigit = '#';
        participant.UnmuteDigit = '*';
        participant.ExitDigit = '9';
        participant.WhileStoppedMedia = Play.PlayFile("cool_jazz.wav");
        participant.Name = Play.SayText("Bob");
        participant.HasJoinedMessage = Play.SayText("has joined the conference.");
        participant.HasLeftMessage = Play.SayText("has left the conference.");
        connectToConferenceAction.Participant = participant;
        
        actions.Add(connectToConferenceAction);
        

        Once the connect to conference action has finished the duration for which the call was connected to the conference is specified in the request to the next page:

        // Unpack the request
        var telephonyRequest = new TelephonyRequest(Request);
        
        var connectToConferenceResult = (ConnectToConferenceResult)telephonyRequest.InstanceInfo.ActionResult;
        double connectedDuration = connectToConferenceResult.SecondsConnectedDuration;
        
      • Call up conference BobsChatRoom, requesting conferenceFirstPage when the call to the conference is answered. Connect to the conference once all conferenceFirstPage's actions have run. Carry on with the next action once the connect to conference has finished:

        List<TelephonyAction> actions = new List<TelephonyAction>();
        
        var connectToConferenceAction = new ConnectToConference("BobsChatRoom");
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav");
        var secondaryCall = new SecondaryCall(new WebPageRequest("ConferenceFirstPage.aspx"));
        secondaryCall.FinalPage = new WebPageRequest("ConferenceFinalPage.aspx");
        secondaryCall.ErrorPage = new WebPageRequest("ConferenceErrorPage.aspx");
        connectToConferenceAction.SecondaryCall = secondaryCall;
        
        actions.Add(connectToConferenceAction);
        
    • public class ConnectToConference : TelephonyAction
      {
          // Constructors
          public ConnectToConference(string name);
      
          // Members
          public Play HoldMedia;
          public int SecondsAnswerTimeout;
          public ConferenceParticipant Participant;
          public SecondaryCall SecondaryCall;
          public WebPageRequest NextPage;
      }
      

      Examples:

      • Call up conference BobsChatRoom using the default settings:

        List<TelephonyAction> actions = new List<TelephonyAction>();
        
        var connectToConferenceAction = new ConnectToConference("BobsChatRoom");
        
      • Call up conference BobsChatRoom and connect to it for a maximum of 45 minutes. Record both sides of the audio and specify some features of the conference participant. Request conferenceNextPage after leaving the conference:

        List<TelephonyAction> actions = new List<TelephonyAction>();
        
        var connectToConferenceAction = new ConnectToConference("BobsChatRoom");
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav");
        connectToConferenceAction.SecondsAnswerTimeout = 40;
        connectToConferenceAction.SecondaryCall = new SecondaryCall(null, 45, true);
        connectToConferenceAction.NextPage = new WebPageRequest("ConferenceNextPage.aspx");
        
        var participant = new ConferenceParticipant();
        participant.Talker = true;
        participant.StartOnEntry = true;
        participant.DestroyOnExit = true;
        participant.BeepOnEntry = true;
        participant.MuteDigit = '#';
        participant.UnmuteDigit = '*';
        participant.ExitDigit = '9';
        participant.WhileStoppedMedia = Play.PlayFile("cool_jazz.wav");
        participant.Name = Play.SayText("Bob");
        participant.HasJoinedMessage = Play.SayText("has joined the conference.");
        participant.HasLeftMessage = Play.SayText("has left the conference.");
        connectToConferenceAction.Participant = participant;
        
        actions.Add(connectToConferenceAction);
        

        Once the connect to conference action has finished the duration for which the call was connected to the conference is specified in the request to the next page:

        // Unpack the request
        var telephonyRequest = new TelephonyRequest(Request);
        
        var connectToConferenceResult = (ConnectToConferenceResult)telephonyRequest.InstanceInfo.ActionResult;
        double connectedDuration = connectToConferenceResult.SecondsConnectedDuration;
        
      • Call up conference BobsChatRoom, requesting conferenceFirstPage when the call to the conference is answered. Connect to the conference once all conferenceFirstPage's actions have run. Carry on with the next action once the connect to conference has finished:

        List<TelephonyAction> actions = new List<TelephonyAction>();
        
        var connectToConferenceAction = new ConnectToConference("BobsChatRoom");
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav");
        var secondaryCall = new SecondaryCall(new WebPageRequest("ConferenceFirstPage.aspx"));
        secondaryCall.FinalPage = new WebPageRequest("ConferenceFinalPage.aspx");
        secondaryCall.ErrorPage = new WebPageRequest("ConferenceErrorPage.aspx");
        connectToConferenceAction.SecondaryCall = secondaryCall;
        
        actions.Add(connectToConferenceAction);
        
    • public class ConnectToConference : TelephonyAction
      {
          // Constructors
          public ConnectToConference(string name);
      
          // Members
          public Play HoldMedia;
          public int SecondsAnswerTimeout;
          public ConferenceParticipant Participant;
          public SecondaryCall SecondaryCall;
          public WebPageRequest NextPage;
      }
      

      Examples:

      • Call up conference BobsChatRoom using the default settings:

        List<TelephonyAction> actions = new List<TelephonyAction>();
        
        var connectToConferenceAction = new ConnectToConference("BobsChatRoom");
        
      • Call up conference BobsChatRoom and connect to it for a maximum of 45 minutes. Record both sides of the audio and specify some features of the conference participant. Request conferenceNextPage after leaving the conference:

        List<TelephonyAction> actions = new List<TelephonyAction>();
        
        var connectToConferenceAction = new ConnectToConference("BobsChatRoom");
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav");
        connectToConferenceAction.SecondsAnswerTimeout = 40;
        connectToConferenceAction.SecondaryCall = new SecondaryCall(null, 45, true);
        connectToConferenceAction.NextPage = new WebPageRequest("ConferenceNextPage.aspx");
        
        var participant = new ConferenceParticipant();
        participant.Talker = true;
        participant.StartOnEntry = true;
        participant.DestroyOnExit = true;
        participant.BeepOnEntry = true;
        participant.MuteDigit = '#';
        participant.UnmuteDigit = '*';
        participant.ExitDigit = '9';
        participant.WhileStoppedMedia = Play.PlayFile("cool_jazz.wav");
        participant.Name = Play.SayText("Bob");
        participant.HasJoinedMessage = Play.SayText("has joined the conference.");
        participant.HasLeftMessage = Play.SayText("has left the conference.");
        connectToConferenceAction.Participant = participant;
        
        actions.Add(connectToConferenceAction);
        

        Once the connect to conference action has finished the duration for which the call was connected to the conference is specified in the request to the next page:

        // Unpack the request
        var telephonyRequest = await TelephonyRequest.UnpackRequestAsync(Request);
        
        var connectToConferenceResult = (ConnectToConferenceResult)telephonyRequest.InstanceInfo.ActionResult;
        double connectedDuration = connectToConferenceResult.SecondsConnectedDuration;
        
      • Call up conference BobsChatRoom, requesting conferenceFirstPage when the call to the conference is answered. Connect to the conference once all conferenceFirstPage's actions have run. Carry on with the next action once the connect to conference has finished:

        List<TelephonyAction> actions = new List<TelephonyAction>();
        
        var connectToConferenceAction = new ConnectToConference("BobsChatRoom");
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav");
        var secondaryCall = new SecondaryCall(new WebPageRequest("ConferenceFirstPage.aspx"));
        secondaryCall.FinalPage = new WebPageRequest("ConferenceFinalPage.aspx");
        secondaryCall.ErrorPage = new WebPageRequest("ConferenceErrorPage.aspx");
        connectToConferenceAction.SecondaryCall = secondaryCall;
        
        actions.Add(connectToConferenceAction);
        
  • ConnectToConference Class
    Namespace: Aculab.Cloud.RestAPIWrapper
    Assembly: Aculab.Cloud.RestAPIWrapper.dll

    An action to connect an existing inbound or outbound (primary) call to a conference as a conference participant via an outbound (secondary) call.

    • Public Class ConnectToConference
          Inherits TelephonyAction
      
          ' Constructors
          Public Sub New (name As String)
      
          ' Members
          Public Property HoldMedia As Play
          Public Property SecondsAnswerTimeout As Integer
          Public Property Participant As Conferenceparticipant
          Public Property SecondaryCall As Secondarycall
          Public Property NextPage As Webpagerequest
      End Class
      

      Examples:

      • Call up conference BobsChatRoom using the default settings:

        Dim actions = New List(Of TelephonyAction)
        
        Dim connectToConferenceAction = New ConnectToConference("BobsChatRoom")
        
      • Call up conference BobsChatRoom and connect to it for a maximum of 45 minutes. Record both sides of the audio and specify some features of the conference participant. Request conferenceNextPage after leaving the conference:

        Dim actions = New List(Of TelephonyAction)
        
        Dim connectToConferenceAction = New ConnectToConference("BobsChatRoom")
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav")
        connectToConferenceAction.SecondsAnswerTimeout = 40
        connectToConferenceAction.SecondaryCall = New SecondaryCall(Nothing, 45, True)
        connectToConferenceAction.NextPage = New WebPageRequest("ConferenceNextPage.aspx")
        
        Dim participant = New ConferenceParticipant()
        participant.Talker = True
        participant.StartOnEntry = True
        participant.DestroyOnExit = True
        participant.BeepOnEntry = True
        participant.UnmuteDigit = "*"
        participant.ExitDigit = "9"
        participant.WhileStoppedMedia = Play.PlayFile("cool_jazz.wav")
        participant.Name = Play.SayText("Bob")
        participant.HasJoinedMessage = Play.SayText("has joined the conference.")
        participant.HasLeftMessage = Play.SayText("has left the conference.")
        connectToConferenceAction.Participant = participant
        
        actions.Add(connectToConferenceAction)
        

        Once the connect to conference action has finished the duration for which the call was connected to the conference Is specified in the request to the next page.

        ' Unpack the request
        Dim telephonyRequest = New TelephonyRequest(Request)
        
        Dim connectToConferenceResult As ConnectToConferenceResult = telephonyRequest.InstanceInfo.ActionResult
        Dim connectedDuration = connectToConferenceResult.SecondsConnectedDuration
        
      • Call up conference BobsChatRoom, requesting conferenceFirstPage when the call to the conference is answered. Connect to the conference once all conferenceFirstPage's actions have run. Carry on with the next action once the connect to conference has finished:

        Dim actions = New List(Of TelephonyAction)
        
        Dim connectToConferenceAction = New ConnectToConference("BobsChatRoom")
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav")
        Dim secondaryCall = New SecondaryCall(New WebPageRequest("ConferenceFirstPage.aspx"))
        secondaryCall.FinalPage = New WebPageRequest("ConferenceFinalPage.aspx")
        secondaryCall.ErrorPage = New WebPageRequest("ConferenceErrorPage.aspx")
        connectToConferenceAction.SecondaryCall = secondaryCall
        
        actions.Add(connectToConferenceAction)
        
    • Public Class ConnectToConference
          Inherits TelephonyAction
      
          ' Constructors
          Public Sub New (name As String)
      
          ' Members
          Public Property HoldMedia As Play
          Public Property SecondsAnswerTimeout As Integer
          Public Property Participant As Conferenceparticipant
          Public Property SecondaryCall As Secondarycall
          Public Property NextPage As Webpagerequest
      End Class
      

      Examples:

      • Call up conference BobsChatRoom using the default settings:

        Dim actions = New List(Of TelephonyAction)
        
        Dim connectToConferenceAction = New ConnectToConference("BobsChatRoom")
        
      • Call up conference BobsChatRoom and connect to it for a maximum of 45 minutes. Record both sides of the audio and specify some features of the conference participant. Request conferenceNextPage after leaving the conference:

        Dim actions = New List(Of TelephonyAction)
        
        Dim connectToConferenceAction = New ConnectToConference("BobsChatRoom")
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav")
        connectToConferenceAction.SecondsAnswerTimeout = 40
        connectToConferenceAction.SecondaryCall = New SecondaryCall(Nothing, 45, True)
        connectToConferenceAction.NextPage = New WebPageRequest("ConferenceNextPage.aspx")
        
        Dim participant = New ConferenceParticipant()
        participant.Talker = True
        participant.StartOnEntry = True
        participant.DestroyOnExit = True
        participant.BeepOnEntry = True
        participant.UnmuteDigit = "*"
        participant.ExitDigit = "9"
        participant.WhileStoppedMedia = Play.PlayFile("cool_jazz.wav")
        participant.Name = Play.SayText("Bob")
        participant.HasJoinedMessage = Play.SayText("has joined the conference.")
        participant.HasLeftMessage = Play.SayText("has left the conference.")
        connectToConferenceAction.Participant = participant
        
        actions.Add(connectToConferenceAction)
        

        Once the connect to conference action has finished the duration for which the call was connected to the conference Is specified in the request to the next page.

        ' Unpack the request
        Dim telephonyRequest = New TelephonyRequest(Request)
        
        Dim connectToConferenceResult As ConnectToConferenceResult = telephonyRequest.InstanceInfo.ActionResult
        Dim connectedDuration = connectToConferenceResult.SecondsConnectedDuration
        
      • Call up conference BobsChatRoom, requesting conferenceFirstPage when the call to the conference is answered. Connect to the conference once all conferenceFirstPage's actions have run. Carry on with the next action once the connect to conference has finished:

        Dim actions = New List(Of TelephonyAction)
        
        Dim connectToConferenceAction = New ConnectToConference("BobsChatRoom")
        connectToConferenceAction.HoldMedia = Play.PlayFile("cool_jazz.wav")
        Dim secondaryCall = New SecondaryCall(New WebPageRequest("ConferenceFirstPage.aspx"))
        secondaryCall.FinalPage = New WebPageRequest("ConferenceFinalPage.aspx")
        secondaryCall.ErrorPage = New WebPageRequest("ConferenceErrorPage.aspx")
        connectToConferenceAction.SecondaryCall = secondaryCall
        
        actions.Add(connectToConferenceAction)
        
  • class ConnectToConference extends TelephonyAction

    Represents a connect to conference action.

    Class synopsis:

    // Constructors:
    public ConnectToConference(String name)
    
    // Members:
    public void setHoldMedia(Play holdMedia)
    public void setSecondsAnswerTimeout(int secondsTimeout)
    public void setParticipant(ConferenceParticipant conferenceParticipant)
    public void setSecondaryCall(SecondaryCall secondaryCall)
    public void setNextPage(WebPageRequest nextPage)
    
    class ConnectToConferenceResult extends ActionResult

    Represents the result of a connect to conference action.

    Class synopsis:

    // Members:
    public double getSecondsConnectedDuration()
    

    Examples:

    • Call up conference BobsChatRoom using the default settings:

      List<TelephonyAction> actions = new ArrayList<TelephonyAction>();
      
      ConnectToConference connectToConferenceAction = new ConnectToConference("BobsChatRoom");
      actions.add(connectToConferenceAction);
      
    • Call up conference BobsChatRoom and connect to it for a maximum of 45 minutes. Record both sides of the audio and specify some features of the conference participant. Request conferenceNextPage after leaving the conference:

      List<TelephonyAction> actions = new ArrayList<TelephonyAction>();
      
      ConferenceParticipant participant = new ConferenceParticipant();
      participant.setTalker(true);
      participant.setStartOnEntry(true);
      participant.setDestroyOnExit(true);
      participant.setBeepOnEntry(true);
      participant.setMuteDigit('#');
      participant.setUnmuteDigit('*');
      participant.setExitDigit('9');
      participant.setWhileStoppedMedia(Play.playFile("cool_jazz.wav"));
      participant.setName(Play.sayText("Bob"));
      participant.setHasJoinedMessage(Play.sayText("has joined the conference."));
      participant.setHasLeftMessage(Play.sayText("has left the conference."));
      
      ConnectToConference connectToConferenceAction = new ConnectToConference("BobsChatRoom");
      connectToConferenceAction.setHoldMedia(Play.playFile("cool_jazz.wav"));
      connectToConferenceAction.setSecondsAnswerTimeout(40);
      connectToConferenceAction.setSecondaryCall(new SecondaryCall(null, 45, true));
      connectToConferenceAction.setParticipant(participant);
      connectToConferenceAction.setNextPage(new WebPageRequest("conferenceNextPage"));
      
      actions.add(connectToConferenceAction);
      

      Obtain the duration for which the call was connected to the conference from the action's next page request:

      ConnectToConferenceResult connectToConferenceResult = (ConnectToConferenceResult)ourRequest.getInstanceInfo().getActionResult();
      double connectedDuration = connectToConferenceResult.getSecondsConnectedDuration();
      
    • Call up conference BobsChatRoom, requesting conferenceFirstPage when the call to the conference is answered. Connect to the conference once all conferenceFirstPage's actions have run. Carry on with the next action once the connect to conference has finished:

      List<TelephonyAction> actions = new ArrayList<TelephonyAction>();
      
      SecondaryCall secondaryCall = new SecondaryCall(new WebPageRequest("conferenceFirstPage"));
      secondaryCall.setFinalPage(new WebPageRequest("conferenceFinalPage"));
      secondaryCall.setErrorPage(new WebPageRequest("conferenceErrorPage"));
      secondaryCall.setCallRecording(true);
      
      ConnectToConference connectToConferenceAction = new ConnectToConference("BobsChatRoom");
      connectToConferenceAction.setHoldMedia(Play.playFile("cool_jazz.wav"));
      connectToConferenceAction.setSecondaryCall(secondaryCall);
      
      actions.add(connectToConferenceAction);
      
  • class ConnectToConference

    Represents a connect to conference action.

    Class synopsis:

    # ConnectToConference object:
    ConnectToConference(name)
    
    # Instance methods:
    ConnectToConference.set_hold_media(play_action)
    ConnectToConference.set_seconds_answer_timeout(seconds_answer_timeout)
    ConnectToConference.set_conference_participant(participant)
    ConnectToConference.set_secondary_call(secondary_call)
    ConnectToConference.set_next_page(next_page)
    
    Connect To Conference Result

    The Connect To Conference Result is represented by a dictionary. It is found within the action result for the next page.

    Obtaining the Connect To Conference Result dictionary:

    my_request = TelephonyRequest(request)
    action_result = my_request.get_action_result()
    if action_result.get("action") == "connect_to_conference":
        connect_to_conf_result =  action_result.get("result")
    

    Examples:

    • Call up conference BobsChatRoom using the default settings:

      # Create a list of actions that will be passed to the TelephonyResponse constructor
      list_of_actions = []
      
      my_conference = ConnectToConference('BobsChatRoom')
      list_of_actions.append(my_conference)
      
    • Call up conference BobsChatRoom and connect to it for a maximum of 45 minutes. Record both sides of the audio and specify some features of the conference participant. Request conferenceNextPage after leaving the conference:

      # Create a list of actions that will be passed to the TelephonyResponse constructor
      list_of_actions = []
      
      my_conference = ConnectToConference('BobsChatRoom')
      my_conference.set_hold_media(Play(file_to_play='cool_jazz.wav'))
      my_conference.set_seconds_answer_timeout(seconds_answer_timeout=40)
      my_conference.set_secondary_call(SecondaryCall(minutes_max_call_duration=45, 
                                                     call_recording=True))
      my_conference.set_conference_participant(ConferenceParticipant(talker=True, 
                                                          start_on_entry=True, 
                                                          destroy_on_exit=True,
                                                          beep_on_entry=True, 
                                                          mute_digit='#', 
                                                          unmute_digit='*', 
                                                          exit_digit='9',
                                                          while_stopped_media=Play(file_to_play='cool_jazz.wav'),
                                                          name=Play(text_to_say='Bob'), 
                                                          has_joined_message=Play(text_to_say='has joined the conference.'), 
                                                          has_left_message=Play(text_to_say='has left the conference.')))
      my_conference.set_next_page(WebPage(url='conferenceNextPage'))
      list_of_actions.append(my_conference)
      

      Obtain the duration for which the call was connected to the conference from the action's next page request:

      my_request = TelephonyRequest(request)
      action_result = my_request.get_action_result()
      
      if action_result.get("action") == "connect_to_conference":
      
          connect_to_conf_result =  action_result.get("result")
          duration = connect_to_conf_result.get("seconds_connected_duration")
      
          # Your code here...
      
    • Call up conference BobsChatRoom, requesting conferenceFirstPage when the call to the conference is answered. Connect to the conference once all conferenceFirstPage's actions have run. Carry on with the next action once the connect to conference has finished:

      # Create a list of actions that will be passed to the TelephonyResponse constructor
      list_of_actions = []
      
      my_conference = ConnectToConference('BobsChatRoom')
      my_conference.set_hold_media(Play(file_to_play='cool_jazz.wav'))
      my_conference.set_seconds_answer_timeout(seconds_answer_timeout=30)
      my_conference.set_secondary_call(SecondaryCall(first_page=WebPage(url='conferenceFirstPage'),
                                                     final_page=WebPage(url='conferenceFinalPage'),
                                                     error_page=WebPage(url='conferenceErrorPage'),
                                                     minutes_max_call_duration=240, 
                                                     call_recording=True))
      list_of_actions.append(my_conference)
      
  • The ConnectToConference class

    Introduction

    Represents a connect to conference action.

    Class synopsis

    class ConnectToConference extends ConnectBase {
    
        /* methods */
        public __construct(string $name, ConferenceParticipantConfiguration $configuration = null)
        public self setParticipantConfiguration(ConferenceParticipantConfiguration $configuration = null)
    
        /* inherited methods */
        public self setHoldMedia(Play $play = null)
        public self setSecondsAnswerTimeout(int $secs)
        public self setSecondaryCallConfiguration(SecondaryCallConfiguration $secondary_call_configuration)
        public self setNextPage(string|WebPageRequest $next_page, string $method = null)
    }
    
    The ConnectToConferenceResult class

    Introduction

    Represents the result of a connect to conference action.

    Class synopsis

    class ConnectToConferenceResult extends ActionResult {
    
        /* methods */
        public float getSecondsConnectedDuration()
    
        /* inherited methods */
        public string getAction()
        public boolean getInterrupted()
    }
    

    Examples:

    • Call up conference BobsChatRoom using the default settings:

      $ctc = new Aculab\TelephonyRestAPI\ConnectToConference("BobsChatRoom");
      $response->addAction($ctc);
      
    • Call up conference BobsChatRoom and connect to it for a maximum of 45 minutes. Record both sides of the audio and specify some features of the conference participant. Request conferenceNextPage after leaving the conference:

      $participant_config = new Aculab\TelephonyRestAPI\ConferenceParticipantConfiguration();
      $participant_config->setTalker(true)
          ->setStartOnEntry(true)
          ->setDestroyOnExit(true)
          ->setBeepOnEntry(true)
          ->setMuteDigit('#')
          ->setUnmuteDigit('*')
          ->setExitDigit('9')
          ->setWhileStoppedMedia(Aculab\TelephonyRestAPI\Play::playFile('cool_jazz.wav'))
          ->setName(Aculab\TelephonyRestAPI\Play::sayText('Bob'))
          ->setHasJoinedMessage(Aculab\TelephonyRestAPI\Play::sayText('has joined the conference'))
          ->setHasLeftMessage(Aculab\TelephonyRestAPI\Play::sayText('has left the conference'));
      
      $ctc = new Aculab\TelephonyRestAPI\ConnectToConference("BobsChatRoom", $participant_config);
      $ctc->setHoldMedia(Aculab\TelephonyRestAPI\Play::playFile('cool_jazz.wav'))
          ->setSecondsAnswerTimeout(40)
          ->setNextPage('conferenceNextPage');
      
      $call_config = new Aculab\TelephonyRestAPI\SecondaryCallConfiguration();
      $call_config->setMinutesMaxCallDuration(45)
          ->setCallRecording(true);
      
      $ctc->setSecondaryCallConfiguration($call_config);
      
      $response->addAction($ctc);
      

      Obtain the duration for which the call was connected to the conference from the action's next page request:

      $info = InstanceInfo::getInstanceInfo();
      $connectToConferenceResult = $info->getActionResult();
      $durationConnected = $connectToConferenceResult->getSecondsConnectedDuration();
      
    • Call up conference BobsChatRoom, requesting conferenceFirstPage when the call to the conference is answered. Connect to the conference once all conferenceFirstPage's actions have run. Carry on with the next action once the connect to conference has finished:

      $ctc = new Aculab\TelephonyRestAPI\ConnectToConference("BobsChatRoom");
      $ctc->setHoldMedia(Aculab\TelephonyRestAPI\Play::playFile('cool_jazz.wav'));
      
      $call_config = new Aculab\TelephonyRestAPI\SecondaryCallConfiguration();
      $call_config->setCallRecording(true)
          ->setFirstPage('conferenceFirstPage')
          ->setErrorPage('conferenceErrorPage')
          ->setFinalPage('conferenceFinalPage');
      $ctc->setSecondaryCallConfiguration($call_config);
      
      $response->addAction($ctc);