[Home]

Summary:ASTERISK-12168: Wrong peer selected when more than one to same host
Reporter:Mark Hulber (hulber)Labels:
Date Opened:2008-06-10 08:57:39Date Closed:2011-06-07 14:07:55
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I have multiple SIP registrations to the same provider with different user id's and likewise have two peer definitions in sip.conf.  When a call comes in the last defined peer channel is used to handle the call.  I have confirmed that both peer definitions are necessary by removing one and trying to make an inbound call to a number that uses this id and the call does not go through, so the provider is using the correct authentication for the inbound number.

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

Sip.conf
--------

register => user1:pass1@sip.jnctn.net/jnctn
register => user2:pass2@sip.jnctn.net/jnctn-user2

[jnctn-user2]
type=peer
context=junction-in
fromdomain=jnctn.net
host=sip.jnctn.net
username=user2
secret=pass2
qualify=yes
nat=no
insecure=invite

[jnctn]
type=peer
context=junction-in
fromdomain=jnctn.net
host=sip.jnctn.net
username=user1
secret=pass1
qualify=yes
nat=no
insecure=invite


-----------

The call appears to always be carried on the channel associated with the last defined context.  If I switch the order of their definition the last is still picked:

   -- Executing [number2@junction-in:1] Macro("SIP/user1-ac04dcc0", "setstamp|number2|junction-in1") in new stack
   -- Executing [s@macro-setstamp:1] Set("SIP/user1-ac04dcc0", "CDR(accountcode)=number2") in new stack
   -- Executing [s@macro-setstamp:2] NoOp("SIP/user1-ac04dcc0", "junction-in1| | ") in new stack

in the trace above, number2 is associated with the context user2 so the reported channel should be sip/user2.  If I make an inbound call to number1, associated with user1 it will also be reported on SIP/user1.  If I switch the definition of these two peers in sip.conf then they will all be reported on SIP/user2.  If I remove one of them and make an inbound call, then calls for the peer that has been removed will fail as expected.
Comments:By: Russell Bryant (russell) 2008-06-10 09:01:13

This is a configuration issue