トランク
トランクリソースは、Twilio アカウントの SIP トランクを表します。トランクは、クレデンシャルリスト、IP アクセスコントロールリスト、オリジネーション URL、および電話番号を所有します。
SIP トランクの作成および使用方法については、クイックスタートガイドをご覧ください。
アクション
リソースのプロパティ
Names in PHP format | |
---|---|
accountSid
|
このトランクを所有するアカウントの一意の ID。 |
domainName
|
Twilio で予約されている、SIP トラフィックをルーティングする先の一意のアドレス。ドメイン名には英字、数字、および |
disasterRecoveryMethod
|
|
disasterRecoveryUrl
|
設定されているオリジネーション URL への SIP トラフィックの送信中にエラーが発生した場合、Twilio がリクエストを送信するHTTP URL。Twilio はこの URL から TwiML を取得し、他の通常の TwiML 通話と同じようにその命令を実行します。詳細については、「ディザスターリカバリー」を参照してください。 |
friendlyName
|
人間が読みやすい形式のトランクの名前。 |
secure
|
このトランクのセキュアトランキング設定。オンの場合、このトランクを経由するすべての通話が、メディアには SRTP を使い、シグナリングには TLS を使って保護されます。オフの場合は、メディアに RTP が使われます。Twilio はこの URL から TwiML を取得し、他の通常の TwiML 通話と同じように、その命令を実行します。 詳細については、「セキュアトランキング」を参照してください。 |
recording
|
このトランクの録音設定。オンの場合、このトランクを経由するすべての通話が録音され、電話が鳴った時点または電話に応答した時点から録音を開始できます。Twilio はこの URL から TwiML を取得し、他の通常の TwiML 通話と同じように、その命令を実行します。 詳細については、「録音」を参照してください。 |
cnamLookupEnabled
|
The Caller ID Name (CNAM) lookup setting for this trunk. If turned on, all inbound calls to this SIP Trunk from the United States and Canada will automatically perform a CNAM Lookup and display Caller ID data on your phone. See CNAM Lookups for more information. |
authType
|
ドメインにマップされている認証のタイプ。可能な値は |
authTypeSet
|
|
dateCreated
|
このActivityが作成された日付です。 |
dateUpdated
|
このActivityが更新された日付です。 |
sid
|
Twilio で SIP トランクを一意に識別する 34 文字の文字列。 |
url
|
以下を基準とする、このリソースの相対的な URL。 |
links
|
|
すべてのトランクをリストする
GET /Trunks
アカウントに対するすべての SIP トランクのページ化リストを取得します。
curl -G https://trunking.twilio.com/v1/Trunks \ -u '{twilio account sid}:{twilio auth token}'
レスポンス例
{ "trunks": [ { "sid": "TKfa1e5a85f63bfc475c2c753c0f289932", "account_sid": "ACxxx", "domain_name": "anniebpsip.pstn.twilio.com", "disaster_recovery_method": "POST", "disaster_recovery_url": "https://uh-oh.mytrunkingappbroke.io/recovery", "friendly_name": "anniebp", "secure": false, "cnam_lookup_enabled": false, "recording": { "trim": "do-not-trim", "mode": "record-from-ringing" }, "auth_type": "CREDENTIAL_LIST", "auth_type_set": [ "CREDENTIAL_LIST" ], "date_created": "2015-03-10T04:57:44Z", "date_updated": "2015-09-02T23:23:11Z", "url": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932", "links": { "origination_urls": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/OriginationUrls", "credential_lists": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/CredentialLists", "ip_access_control_lists": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/IpAccessControlLists", "phone_numbers": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/PhoneNumbers" } } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0", "previous_page_url": null, "url": "https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0", "next_page_url": null, "key": "trunks" } }
SIPトランクを作成する
POST /Trunks
新しい SIP トランクを作成します。
curl -XPOST https://trunking.twilio.com/v1/Trunks \ -d "FriendlyName=MyTrunk" \ -u '{twilio account sid}:{twilio auth token}'
オプションパラメーター
Names in PHP format | |
---|---|
friendlyName
オプション
|
人間が読みやすい形式のトランクの名前。 |
domainName
オプション
|
Twilio で予約されている、SIP トラフィックをルーティングする先の一意のアドレス。ドメイン名には英字、数字、および |
disasterRecoveryUrl
オプション
|
設定されているオリジネーション URL への SIP トラフィックの送信中にエラーが発生した場合、Twilio がリクエストを送信するHTTP URL。Twilio はこの URL から TwiML を取得し、他の通常の TwiML 通話と同じようにその命令を実行します。詳細については、「ディザスターリカバリー」を参照してください。 |
disasterRecoveryMethod
オプション
|
|
recording
オプション
|
このトランクの録音設定。オンの場合、このトランクを経由するすべての通話が録音され、電話が鳴った時点または電話に応答した時点から録音を開始できます。詳細については、「録音」を参照してください。 |
secure
オプション
|
このトランクのセキュアトランキング設定。オンの場合、このトランクを経由するすべての通話が、メディアには SRTP を使い、シグナリングには TLS を使って保護されます。オフの場合は、メディアに RTP が使われます。詳細については、「セキュアトランキング」を参照してください。 |
cnamLookupEnabled
オプション
|
The Caller ID Name (CNAM) lookup setting for this trunk. If turned on, all inbound calls to this SIP Trunk from the United States and Canada will automatically perform a CNAM Lookup and display Caller ID data on your phone. See CNAM Lookups for more information. |
レスポンス例
{ "sid": "TK81a7b93bbf6945bb65b004f39002b9d5", "account_sid": "ACxxx", "domain_name": null, "disaster_recovery_method": null, "disaster_recovery_url": null, "friendly_name": "MyTrunk", "secure": false, "cnam_lookup_enabled": false, "recording": { "trim": "do-not-trim", "mode": "do-not-record" }, "auth_type": "", "auth_type_set": [], "date_created": "2015-09-02T23:29:47Z", "date_updated": "2015-09-02T23:29:47Z", "url": "https://trunking.twilio.com/v1/Trunks/TK81a7b93bbf6945bb65b004f39002b9d5", "links": { "origination_urls": "https://trunking.twilio.com/v1/Trunks/TK81a7b93bbf6945bb65b004f39002b9d5/OriginationUrls", "credential_lists": "https://trunking.twilio.com/v1/Trunks/TK81a7b93bbf6945bb65b004f39002b9d5/CredentialLists", "ip_access_control_lists": "https://trunking.twilio.com/v1/Trunks/TK81a7b93bbf6945bb65b004f39002b9d5/IpAccessControlLists", "phone_numbers": "https://trunking.twilio.com/v1/Trunks/TK81a7b93bbf6945bb65b004f39002b9d5/PhoneNumbers" } }
SIP トランクを取得する
GET /Trunks/{Trunk SID}
特定の SIP トランクに対するインスタンスデータを取得します。
curl -G https://trunking.twilio.com/v1/Trunks/{trunk sid} \ -u '{twilio account sid}:{twilio auth token}'
レスポンス例
{ "sid": "TKe776ce47670e9955b637617acd0ed2d5", "account_sid": "ACxxx", "domain_name": "obemp-trunk.pstn.twilio.com", "disaster_recovery_method": null, "disaster_recovery_url": null, "friendly_name": "obemp-trunk", "secure": false, "cnam_lookup_enabled": false, "recording": { "trim": "do-not-trim", "mode": "record-from-ringing" }, "auth_type": "CREDENTIAL_LIST", "auth_type_set": [ "CREDENTIAL_LIST" ], "date_created": "2015-05-05T20:59:07Z", "date_updated": "2015-05-05T22:44:23Z", "url": "https://trunking.twilio.com/v1/Trunks/TKe776ce47670e9955b637617acd0ed2d5", "links": { "origination_urls": "https://trunking.twilio.com/v1/Trunks/TKe776ce47670e9955b637617acd0ed2d5/OriginationUrls", "credential_lists": "https://trunking.twilio.com/v1/Trunks/TKe776ce47670e9955b637617acd0ed2d5/CredentialLists", "ip_access_control_lists": "https://trunking.twilio.com/v1/Trunks/TKe776ce47670e9955b637617acd0ed2d5/IpAccessControlLists", "phone_numbers": "https://trunking.twilio.com/v1/Trunks/TKe776ce47670e9955b637617acd0ed2d5/PhoneNumbers" } }
SIP トランクをアップデートする
POST /Trunks/{Trunk SID}
SIP トランクのプロパティーをアップデートします。
curl -XPOST https://trunking.twilio.com/v1/Trunks/{trunk sid} \ -d "DisasterRecoveryUrl=https://uh-oh.mytrunkingappbroke.io/recovery" \ -d "DisasterRecoveryMethod=POST" \ -u '{twilio account sid}:{twilio auth token}'
オプションパラメーター
Names in PHP format | |
---|---|
sid
必須
|
Twilio で SIP トランクを一意に識別する 34 文字の文字列。 |
friendlyName
オプション
|
人間が読みやすい形式のトランクの名前。 |
domainName
オプション
|
Twilio で予約されている、SIP トラフィックをルーティングする先の一意のアドレス。ドメイン名には英字、数字、および |
disasterRecoveryUrl
オプション
|
設定されているオリジネーション URL への SIP トラフィックの送信中にエラーが発生した場合、Twilio がリクエストを送信するHTTP URL。Twilio はこの URL から TwiML を取得し、他の通常の TwiML 通話と同じようにその命令を実行します。詳細については、「ディザスターリカバリー」を参照してください。 |
disasterRecoveryMethod
オプション
|
|
recording
オプション
|
このトランクの録音設定。オンの場合、このトランクを経由するすべての通話が録音され、電話が鳴った時点または電話に応答した時点から録音を開始できます。詳細については、「録音」を参照してください。 |
secure
オプション
|
このトランクのセキュアトランキング設定。オンの場合、このトランクを経由するすべての通話が、メディアには SRTP を使い、シグナリングには TLS を使って保護されます。オフの場合は、メディアに RTP が使われます。詳細については、「セキュアトランキング」を参照してください。 |
cnamLookupEnabled
オプション
|
The Caller ID Name (CNAM) lookup setting for this trunk. If turned on, all inbound calls to this SIP Trunk from the United States and Canada will automatically perform a CNAM Lookup and display Caller ID data on your phone. See CNAM Lookups for more information. |
レスポンス例
{ "sid": "TKfa1e5a85f63bfc475c2c753c0f289932", "account_sid": "ACxxx", "domain_name": "anniebpsip.pstn.twilio.com", "disaster_recovery_method": "POST", "disaster_recovery_url": "https://uh-oh.mytrunkingappbroke.io/recovery", "friendly_name": "anniebp", "secure": false, "cnam_lookup_enabled": false, "recording": { "trim": "do-not-trim", "mode": "record-from-ringing" }, "auth_type": "CREDENTIAL_LIST", "auth_type_set": [ "CREDENTIAL_LIST" ], "date_created": "2015-03-10T04:57:44Z", "date_updated": "2015-09-02T23:32:19Z", "url": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932", "links": { "origination_urls": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/OriginationUrls", "credential_lists": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/CredentialLists", "ip_access_control_lists": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/IpAccessControlLists", "phone_numbers": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/PhoneNumbers" } }
トランクを削除する
DELETE /Trunks/{Trunk SID}
アカウントから SIP トランクインスタンスを削除します。
curl -XDELETE https://trunking.twilio.com/v1/Trunks/{trunk sid} \ -u '{twilio account sid}:{twilio auth token}'
レスポンス例
リクエストが成功すると、HTTP ステータスコード 204 と空の本文が返されます。
ヘルプが必要ですか?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.