[asterisk-dev] [Code Review] SIP: peer matching by callbackextension

Olle E. Johansson oej at edvina.net
Fri Aug 28 00:56:25 CDT 2009


28 aug 2009 kl. 00.54 skrev David Vossel:

> If there are a number of peers with different callbackextension  
> parameters and the same host address.  The first peer found matching  
> the address is used regardless if that peer's callbackextension  
> matches the incoming extension or not.
>
> Now, to better match peers with incoming calls, if an incoming  
> call's address can match multiple peers by address, we check each of  
> those peer's callbackextension against the incoming extension for  
> the best possible match.
>
> It is possible that my implementation may be too expensive and only  
> serve to address a minor edge case in the usage of chan_sip.  I do  
> not fully understand the impact my changes may have upon performance  
> when a large number of peers are present.  This patch assumes the  
> new parse_uri() change has been made.


I think we have to solve this differently. When we register, we don't  
register the extension as a contact, we generate a unique random  
string. When the call comes back, the random string will be the  
request URI and we can match on that. I actually have code for that  
somewhere.

What messes that up is that you know frequently have registrations for  
SIP trunks where you won't get the contact back in the request URI,  
which messes things up.

I think we have to write a document about required changes to handle  
all these situations before we start coding, and agree on what needs  
to be done. This requires further thought. While this patch is a hack  
that tries to attack a well-known issue, like my old code, I do think  
we have to think a bit more before we start messing with the peer/user  
matching again. I have a proposal out there, and I'm sure that many  
people have opinions.

I suggest we keep this code, but put it on hold until we have decided  
what to do. Yet another hack in the already messy device matching  
algorithm doesn't help and the callbackextension hack is ugly enough  
as it is.

/O



More information about the asterisk-dev mailing list