メニュー

Expand
ページを評価:

SIP Registration

What is SIP Registration?

SIP Endpoints are identified by their Address of Record (AOR). The AOR is a high level name that is assigned to a SIP entity without regard to the device or devices that names might use. The format for an AOR is as follows:

sip:user@domain

SIP endpoints are reachable via their location, which is identified by an IP address, port number and protocol. In order to receive calls, ultimately the caller needs to know the location of the callee, so that the call between the two endpoints can be connected. Since most SIP endpoints do not have a permanent, fixed, publicly-reachable IP address, they will need to register with a central server, or Registrar, so that they can receive incoming calls.

SIP Registration is the process of binding an endpoint’s AOR with its location. The SIP Endpoint sends a SIP REGISTER request to a Registrar, containing its AOR, location, authentication and other information in the message. The registrar validates the request, and if allowed, stores the associated binding in the location service of the domain it handles. The registrar then acts as the front end to the location service for a SIP Domain, maintaining the location bindings of its endpoints.

Your Twilio Programmable Voice SIP Domain allows you to dynamically register your SIP Endpoint with Twilio, so you can make and receive calls globally. You may use this feature by enabling the SIP Registration option in your SIP Domain.

下記について学ぶ:

SIPエンドポイントをレジストする

Twilio’s SIP Registrar is deployed per Edge Location; the bindings stored in the SIP Registrar are shared between Edge Locations, so your locally-registered endpoints are globally reachable. You can register with any Edge Location, but typically you would register with the Edge Location which is physically closest to your device location, as this will give you the best performance and quality, due to reduced latency, jitter, and packet loss. You can also switch between Edge Locations if you like, for failover, changing locations, or other reasons.

When you configure your SIP device, you specify the SIP Domain URI, including the Twilio Edge Location with which you want to register.

{domain-name}.sip.{edge-location}.twilio.com

If you do not specify an Edge Location in either your registration URI, or your outbound proxy URI, the registration will default to Twilio’s Ashburn, VA, USA datacenter.

Your SIP device may include configuration options for both a Registration Domain and an Outbound Proxy. If that is the case, we suggest using the Twilio Edge Location URI for the Outbound Proxy, and your SIP Domain URI for the Registration Domain.

For example, if your domain was named mydomain, and you wanted to register to our Sydney edge, you would configure your device as follows:

  • Registration Domain: mydomain.sip.twilio.com
  • Outbound Proxy: sip.sydney.twilio.com

If your SIP device doesn't use an Outbound Proxy in its configuration, then you should use the full mydomain.sip.sydney.twilio.com URI as the Registration Domain.

SIPエンドポイントRegistrationの認証

Your REGISTER request will be authenticated against user Credential Lists that have been mapped to this SIP Domain.

The Username that is configured in the SIP Endpoint must exactly match a Username specified in a Credential List mapped to this SIP Domain for successful registration. Some SIP Endpoints refer to this field as the Username while others call it the Authorization ID or Authentication ID. The Password or Secret used should match the Password set for the same Credential.

SIP Endpoint REGISTER Expiry and Refresh Intervals

The SIP Endpoint needs to re-register in periodic intervals, otherwise the registration will expire and be removed from the location service. This is commonly configured using parameters called Expiration and/or Refresh Intervals, or similar, on most SIP Endpoints. These parameters and their default values vary per device.

You may want to reduce these intervals to a lower value than the defaults for resiliency reasons. The smallest Registration Expiration value that a SIP Endpoint can use when registering with Twilio is 600 seconds (10 minutes); if you set the value any lower, the REGISTER will fail with a SIP "423 Interval too brief" error. The largest Registration Expiration value Twilio will allow is one hour (3600 seconds); any requested values larger than this will be reduced to one hour as part of the REGISTER negotiation.

Additionally, you'll want to set a Refresh interval to occur before the Expiration interval you set, or you will risk your SIP Endpoint’s registration expiring. You should set this to a value that is lower than the Expiration you set; a typical setting is one-half the value. For example, if you set your Expiration to 600 seconds, you would set your Refresh to something like 300 seconds.

If your device has only one parameter to cover both of these settings, then this is normally treated as an Expiration setting, and the Refresh setting is automatically deduced to be lower than that value in order to keep the registration from expiring.

制限事項

下記のProgrammable Voice SIP Registrationの制限についてご留意ください。

  • There is a maximum of 100 SIP Domains allowed per Account.
  • There is a maximum of 10 Active Endpoint registrations allowed per Address-of-Record (AOR); the 11th active registration attempt for the same AOR will be rejected.
  • There is a maximum of 100 Credential Lists allowed per SIP Domain, with a maximum of 1000 users per list.
  • The maximum number of Active Endpoint registrations allowed per SIP Domain is based on a combination of maximum Credential Lists per domain, maximum Credential List users per list, and maximum Active Endpoint registrations per AOR limits. If all configurations are maximized, 1 Million Active Endpoint registrations per SIP Domain are allowed.
  • The maximum number of Active Endpoint registrations allowed per Account is based on combination of maximum SIP domains per Account, maximum Credential Lists per domain, maximum Credential List users per list, and maximum Active Endpoint registrations per AOR limits. If all configurations are maximized, 100 Million Active Endpoint registrations per account are allowed.

レジスト済みのSIPエンドポイントでの通話の着信

In order for your SIP Endpoint to receive calls from Twilio, you'll use the same TwiML or REST API calling methods you use today. See receiving SIP from Twilio for REST API & TwiML details.

Calling a registered SIP endpoint works the same as calling any other SIP URI, only you will now be using the AOR of your registered SIP Endpoint. Keep in mind that calls need to be initiated by your application, just like any other Programmable Voice SIP call.

