2016-04-14 9 views
3

私は電話をかけていくつかの数字を送信しようとしています。達成したい成果は、私のビジネス番号から携帯電話番号に転送する必要があります。Ruby on railを使用してtwilioコールで数字と待ち時間を送信する方法

私は、ポーズを取るために、タイムアウトを使用しています、コードの下に

@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 
) 

を使用。これを達成する方法を教えてください。

答えて

1

ここではTwilioの開発者のエバンジェリストです。

あなたはほとんど存在していますが、send_digitsには数字の長い文字列と休止を表す文字「w」が必要です。あなたがフォローするコードを変更する必要がありますのでthe documentationwによると

は、0.5秒を表します

+1234567www12345www*123wwwは表すことになり
@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 
) 

  • ビジネス数
  • 1.5秒間のポーズを
  • ピン
  • 任意のタイムアウトなしだから、すべて1行で
  • などを転送するための別の1.5秒間のポーズ
  • オプション...

希望します。

+0

twilioでも数字を送信しようとしています。 1つの連続した文字列を送信しようとすると、 'Twilio :: REST :: RequestError:SendDigitsが32文字未満である必要があります.'というエラーが表示されます。 – Saurabh

+0

ファイルをポストパラメータとして送信する代わりにtwimlを使うこともできます。 – Saurabh

+0

@SaurabhはここのMeganの回答を見ています:http://stackoverflow.com/questions/36320949/twilio-rest-api-http-400-error-senddigits-must-be-less-than-32-characters-long –

関連する問題