[asterisk-bugs] [Asterisk 0014954]: Trunk registration / Auth user

Asterisk Bug Tracker noreply at bugs.digium.com
Thu May 7 09:16:06 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14954 
====================================================================== 
Reported By:                tornblad
Assigned To:                mmichelson
====================================================================== 
Project:                    Asterisk
Issue ID:                   14954
Category:                   Channels/chan_sip/Registration
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           1.6.1.0-rc5 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-04-23 00:59 CDT
Last Modified:              2009-05-07 09:16 CDT
====================================================================== 
Summary:                    Trunk registration / Auth user
Description: 
When using Asterisk GUI 2.0 to create a Trunk it adds the following lines
to users.conf

[internetcalls.com]
host = sip.internetcalls.com
username = XXXXXXXXXX
secret = XXXXXXXXXX
authuser = XXXXXXXXXXXX
trunkname = internetcalls.com
context = DID_internetcalls.com
group = null
hasexten = no
hasiax = no
hassip = yes
registeriax = no
registersip = yes
trunkstyle = voip
disallow = all
allow = all

but when registering the AUTHUSER parameter is not passed when registering
this way. Changing to REGISTERSIP = NO and adding a REGISTER =>
XXXX:XXXX:XXXX at sip.internetcalls.com works fine.

The same problem in 1.6.1 RCs and in 1.6.0.x

Best solution should be to add all parameters that might be needed....

