既存の呼び出しを更新する
この例では、Accountの既存の呼を更新する方法を示す。これは、すべてのコールのコールレッグ、方向(着信または発信)、およびステータスを返します。
サンプルコードの以下のプレースホルダーの値を置き換えてください:
| キー | 説明 |
|---|---|
bearer_token | OAuth トークン。 OAuthトークンについてもっと読む |
account_id | Vonage Business CommunicationsのアカウントID。 |
call_id | 更新したい通話のコールID。 |
from_type | 目的地のタイプ。以下の3つの値のいずれかを指定します。 extension , deviceあるいは pstn. |
from_destination | 出発地。もし from_type は extensionである。 from_destination は拡張子でなければならない。もし from_type は deviceである。 from_destination は有効なデバイスIDでなければならない。もし from_type は pstnである。 from_destination は有効な電話番号でなければならない。 |
to_type | 目的地のタイプ。以下の3つの値のいずれかを指定します。 extension , deviceあるいは pstn. |
to_destination | 目的地まで。もし from_type は extensionである。 to_destination は拡張子でなければならない。もし from_type は deviceである。 to_destination は有効なデバイスIDでなければならない。もし from_type は pstnである。 to_destination は有効な電話番号でなければならない。 |
to_type | のひとつであるべきだ。 click2dial, click2dialme, odr または default. |
state | これで通話状態が変わる。次のように設定する。 active を押して電話に出ます。電話を転送するには state は指定すべきではない。次のように設定する。 parked をクリックして通話をパークします。 |
curl -X PUT 'https://api.vonage.com/t/vbc.prod/telephony/v3/cc/accounts/$account_id/calls/$call_id' --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' \ --data-raw '{ "from": { "type": "$from_type", "destination": "$from_destination" }, "state": "$state", "to": { "type": "$to_type", "destination": "$to_destination" } }