如何将入站 Twilio 呼叫 sid 与自定义 ID 关联? [英] How to associate an inbound Twilio call sid with custom ID?

查看:60
本文介绍了如何将入站 Twilio 呼叫 sid 与自定义 ID 关联?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将呼入号码与自定义 ID 关联?目前 Twilio 将其参数发布或获取到配置的语音 URL,但无法将自定义参数发送到 twilio 以使用其参数进行回调.示例 scanario:呼叫者在 /twiml.php 处呼叫经过身份验证以连接到不同号码,Twilio 在呼叫开始时在 /voice_url.php 处发帖.假设他们的呼叫者 ID 可能未知,那么如何将当前运行的经过身份验证的呼叫者与呼叫 ID 相关联?

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?

  • 我已经尝试过的策略是查询所有正在运行的 twilio呼叫然后将呼叫者 ID 与先前存储的 callerId 匹配从 twilio statuscall 到 voice_url,但如果我有多个使用多个未知"来电显示的呼叫,这是行不通的.

推荐答案

在发起呼叫时,您可以使用自定义参数设置回调 url.

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

根据您的解释,我知道/voice_url.php 是您的回调 url.您可以在发起呼叫时指定呼叫 backurl 为/voice_url.php?id=xxxxxxx

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

这将使 twilio 也将 id 发送到您的回调 url,您可以在其中使用 get 请求参数获取 id.

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

我希望这会有所帮助.

这篇关于如何将入站 Twilio 呼叫 sid 与自定义 ID 关联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