This code places the first caller into a waiting room, where the caller will hear music. It’s similar to placing a caller on hold, waiting for an agent or operator to help them.
The second XML response lets an operator join the person in the room. The conference starts when the operator enters the room, and the hold music stops. Since enterSound="", the caller won’t hear any sound when the agent answers. When the moderator hangs up, the conference ends, since the endConferenceOnExit is set to true.
fromplivoimportplivoxmlresponse=plivoxml.ResponseElement()response.add(plivoxml.ConferenceElement('Waiting Room',wait_sound='https://<yourdomain>.com/waitmusic/',enter_sound=''))print(response.to_string())# Now, the XML for the operator
operator_response=plivoxml.ResponseElement()operator_response.add(plivoxml.ConferenceElement('Waiting Room',enter_sound='',end_conference_on_exit=True))print(operator_response.to_string())
varplivo=require('plivo');varresponse=plivo.Response();varparams={'waitSound':"https://<yourdomain>.com/waitMusic/"};varconference_name="Waiting Room";response.addConference(conference_name,params);console.log(response.toXML());/*
Sample Output
<Response>
<Conference waitSound="https://<yourdomain>.com/waitMusic/">Waiting Room</Conference>
</Response>
*//* Code to generate XML to be returned from url at waitSound */varplivo=require('plivo');varresponse=plivo.Response();varparams={'enterSound':"",'endConferenceOnExit':"true"};varconference_name="Waiting Room";response.addConference(conference_name,params);console.log(response.toXML());/*
Sample Output
<Response>
<Conference enterSound="" endConferenceOnExit="true">Waiting Room</Conference>
</Response>
*/
// Example for conference - waiting roompackagecom.plivo.api.xml.samples.conference;importcom.plivo.api.exceptions.PlivoXmlException;importcom.plivo.api.xml.Conference;importcom.plivo.api.xml.Response;classWaitingRoom{publicstaticvoidmain(String[]args)throwsPlivoXmlException{Responseresponse=newResponse().children(newConference("Waiting Room").endConferenceOnExit(true).enterSound("").waitSound("https://<yourdomain>.com/waitmusic/"));System.out.println(response.toXmlString());}}
// Example for conference - waiting roompackagemainimport"github.com/plivo/plivo-go/v7/xml"funcmain(){response:=xml.ResponseElement{Contents:[]interface{}{new(xml.ConferenceElement).SetEndConferenceOnExit(true).SetEnterSound("").SetWaitSound("https://<yourdomain>.com/waitmusic/").SetContents("Waiting Room"),},}print(response.String())}
require'rubygems'require'plivo'includePlivoresponse=Response.new()params={'waitSound'=>"https://www.foo.com/waitmusic/",'enterSound'=>""}conference_name="Waiting Room"response.addConference(conference_name,params)putsresponse.to_xml()=begin
Sample Output
<Response>
<Conference enterSound='' waitSound='https://www.foo.com/wait\music/'>Waiting Room</Conference>
</Response>
=end=begin
Code to generate XML to be returned from url at waitSound
=endresponse=Response.new()params={'endConferenceOnExit'=>"true",'enterSound'=>""}conference_name="Waiting Room"response.addConference(conference_name,params)putsresponse.to_xml()=begin
Sample Output
<Response>
<Conference endConferenceOnExit='true' enterSound=''>Waiting Room</Conference>
</Response>
=end
varplivo=require('plivo');varresponse=plivo.Response();varparams={'waitSound':"https://www.foo.com/waitMusic/"};varconference_name="Waiting Room";response.addConference(conference_name,params);console.log(response.toXML());/*
Sample Output
<Response>
<Conference waitSound="https://www.foo.com/waitMusic/">Waiting Room</Conference>
</Response>
*//* Code to generate XML to be returned from url at waitSound */varplivo=require('plivo');varresponse=plivo.Response();varparams={'enterSound':"",'endConferenceOnExit':"true"};varconference_name="Waiting Room";response.addConference(conference_name,params);console.log(response.toXML());/*
Sample Output
<Response>
<Conference enterSound="" endConferenceOnExit="true">Waiting Room</Conference>
</Response>
*/
// Example for conference - waiting roompackagemainimport"github.com/plivo/plivo-go/v7/xml"funcmain(){response:=xml.ResponseElement{Contents:[]interface{}{new(xml.ConferenceElement).SetEndConferenceOnExit(true).SetEnterSound("").SetWaitSound("https://<yourdomain>.com/waitmusic/").SetContents("Waiting Room"),},}print(response.String())}
Rate this page
🥳 Thank you! It means a lot to us!
×
Help Us Improve
Thank you so much for rating the page, we would like to get your input
for further improvements!