[asterisk-bugs] [Asterisk 0016061]: [patch] Peer mismatch in incomming call [PATCH]

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Oct 14 15:55:58 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16061 
====================================================================== 
Reported By:                dveiga
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16061
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 223801 
Request Review:              
====================================================================== 
Date Submitted:             2009-10-12 18:08 CDT
Last Modified:              2009-10-14 15:55 CDT
====================================================================== 
Summary:                    [patch] Peer mismatch in incomming call [PATCH]
Description: 
    I'm using the latest 1.4 svn version as a voip gateway connected to a
PBX. As such I have as many DAHDI channels as SIP peers and link them on a
one to one basis. When commertial gateways (say Grandstream 4024) register
to a PBX, they use different local SIP ports for each channel. In this way,
when the PBX places a SIP invite to offer a call using a certain port, ther
is no doubt which SIP peer the call is for.
    Asterisk cannot use different ports, so upon receiving an invite, it
has to determine which peer it is for. The default behaviour is to
determine the peer based on the IP address (after trying to find a user,
that is not applicable here), but when there are multiple subscriptions to
the same IP this is not enough.
    The current patch analyzes the sip headers to determine the peer name
and then finds the peer based on both: IP an NAME. For compatibility
reasons, if a peer matching both is not found, it falls back to the
previous method (finding one just using the IP address).
====================================================================== 

---------------------------------------------------------------------- 
 (0112300) dveiga (reporter) - 2009-10-14 15:55
 https://issues.asterisk.org/view.php?id=16061#c112300 
---------------------------------------------------------------------- 
Sory I have to change the initial scenario, but I have to move off
production environment. My new PBX has IP 172.16.3.16, and has 4 sip
accounts numbered 991-994. The first one is a standalone phone, the other 3
are SIP accounts of my new gateway. This gateway has 3 DAHDI ports linked
on a one to one basis to the 3 sip accounts using the dialplan. It has IP
172.16.5.117.

Config is as follows:

sip.conf

register => 992:Password1 at 172.16.3.16/992
register => 993:Password2 at 172.16.3.16/993
register => 994:Password3 at 172.16.3.16/994

[992]
type=peer
username=992
fromuser=992
fromdomain=172.16.3.16
secret=Password1
host=172.16.3.16
context=from-pbx
insecure=very

[993]
type=peer
username=993
fromuser=993
fromdomain=172.16.3.16
secret=Password2
host=172.16.3.16
context=from-pbx
insecure=very

[994]
type=peer
username=994
fromuser=994
fromdomain=172.16.3.16
secret=Password3
host=172.16.3.16
context=from-pbx
insecure=very


I'm uploading a RTF file named sip-debug.rtf with a screen capture of the
console under the following circumstances:

1) Removed my patch
2) Added insecure=very (as can be seen above)
3) Executed "sip set debug peer 992" 
4) Called from 991 (outside the gateway) to extension 992 (in the
gateway)

I highlighed in red two lines: The first one reflects the incorrect
assumption on the peer (It says 'Found peer 994', when the call only
involves 991 and 992). The second the result of 'core show channels' when
the phone is ringing, that shows the channel was created assuming an
incomming call from peer 994.

Bye,


                                 Daniel 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-10-14 15:55 dveiga         Note Added: 0112300                          
======================================================================




More information about the asterisk-bugs mailing list