Plivo provides an ability to create and manage audio conferences. With Plivo Conferences you can connect more than 2 participants who can interact with each other. Plivo conferences offer a wide array of features and cater to a variety of features. You can explore all the features that conferences provide in Conference API and Conference XML documentation.
In this example we will implement a basic conference using Conference XML. Let us assume you want to host a conference of 5 people. All the 5 participants will be given a phone number to call to and when they call that number they will be put into the conference so that they can interact.
In order to implement the above conference, you should have:
In case you need more information on setting up a server refer to our tutorial on setting up dev environment.
Following are the steps in the call flow for implementing the above conference.
When the incoming call is received on the phone number, the
answer_url in the attached application will be invoked. In order to add this user to a Conference, the following XML should be returned.
1 2 3 <Response> <Conference>conferencename</Conference> </Response>
The above XML, creates a new conference with the conference name specified and adds the first caller to the conference. When subsequent callers call the same number, the same XML will be retrieved from the answer_url and those callers will also be added to the conference.
The code snippet for returning the above XML is shown below in a Flask server setup would be as follows:
1 2 3 4 5 6 7 8 9 from flask import Flask, Response, request app = Flask(__name__) @app.route('/conference/', methods=['GET', 'POST']) def join_conference(): resp = '<Response><Conference>conferencename</Conference></Response>' return Response(resp, mimetype='text/xml')
Now that we have implemented a simple conference, you can check our documentation on Conference API and Conference XML to refine and add more features to this conference. Some example features include playing hold music, moderating a conference, silencing a conference member, recording a conference etc.,