I'm looking for a way to generate a Conference resource within the Twilio system before adding anyone to that conference.
The official recommended way to start a Conference is by returning TwilXML in response to a Twilio callback. This can either be done in response to someone calling a Twilio number or, in a somewhat indirect way, by making a call and returning TwilXML which will connect the person to a conference once they pick up. All of the APIs to modify conferences use the ConferenceSID
as the handle to decide what conference to change. The problem with both of these methods is that they do not give you the ConferenceSID
until you receive a callback.
Unfortunately callbacks do not contain any identifying information about who generated them. They do have a ConferenceSID
(identifying the conference), and a CallSID
(uniquely identifying the call connecting the caller to the conference). When you get your first callback, there appears to be no way to be able to match either of those identifiers. If you start multiple conferences and get two callbacks with different ConferenceSIDs
and different CallSIDs
, it is inconvenient to tell which conference is generating which callback.
That's why it would be easiest to create a conference resource and then use the versatile add participant call. This would simplify the entire backend flow for using conferences by starting with the ConferenceSID
and going from there.
P.s. To head off other suggestions - there are ways around this. You can specify different callback URLs for different conferences. You can specify different friendlyName
s for different participants which you can match in your backend. It's totally possible to work with, but I would like something cleaner, which would require making conferences before anyone is called.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…