register =>
[transport://]user[:secret[:authuser]]@host[:port][/extension]

====================================================================== 

---------------------------------------------------------------------- 
 (0104358) tornblad (reporter) - 2009-05-07 09:16
 http://bugs.digium.com/view.php?id=14954#c104358 
---------------------------------------------------------------------- 
Tried the patch with 1.6.1.0 and it works fine with the register problem,
and incoming calls work OK. But I can't make any outgoing calls! I'm not
really sure I'm using the parameters USERNAME, AUTHUSER and FROMUSER
correct.

My USERS.CONF contains

[Digisip]
type = peer
host = proxy.digisip.net
username = 0812341234
secret = MyPassword
trunkname = Digisip  ; GUI metadata
context = DID_Digisip
group = null
hasexten = no
hasiax = no
hassip = yes
registeriax = no
registersip = yes
trunkstyle = voip
authuser = 1234
insecure = port,invite
fromdomain = proxy.digisip.net
fromuser = 0812341234
disallow = all
allow = alaw,gsm
dtmfmode = rfc2833


And below is some SIP debug info, compare the username in the Register
packet, and the Invite packet.


==================== SIP SHOW REGISTRY
=====================================
Host                           dnsmgr Username       Refresh State        
       Reg.Time                 
proxy.digisip.net:5060         N      0812341234         105 Registered   
       Thu, 07 May 2009 12:45:14
sip.internetcalls.com:5060     N      mtornblad          105 Registered   
       Thu, 07 May 2009 12:45:14

2 SIP registrations.



================== INFO FROM DEBUG LOG WHEN DOING REGISTER
====================

REGISTER 12 headers, 0 lines
Reliably Transmitting (no NAT) to 82.209.165.194:5060:
REGISTER sip:proxy.digisip.net SIP/2.0
Via: SIP/2.0/UDP 192.168.1.11:5060;branch=z9hG4bK034d7d61;rport
Max-Forwards: 70
From: <sip:0812341234 at proxy.digisip.net>;tag=as3f1a271f
To: <sip:0812341234 at proxy.digisip.net>
Call-ID: 6902a10b4e153f22244dbb87379680fb at brittatorp.se
CSeq: 105 REGISTER
User-Agent: Asterisk PBX
Authorization: Digest username="1234", realm="proxy.digisip.net",
algorithm=MD5, uri="sip:proxy.digisip.net",
nonce="4a02bd9bfe581703efc503733b2bf94d65592b5a",
response="4472cb5782854d4e876355b3664a2477"
Expires: 120
Contact: <sip:s at 192.168.1.11>
Content-Length: 0


<--- SIP read from UDP://82.209.165.194:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.11:5060;branch=z9hG4bK034d7d61;rport=63006
From: <sip:0812341234 at proxy.digisip.net>;tag=as3f1a271f
To: <sip:0812341234 at proxy.digisip.net>
Call-ID: 6902a10b4e153f22244dbb87379680fb at brittatorp.se
CSeq: 105 REGISTER
Server: Sip EXpress router (0.9.3 (i386/linux))
Content-Length: 0
Warning: 392 82.209.165.194:5060 "Noisy feedback tells:  pid=7781
req_src_ip=192.168.1.11 req_src_port=63006 in_uri=sip:proxy.digisip.net
out_uri=sip:proxy.digisip.net via_cnt==1"


<--- SIP read from UDP://82.209.165.194:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.11:5060;branch=z9hG4bK034d7d61;rport=63006
From: <sip:0812341234 at proxy.digisip.net>;tag=as3f1a271f
To:
<sip:0812341234 at proxy.digisip.net>;tag=9d0c2f86226119ed3517373c02465a4b.17cc
Call-ID: 6902a10b4e153f22244dbb87379680fb at brittatorp.se
CSeq: 105 REGISTER
Contact: <sip:s at 192.168.1.11:5060>;expires=120
Server: Sip EXpress router (0.9.3 (i386/linux))
Content-Length: 0
Warning: 392 82.209.165.194:5060 "Noisy feedback tells:  pid=7781
req_src_ip=192.168.1.11 req_src_port=63006 in_uri=sip:proxy.digisip.net
out_uri=sip:proxy.digisip.net via_cnt==1"


============= INFO FROM DEBUG LOG WHEN DOING INVITE
==========================

Reliably Transmitting (no NAT) to 82.209.165.194:5060:
INVITE sip:047012345 at proxy.digisip.net SIP/2.0
Via: SIP/2.0/UDP 192.168.1.11:5060;branch=z9hG4bK222680d3;rport
Max-Forwards: 70
From: "asterisk" <sip:0812341234 at proxy.digisip.net>;tag=as539f2c86
To: <sip:047012345 at proxy.digisip.net>
Contact: <sip:0812341234 at 192.168.1.11>
Call-ID: 567e526c1acad88a57bc7f5503cd03da at proxy.digisip.net
CSeq: 105 INVITE
User-Agent: Asterisk PBX
Proxy-Authorization: Digest username="0812341234",
realm="proxy.digisip.net", algorithm=MD5,
uri="sip:047012345 at proxy.digisip.net",
nonce="4a02c6abcba94a4239a1e4d820e9a9bca2f990b0",
response="80eafbbfb82dc882f58e6c50a4298584"
Date: Thu, 07 May 2009 11:23:55 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 284

v=0
o=root 315638187 315638190 IN IP4 192.168.1.11
s=Asterisk PBX 1.6.1.0
c=IN IP4 192.168.1.11
t=0 0
m=audio 11704 RTP/AVP 8 3 101
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


<--- SIP read from UDP://82.209.165.194:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.1.11:5060;branch=z9hG4bK222680d3;rport=63006
From: "asterisk" <sip:0812341234 at proxy.digisip.net>;tag=as539f2c86
To:
<sip:047012345 at proxy.digisip.net>;tag=9d0c2f86226119ed3517373c02465a4b.5f2b
Call-ID: 567e526c1acad88a57bc7f5503cd03da at proxy.digisip.net
CSeq: 105 INVITE
Proxy-Authenticate: Digest realm="proxy.digisip.net",
nonce="4a02c6abcba94a4239a1e4d820e9a9bca2f990b0"
Server: Sip EXpress router (0.9.3 (i386/linux))
Content-Length: 0
Warning: 392 82.209.165.194:5060 "Noisy feedback tells:  pid=7793
req_src_ip=192.168.1.11 req_src_port=63006
in_uri=sip:047012345 at proxy.digisip.net
out_uri=sip:047012345 at proxy.digisip.net via_cnt==1"


Transmitting (no NAT) to 82.209.165.194:5060:
ACK sip:047012345 at proxy.digisip.net SIP/2.0
Via: SIP/2.0/UDP 192.168.1.11:5060;branch=z9hG4bK222680d3;rport
Max-Forwards: 70
From: "asterisk" <sip:0812341234 at proxy.digisip.net>;tag=as539f2c86
To:
<sip:047012345 at proxy.digisip.net>;tag=9d0c2f86226119ed3517373c02465a4b.5f2b
Contact: <sip:0812341234 at 192.168.1.11>
Call-ID: 567e526c1acad88a57bc7f5503cd03da at proxy.digisip.net
CSeq: 105 ACK
User-Agent: Asterisk PBX
Content-Length: 0


[May  7 13:23:55] NOTICE[23683]: chan_sip.c:16048 handle_response_invite:
Failed to authenticate on INVITE to '"asterisk"
<sip:0812341234 at proxy.digisip.net>;tag=as539f2c86'




I can overide the authentication problem and make outgoing calls work by
updating SIP.CONF with ....

auth = 1234:MyPassword at proxy.digisip.net 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-07 09:16 tornblad       Note Added: 0104358                          
======================================================================




More information about the asterisk-bugs mailing list