[Home]

Summary:ASTERISK-05286: chan_sip doesn't correctly identify peer's name on incoming calls and does not use the options defined in its section in sip.con
Reporter:lancey (lancey)Labels:
Date Opened:2005-10-12 12:11:29Date Closed:2011-06-07 14:03:10
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Interoperability
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:When receiving a SIP call, * should locate it's section in sip.conf and use the options specified in there. But sometimes it doesn't, look at the additional info for some output.

****** ADDITIONAL INFORMATION ******

==== sip.conf : ======
[general]
port = 5060                     ; Port to bind to
bindaddr = 0.0.0.0              ; Address to bind to
context = nonexistent           ; Default for incoming calls
disallow=all
allow=alaw

[the-sip-peer]
type = friend
host = 123.124.125.126
context = incoming-calls
disallow = all
allow = g729
canreinvite = no
dtmfmode = rfc2833

==== extensions.conf : =====
[general]
static=yes
writeprotect=no

[nonexistent]

[incoming-calls]
exten => 01234, 1, Dial(IAX2/911)


I'm making a call from 088899999 which gets to the sip peer, which contacts my * box:

==== asterisk log: ====
Oct 12 20:02:53 NOTICE[35601]: pbx.c:1746 pbx_extension_helper: Cannot find extension context 'nonexistent'

==== SIP debug included: ====
CLI> sip debug peer the-sip-peer
SIP Debugging Enabled for IP: 123.124.125.126:5060
CLI>
Sending to 123.124.125.126 : 5060 (non-NAT)
Found RTP audio format 18
Found RTP audio format 4
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Peer audio RTP is at port 123.124.125.126:19352
Found description format G729
Found description format G723
Found description format PCMU
Found description format PCMA
Found description format telephone-event
Capabilities: us - 0x408 (alaw|ilbc), peer - audio=0x10d (g723|ulaw|alaw|g729)/video=0x0 (nothing), combined - 0x8 (alaw)
Non-codec capabilities: us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Looking for 01234 in nonexistent (domain the.*.box.ip)
Oct 12 20:03:36 NOTICE[35601]: pbx.c:1746 pbx_extension_helper: Cannot find extension context 'nonexistent'
RDNIS is 0
Reliably Transmitting (no NAT) to 123.124.125.126:5060:
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP  123.124.125.126:5060;x-route-tag="tgrp:tml";received=123.124.125.126
From: <sip:088899999@123.124.125.126>;tag=97286B74-181D
To: <sip:01234@213.137.48.3>;tag=as03be09f6
Call-ID: F68441FA-3A7811DA-ADCEED4E-5C5401D6@123.124.125.126
CSeq: 101 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:01234@the.*.box.ip>
Content-Length: 0


---
Destroying call 'F68441FA-3A7811DA-ADCEED4E-5C5401D6@123.124.125.126'
Comments:By: Joshua C. Colp (jcolp) 2005-10-12 12:48:18

The way chan_sip identifies a user entry is that it looks at the From header, specifically the user portion of the URI. If that user portion matches a user entry, it'll challenge for credentials. This is why RPID is a good thing because before CallerID number was taken from the same place.

For peers you need to have insecure=very so that Asterisk will grab a peer entry based on the IP... if that's what you're trying to do.

That's the way it works. There's no real other way to know for the user without challenging for credentials all the time which wouldn't allow you to have guests.

Kinda a configuration issue on your end... yeah

By: lancey (lancey) 2005-10-12 13:03:55

here's the deal with another peer:

==== sip.conf : ======
[general]
port = 5060                     ; Port to bind to
bindaddr = 0.0.0.0              ; Address to bind to
context = nonexistent           ; Default for incoming calls
disallow=all
allow=alaw

... snip ....

[another-sip-peer]
type = friend
host = 123.124.125.126
context = incoming-calls
disallow = all
allow = g729
canreinvite = no
dtmfmode = rfc2833

==== asterisk output =====
Sending to 123.124.125.126 : 5060 (non-NAT)
Found peer 'another-sip-peer'
Found RTP audio format 18
Found RTP audio format 4
Found RTP audio format 8
Found RTP audio format 101
Peer audio RTP is at port 123.124.125.126:19120
Found description format G729
Found description format G723
Found description format PCMA
Found description format telephone-event
Capabilities: us - 0x100 (g729), peer - audio=0x109 (g723|alaw|g729)/video=0x0 (nothing), combined - 0x100 (g729)
Non-codec capabilities: us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Looking for 088899999 in incoming-calls (domain the.*.box.ip)
list_route: hop: <sip:442074800000@123.124.125.126;user=phone>
Transmitting (no NAT) to 123.124.125.126:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 123.124.125.126:5060;received=123.124.125.126
From: <sip:442074800000@123.124.125.126;user=phone>;tag=3e083200054f4d10ff000011ffff7aff
To: <sip:088899999@the.*.box.ip:5060;user=phone>
Call-ID: cc063200054f4d1080000011d8e07ad2@voip-gw-bg
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:088899999@the.*.box.ip>
Content-Length: 0



By: lancey (lancey) 2005-10-12 13:54:27

Adding 'insecure=very' to the section of each sip peer not being identified, as joshnet suggested, seems to be a workaround for this problem.