Twilio 我可以在TwiML中插入一个变量吗?特别是要插入被叫号码的电话号码吗?

Twilio 我可以在TwiML中插入一个变量吗?特别是要插入被叫号码的电话号码吗?,twilio,Twilio,有没有办法在TwiML中实现以下功能?目标是在Twilio上产生一个听起来合理的语音信箱 <?xml version="1.0" encoding="UTF-8"?> <Response> <Pause length="15"/> <Say voice ="woman"> You have reached the voice mail of ##The_Phone_Number_One_has_Called##.

有没有办法在TwiML中实现以下功能?目标是在Twilio上产生一个听起来合理的语音信箱

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Pause length="15"/>
    <Say voice ="woman">
        You have reached the voice mail of ##The_Phone_Number_One_has_Called##.
        Please leave a message at the beep.
    </Say>
    <Record
        transcribe="true"
        />
</Response>

你已经接通了电话号码的语音信箱。
请在哔的一声后留言。

我有一组Twilio号码,希望将字符串
“######电话号码#####”
替换为呼叫者正在呼叫的号码。请告知我是否应该为每个电话号码部署一个专用TwiML。

您可以在服务器代码上执行此操作。只需将“#######################电话号码!

请记住,在Twilio向您的服务器发出的每个请求中,您都会收到用户在post参数“To”上拨打的号码,因此您可以从您的服务器返回:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Pause length="15"/>
    <Say voice ="woman">
        You have reached the voice mail of $POST["To"].
        Please leave a message at the beep.
    </Say>
    <Record
        transcribe="true"
        />
</Response>

您已到达$POST[“至”]的语音信箱。
请在哔的一声后留言。

你的服务器每次都会呈现不同的手机,Twilio会这样说。请注意,$POST[“To”]的格式为“+1xxxxxxxxx”,因此您可能希望删除+1。

使用带有TwiML Bin的模板,以及Polly voices,请尝试类似于此的Bin:



您已经接通了的语音信箱
{{To}}。
请在哔的一声后留言。

  • 如何将模板与TwiML容器一起使用
    ()
  • 亚马逊波利
    ()
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Pause length="15"/>
    <Say voice="Polly.Joanna">
        You have reached the voice mail of 
          <say-as interpret-as="telephone">{{To}}</say-as>.
        Please leave a message at the beep.
    </Say>
    <Record
        transcribe="true"
        />
</Response>