我正在尝试拨打电话并发送一些数字。我希望实现的结果是应该从我的公司号码转发到手机号码。
我使用下面的代码,
@call = @client.account.calls.create(
:from => 'xxxx', # twilio_number,
:to => 'xxxx', # RACF number,
:send_digits => "xxxx", # Business number
:timeout => "3",
:send_digits => "xxxx", # pin
:timeout => "3",
:send_digits => "*xx", # option for forwarding
:timeout => "3",
:send_digits => "xx", # confirm option
:timeout => "3",
:send_digits => "xxxxx", # destination number to which call should be forwarded
:method => "GET"
:url => "http://demo.twilio.com/docs/voice.xml" # Fetch instructions from this URL when the call connects
)
我正在使用超时暂停。请告诉我如何实现这一目标。
答案 0 :(得分:1)
Twilio开发者传道者在这里。
你几乎就在那里,但send_digits
应该有一个带有数字的长字符串和字符'w'来代表暂停。
根据the documentation,每个w
代表0.5秒,因此您应该将代码更改为以下内容:
@call = @client.account.calls.create(
:from => 'xxxx', # twilio_number,
:to => 'xxxx', # RACF number,
:send_digits => "+1234567www12345www*123www",
:url => "http://demo.twilio.com/docs/voice.xml" # Fetch instructions from this URL when the call connects
)
+1234567www12345www*123www
代表的地方:
所以在一行中没有任何超时。
希望这有助于你