1

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 friendlyNames 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.

Daniel Drexler
  • 527
  • 4
  • 14

1 Answers1

1

Twilio developer evangelist here.

There is no way to create a conference resource from the API. You can only do so by directing a caller there with the <Dial><Conference> TwiML.


Further, I don't quite understand when you say "When you get your first callback, there appears to be no way to be able to match either of those identifiers." What are you trying to match? You could use the CallSid to look up the From number of the caller joining the conference. You also receive the FriendlyName in the callback, which is the name you set in the TwiML <Conference>Friendly Name</Conference> which you could choose to help determine which conference is which.

Does that help at all?

philnash
  • 70,667
  • 10
  • 60
  • 88
  • Hey Phil, Thank you for confirming my impressions. Of course, once you get a callback you can use additional API calls to identify exactly who is calling. It would just be convenient if the callbacks had the basic information (like phone numbers of the callers) that other twilio requests do. I mentioned the `friendlyName` in my post and, indeed, that's what I'll use. If you can give Twilio feedback please pass on the interest in creating conference resources before using them to make calls. – Daniel Drexler Jan 14 '21 at 07:35
  • 1
    One other option would be to store your callers' numbers and call SIDs on the initial webhook request, then you could look them up in your own system when you get the conference callback event with the Call SID. – philnash Jan 14 '21 at 23:06
  • I agree with Phil on the second option. We are doing exactly the same and it has been working pretty well. – Bilal Mehrban Jan 15 '21 at 10:09