Hi,
I’m running asterisk 1.2.13 which is registered as a SIP client at another asterisk server. Calling out works fine; incoming calls work as long as the username of the calling party does not exist in my configuration.
According to the description in voip-info.org/tiki-index.php … 20Channels asterisk “first tries to find a [user] section matching the caller name (From: username)”.
The domain name seems to be ignored, so asterisk thinks the caller is a local user and requires Proxy Authentication. (For users not existing locally the request is correctly matched with a corresponding peer context based on the caller’s IP address). The relevant section of the debug output is included below.
Is there any way to prevent asterisk from trying to do a context lookup by username? In particular, when the caller on the other asterisk calls me (i.e. extension 14 on the other system), it works as long as he doesn’t have the username 13, in which case asterisk seems to try to authenticate against context [13].
I’ve spent hours on this but haven’t found a solution. I’m looking forward to any ideas you might have
Eddie.
sip.conf:
[code]register => 14:xxx@192.168.0.123/97
[…]
[13]
type=friend
context=local
callerid=13
canreinvite=no
secret=yyy
username=13
host=dynamic
nat=yes
[asterisk-test-out]
type=peer
secret=test
callerid=14
username=14
fromuser=14
host=192.168.0.123
canreinvite=no
insecure=very
nat=no
context=from-external
[/code]
debug output:
[code]
<-- SIP read from 192.168.0.123:5060:
INVITE sip:97@10.1.5.6 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.123:5060;branch=z9hG4bK14bf4a88;rport
From: “Joe” sip:13@192.168.0.123;tag=as2d7632b3
To: sip:97@10.1.5.6
Contact: sip:13@192.168.0.123
Call-ID: 57f2109745f7ec44491ed09d2bb8d248@192.168.0.123
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Fri, 07 Sep 2007 09:37:06 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 263
v=0
o=root 2494 2494 IN IP4 192.168.0.123
s=session
c=IN IP4 192.168.0.123
t=0 0
m=audio 14402 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
— (13 headers 12 lines) —
Using INVITE request as basis request - 57f2109745f7ec44491ed09d2bb8d248@192.168.0.123
Sending to 192.168.0.123 : 5060 (NAT)
Reliably Transmitting (NAT) to 192.168.0.123:5060:
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.0.123:5060;branch=z9hG4bK14bf4a88;received=192.168.0.123;rport=5060
From: “Joe” sip:13@192.168.0.123;tag=as2d7632b3
To: sip:97@10.1.5.6;tag=as452f5a35
Call-ID: 57f2109745f7ec44491ed09d2bb8d248@192.168.0.123
CSeq: 102 INVITE
User-Agent: rysavy.net SIP client
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Proxy-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="40a650b6"
Content-Length: 0
Scheduling destruction of call ‘57f2109745f7ec44491ed09d2bb8d248@192.168.0.123’ in 15000 ms
Found user '13’
rom059*CLI>
<-- SIP read from 192.168.0.123:5060:
ACK sip:97@10.1.5.6 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.123:5060;branch=z9hG4bK14bf4a88;rport
From: “Joe” sip:13@192.168.0.123;tag=as2d7632b3
To: sip:97@10.1.5.6;tag=as452f5a35
Contact: sip:13@192.168.0.123
Call-ID: 57f2109745f7ec44491ed09d2bb8d248@192.168.0.123
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0
INVITE sip:97@10.1.5.6 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.123:5060;branch=z9hG4bK06732597;rport
From: “Joe” sip:13@192.168.0.123;tag=as2d7632b3
To: sip:97@10.1.5.6
Contact: sip:13@192.168.0.123
Call-ID: 57f2109745f7ec44491ed09d2bb8d248@192.168.0.123
CSeq: 103 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Proxy-Authorization: Digest username=“97”, realm=“asterisk”, algorithm=MD5, uri="sip:97@10.1.5.6", nonce=“40a650b6”, response=“aa84fb2266bb9e8c98adaa66cd3e442c”, opaque=""
Date: Fri, 07 Sep 2007 09:37:06 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 263
v=0
o=root 2494 2495 IN IP4 192.168.0.123
s=session
c=IN IP4 192.168.0.123
t=0 0
m=audio 14402 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
— (14 headers 12 lines) —
Using INVITE request as basis request - 57f2109745f7ec44491ed09d2bb8d248@192.168.0.123
Sending to 192.168.0.123 : 5060 (NAT)
Found user '13’
Sep 7 13:12:16 NOTICE[12309]: chan_sip.c:10545 handle_request_invite: Failed to authenticate user “Joe” sip:13@192.168.0.123;tag=as2d7632b3
Reliably Transmitting (NAT) to 192.168.0.123:5060:
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 192.168.0.123:5060;branch=z9hG4bK06732597;received=192.168.0.123;rport=5060
From: “Joe” sip:13@192.168.0.123;tag=as2d7632b3
To: sip:97@10.1.5.6;tag=as452f5a35
Call-ID: 57f2109745f7ec44491ed09d2bb8d248@192.168.0.123
CSeq: 103 INVITE
User-Agent: rysavy.net SIP client
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0
[/code][/code]