Benjamin on Asterisk Mailing Lists
2004-Nov-05 22:59 UTC
[Asterisk-Users] SIP REGISTER -- Asterisk non-compliant or is it the provider?
I am trying to get Asterisk to register with a SIP provider who officially only supports ATAs of the incumbent telephone monopolist over here. I have so far been lucky enough to get them to ***respond*** to my requests for information on what parameters need changing in the REGISTER messages in order to successfully register. Confusion arises from the fact that there are two different user IDs, one is a telephone number associated with the SIP account, say 05099999999, the other is an account name, say DUDEDUDE. The provider's support staff says that the userid in 'From: <sip:userid@domain.com> ...' should be the phone number while the userid in 'Authorization: Digest username="userid"...' of the same REGISTER message should be the account name. I am not sure if this can be right. At least, whether compliant or not, it would seem that such a REGISTER message cannot be constructed by Asterisk. If I use "register => phonenumber@domain.com" then then Asterisk will construct a REGISTER message with the phone number in both the From field and the username field in the digest. If I use "register => accountname@domain.com" then Asterisk uses the account name in both places. The optional parameter at the end of the register directive only seems to have an effect on the contact field, ie "register => fred@domain.com/123456789" will still put "fred" into both the From field and the username field of the digest while "123456789" will show up in the Contact field only. Can somebody comment on this? - is it in compliance with RFC3261 to have different values in the>From and the Digest username fields?- can Asterisk construct such a REGISTER message? To illustrate this a bit further, here is an excerpt from a session transscript ... REGISTER sip:ispvoip-9999.ocn.ne.jp SIP/2.0 Via: SIP/2.0/UDP 9.9.9.9:5060;branch=z9hG4bK6920ea27 From: <sip:05099999999@ispvoip-3437.ocn.ne.jp>;tag=as040e1159 To: <sip:05099999999@ispvoip-9999.ocn.ne.jp> Call-ID: 999999999999999999999999999999@9.9.9.9 CSeq: 961 REGISTER Authorization: Digest username="05099999999", realm="ocn.ne.jp", algorithm="MD5", uri="sip:210.9.9.9", nonce="1099640598", response="a9d877017f24bb624cdc1a39a8a73b4c", opaque="" Expires: 120 Contact: <sip:05099999999@9.9.9.9> Event: registration SIP/2.0 401 Unauthorized v: SIP/2.0/UDP 9.9.9.9:5060;branch=z9hG4bK6920ea27 From: <sip:05099999999@ispvoip-9999.ocn.ne.jp>;tag=as040e1159 To: <sip:05099999999@ispvoip-9999.ocn.ne.jp> Call-ID: 999999999999999999999999999999@9.9.9.9 CSeq: 961 REGISTER Expires: 120 Event: registration Date: Fri, 05 Nov 2004 08:17:48 GMT WWW-Authenticate: Digest realm="ocn.ne.jp", domain="sip:210.9.9.9", nonce="1099640598", opaque="", stale=FALSE, algorithm=MD5 The provider's support staff suggested that their server expected to see a REGISTER message like the following: REGISTER sip:ispvoip-9999.ocn.ne.jp SIP/2.0 Via: SIP/2.0/UDP 9.9.9.9:5060;branch=z9hG4bK6920ea27 From: <sip:05099999999@ispvoip-3437.ocn.ne.jp>;tag=as040e1159 To: <sip:05099999999@ispvoip-9999.ocn.ne.jp> Call-ID: 999999999999999999999999999999@9.9.9.9 CSeq: 961 REGISTER Authorization: Digest username="DUDEDUDE", realm="ocn.ne.jp", algorithm="MD5", uri="sip:210.9.9.9", nonce="1099640598", response="a9d877017f24bb624cdc1a39a8a73b4c", opaque="" Expires: 120 Contact: <sip:05099999999@9.9.9.9> Event: registration Unfortunately, I have not been able to get Asterisk to construct a message like the above. any hints appreciated. rgds benjk -- Sunrise Telephone Systems, 9F Shibuya Daikyo Bldg., 1-13-5 Shibuya, Tokyo, Japan. NB: Spam filters in place. Messages unrelated to the * mailing lists may get trashed.
Girish Gopinath
2004-Nov-06 07:33 UTC
[Asterisk-Users] SIP REGISTER -- Asterisk non-compliant or is it the provider?
Hello, --- Benjamin on Asterisk Mailing Lists <benjk.on.asterisk.ml@gmail.com> wrote:> The provider's support staff says that the userid in 'From: > <sip:userid@domain.com> ...' should be the phone number while the > userid in 'Authorization: Digest username="userid"...' of the same > REGISTER message should be the account name. I am not sure if this can > be right. At least, whether compliant or not, it would seem that such > a REGISTER message cannot be constructed by Asterisk.The From header field in a SIP message is used to identify the initiator of the request. AFAIK, the 05099999999 in the From header acts as a display name. It can be used to determine the processing rules by other SIP entities. For example, PSTN gateways can use it to determine if it is a valid callerid or not (For INVITEs). The Auth credentials in the Request can be different. It should be the username and password for the account that the provider has given you. I hope others here will give a better explanation on this...> - is it in compliance with RFC3261 to have different values in the > >From and the Digest username fields?I think yes. Our UACs register with SIP Express Router with different values in these fields. Attached below is an ngrep trace of such a request processing.> - can Asterisk construct such a REGISTER message?Sorry. I am not sure about this. Regards, Girish Here's the trace: REGISTER sip:XXX.XXX.XXX.XXX SIP/2.0. Via: SIP/2.0/UDP 192.168.68.24:12894. Max-Forwards: 70. From: <sip:Girish@XXX.XXX.XXX.XXX>;tag=699fdcaedde144a68097a86c5ec00655;epid=7de641515e. To: <sip:Girish@XXX.XXX.XXX.XXX>. Call-ID: 8e134249fa054bf9b9ffee10575b6b26@192.168.68.24. CSeq: 1 REGISTER. Contact: <sip:192.168.68.24:12894>;methods="INVITE, MESSAGE, INFO, SUBSCRIBE, OPTIONS, BYE, CANCEL, NOTIFY, ACK, REFER". User-Agent: RTC/1.2.4949 Event: registration. Allow-Events: presence. Content-Length: 0. . SIP/2.0 401 Unauthorized. Via: SIP/2.0/UDP 192.168.68.24:12894;rport=4061;received=XX.XX.XX.XXX. From: <sip:Girish@XXX.XXX.XXX.XXX>;tag=699fdcaedde144a68097a86c5ec00655;epid=7de641515e. To: <sip:Girish@XXX.XXX.XXX.XXX>;tag=b27e1a1d33761e85846fc98f5f3a7e58.d1fd. Call-ID: 8e134249fa054bf9b9ffee10575b6b26@192.168.68.24. CSeq: 1 REGISTER. WWW-Authenticate: Digest realm="XXX.XXX.XXX.XXX", nonce="418cd4b94a2ea94004191fd618b7bbb7041f8f40", qop="auth". Server: SIP EXpress Router (0.8.14 (i386/linux)). Content-Length: 0. . . REGISTER sip:XXX.XXX.XXX.XXX SIP/2.0. Via: SIP/2.0/UDP 192.168.68.24:12894. Max-Forwards: 70. From: <sip:Girish@XXX.XXX.XXX.XXX>;tag=699fdcaedde144a68097a86c5ec00655;epid=7de641515e. To: <sip:Girish@XXX.XXX.XXX.XXX>. Call-ID: 8e134249fa054bf9b9ffee10575b6b26@192.168.68.24. CSeq: 2 REGISTER. Contact: <sip:192.168.68.24:12894>;methods="INVITE, MESSAGE, INFO, SUBSCRIBE, OPTIONS, BYE, CANCEL, NOTIFY, ACK, REFER". User-Agent: RTC/1.2.4949 Authorization: Digest username="girish-smarttest-com", realm="XXX.XXX.XXX.XXX", qop=auth, algorithm=md5, uri="sip:XXX.XXX.XXX.XXX", nonce="418cd4b94a2ea94004191fd618b7bbb7041f8f40", nc=00000001, cnonce="15420645451543562242791578613325", response="89d8531e598629b022230df475b5bb65". Event: registration. Allow-Events: presence. Content-Length: 0. . . SIP/2.0 200 OK. Via: SIP/2.0/UDP 192.168.68.24:12894;rport=4061;received=XX.XX.XX.XXX. From: <sip:Girish@XXX.XXX.XXX.XXX>;tag=699fdcaedde144a68097a86c5ec00655;epid=7de641515e. To: <sip:Girish@XXX.XXX.XXX.XXX>;tag=b27e1a1d33761e85846fc98f5f3a7e58.d1fd. Call-ID: 8e134249fa054bf9b9ffee10575b6b26@192.168.68.24. CSeq: 2 REGISTER. Expires: 120. Contact: <sip:XX.XX.XX.XXX:4061>;q=0.00;expires=3600. Server: SIP EXpress Router (0.8.14 (i386/linux)). Content-Length: 0. __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com