Summary:ASTERISK-04794: [patch] [post 1.2] peer or user match priority option
Reporter:Joe Antkowiak (antkojm1)Labels:
Date Opened:2005-08-08 00:35:25Date Closed:2011-06-07 14:02:51
Versions:Frequency of
Environment:Attachments:( 0) matchpriority.diff.txt
Description:We paid a bounty to have this feature added, and figured it might be useful to more people than just us.  We needed it because we required sip invites to be matched to a peer (by its ip address) and not to a user, on invites from the peer's ip address.
Comments:By: Mark Spencer (markster) 2005-08-08 02:35:03

So I've got to ask, why did you need to use"users" at all?

By: Joe Antkowiak (antkojm1) 2005-08-08 07:23:05

Here is the setup we needed this for.  We have many remote sites that have grandstream ata's and pots lines.  for all of these ata's, the username is the phone number, which also happens to be the phone number of the pots lines.  When the internet goes down, the ata's fail over to the pots line for outbound calling, and sometimes they call back in to our dids.  When that happens, the cisco gateways set the from field to <phone number>@<gwhostname>, but this winds up matching the user <phone number> instead of the peer <gwhostname> and the call is rejected because of failed authentication.

By: Olle Johansson (oej) 2005-08-12 02:05:05

I don't see this as a generic addition, more specific to your setup.

We're planning to change the whole user/peer concept in the future, so user's will likely disappear. This patch does not fix the problem with users and peers, I think it adds to the confusion if applied on a generic scale. The whole matching process will have to change.

By: Sergey Basmanov (sb) 2005-08-15 07:01:06

This happens when we have local user with same username as received in From: field on incoming call. Simple case: two * boxes connected via SIP and local users on both boxes have same numbers. There only two ways: set callerid on outgoing call or use 'fromuser' option in sip.conf
In second case we can't see who is really calling.

By: Olle Johansson (oej) 2005-08-15 07:05:52

...or let's fix it by fixing the SIP domains so that info@edvina.net is not the same as info@digium.com :-)

By: Michael Jerris (mikej) 2005-08-28 10:16:04

oej- does the sip domain patch supercede this?

By: Michael Jerris (mikej) 2005-12-01 13:42:56.000-0600

oej, can you please verify if the sip domain functionality will supercede this or not?

By: Olle Johansson (oej) 2006-01-05 12:05:44.000-0600

I can't recommend this patch for CVS at all. It's very user specific and duplicates a lot of code. Will keep it in archives if someone needs it. The long term solution is to remove the user and only have peers, as well as change the matching mechanism.