How to associate an inbound Twilio call sid with custom ID?

你说的曾经没有我的故事 提交于 2019-12-14 02:22:50

问题


How to associate an inbound call sid with custom ID? Currently Twilio posts or gets its parameters to the configured voice URL, but one can't send custom parameters to twilio to callback with it's parameters. Example scanario: Caller calls in to authenticated to be connected to a different number at /twiml.php, Twilio posts at /voice_url.php at call initiation. How to then associated the current running authenticated caller with a callsid, assuming their caller id might be unknown?

  • The strategy I've tried already was querying twilio for all running calls then matching the caller ID with the previously stored callerId from the twilio statuscall to the voice_url, but If i have multiple calls going with more than one 'unknown' caller ID, that wont work.

回答1:


When initiating the call, you can setup the callback url with custom parameter.

From what you explained, i understand that /voice_url.php is your callback url. you can specify the call backurl while initiating the call as /voice_url.php?id=xxxxxxx

This will make the twilio to send the id also to your callback url, where you can fetch the id using get request parameter.

I hope this helps.



来源:https://stackoverflow.com/questions/18946893/how-to-associate-an-inbound-twilio-call-sid-with-custom-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!