When calling your registered SIP Endpoint, you should use the general SIP Domain URI, omitting the Edge Location from the URI, i.e.:

{username}@{domain-name}.sip.twilio.com

たとえば、Twilio電話番号を購入すると、その番号に電話がかかってきたときにSIPエンドポイントに着信するよう設定できます。

手順:

  1. Buy a Twilio phone number in the country/area-code you want. The number must be provisioned in the same (sub)-account as the SIP Domain enabled for Registration
  2. Create a TwiML Bin with the following. Replace the myusername and mysipdomain with your information.
<Response>
  <Dial>
    <Sip>myusername@mysipdomain.sip.twilio.com</Sip>
  </Dial>
</Response>

myusername and mysipdomain in the TwiML example above must match the username and domain name you used to register your SIP endpoint. If the device is not actively registered, the call will not complete, and you will receive a debugger alert.

When calling a Registered SIP AOR, Twilio will call all of the SIP Endpoints registered using that AOR in parallel across all edge locations, so the specific Edge Location does not need to be specified in the SIP URI you call. Also note that if you have multiple SIP Endpoints registered under the same AOR, then all registered devices will ring simultaneously. See Limits.

For backwards compatibility, the us1 and us1-ix regions are still allowed, but only when calling SIP Endpoints which are specifically registered to the Ashburn, VA, USA datacenter (over public Internet or Twilio Interconnect, respectively). Any other region or edge specified when calling a registered SIP endpoint will return an error. It is strongly suggested that you adjust any legacy code to no longer use the regional domain when calling a registered SIP endpoint.

レジスト済みSIPエンドポイントを使用した通話の発信

SIP calls from your registered Endpoint to your Twilio SIP Domain are treated just like any inbound SIP call received on that domain. After the INVITE is authenticated, Twilio will invoke the Voice URL configured on your SIP domain. See sending SIP to Twilio for details.

Normally, your SIP Endpoint would send its INVITEs to the edge-specific domain that it registered with, but they can be sent to any Twilio Edge Location:

{domain-name}.sip.{edge-location}.twilio.com

SIPドメインでのSIPエンドポイントの音声接続をテストする

For example, you can configure your SIP Domain Voice URL with the following to verify connectivity with Twilio. It’s a simple app that will say a brief message and play some music.

http://demo.twilio.com/docs/voice.xml

SIPエンドポイントから公衆電話ネットワークに通話を発信するには

In this section we summarize a few different ways you can bridge calls from your registered SIP Endpoint to the public telephone network using Programmable Voice.

拡張されたTwiML Binテンプレートを使用して公衆電話ネットワーク上の携帯および固定電話に通話を発信する

Twilio has Enhanced TwiML Bins Templates which extracts the username from both the From and To SIP URIs in the SIP INVITE of the parent call leg that can be used to construct a dynamic TwiML response.

The example below shows how the To field of the child call leg is populated with the username of the SIP INVITEs To field of the parent call leg.

<Response>
  <Dial callerId="+14087998994">{{#e164}}{{To}}{{/e164}}</Dial>
</Response>

Note 1: When you dial a number using your SIP Endpoint it must be in E.164. (such as +14157012311 or +441562720212) The Twilio Lookup tool is useful for determining international E.164 formats.

Note 2: The callerId must be a number verified on the Twilio Console.

次の例では、もう一歩進んでSIPエンドポイントの発信者に基づいて動的にcallerId(発信者番号)を設定します。 先の例と同様、発信者はE.164形式で、かつTwilio Consoleで検証済みの番号であることが必要です。 ただし日本国内の通話発信では、Twilio電話番号以外を使用すると発信者番号を正しく通知できません。

<Response>
  <Dial callerId="{{#e164}}{{From}}{{/e164}}">{{#e164}}{{To}}{{/e164}}</Dial>
</Response>

The From field above corresponds to the username of the SIP URI found in the From field in the SIP INVITE. This username also corresponds to the username that the SIP Endpoint uses to authenticate itself that must be configured in the SIP Registration Credential List on the Console.

SIPエンドポイントを構成する

Twilioは標準のSIP Registrationをサポートします。 下記のセクションには、はじめるにあたって役立つサンプル構成ガイドが含まれます。 標準に従って振舞わないSIPエンドポイントがある可能性があり、そのようなエンドポイントはサポートされません。

下記の構成ガイドはSIPエンドポイントのTwilioへの接続に役立つよう書かれています。

これらのシステムの多くには、多数のバージョン、バリエーション、アドオン、およびオプションがあるため、直面する設定が当社の設定ガイドの内容と異なる場合があります。そのため、これらのドキュメントは、設定テンプレートというよりは、一般的なガイドラインとして用意されています。ご自身のネットワーク、SIPインフラ、およびそれらの機能の仕方について熟知していることを前提としています。

Twilioはサードパーティーの製品についての直接的なサポートを提供できません: SIPエンドポイントにおけるそのような製品の構成の支援については、製造元に連絡してください。

SIPエンドポイントの設定ガイドを共有し、他のユーザーのためにこのセクションを改善させていただける場合は、お手数ですが、その設定ガイドまたは既存のガイドの修正版を twilio_support@kddi-web.com までお寄せください。

Twilioは標準のSIP Registrationをサポートします。 下記のセクションには、はじめるにあたって役立つサンプル構成ガイドが含まれます。 標準に従って振舞わないSIPエンドポイントがある可能性があり、そのようなエンドポイントはサポートされません。

ページを評価:

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。

        
        
        

        フィードバックくださりありがとうございます!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        ステップ1

        Get link

        Get a free personal referral link here

        ステップ2:

        Give $10

        Your user signs up and upgrade using link

        ステップ3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more