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.

from plivo import plivoxml

response = 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())
Response
<Response>
	<Conference waitSound="https://<yourdomain>.com/waitmusic/" enterSound="">Waiting Room</Conference>
</Response>

XML for the operator:

Response
<Response>
	<Conference enterSound="" endConferenceOnExit="true">Waiting Room</Conference>
</Response>