[Asterisk-Users] Realtime SIP users/peers - Screwed?

Tim Panton tim at mexuar.com
Sat Mar 18 15:15:07 MST 2006


On 18 Mar 2006, at 19:21, Douglas Garstang wrote:

> Oh heck. It really looks like realtime has been seriously screwed up.
>
> When a call comes in to Asterisk, I can see asterisk executing  
> these queries.
> SELECT * FROM ast_sip_peers WHERE host = '2XX.YYY.142.205'
> SELECT * FROM ast_sip_peers WHERE name = '2944093'
> SELECT * FROM ast_sip_peers WHERE name = '2944093'
>
> So, the first thing it does is check and see if there are any  
> records in sip_peers where the IP address of the message matches.  
> What happens if this user may make calls from multiple IP  
> addresses? Will I need one entry for each IP address that calls may  
> come from? Will this even work? Would I be so frustrated if this  
> stuff was documented somewhere?
>

 From the wiki:
-------------------
Asterisk matches incoming calls to the name of a device with  
type=user based on the From: user name (ignoring the SIP domain). The  
other way that incoming SIP requests are matched to [xxx] sections in  
this file, is to examine the IP address that the request is coming  
from, and look for a peer [xxx] section that has a matching Host=  
value. If Host=dynamic, then no match is possible until the SIP  
client has registered.
------------ and ---------
When Asterisk receives an incoming SIP call, the SIP Channel Module
first tries to find a [user] section matching the caller name (From:  
username),
then tries to find a [peer] section matching the caller's IP address.
If no matching user or peer is found, the call is sent to the context  
defined in the [general] section of sip.conf.
----------
(I know that doesn't entirely explain the behavior but it is a  
start....)

I'm guessing that the sql query immediately before your extract was a  
name search that came up
with nothing....



Tim Panton
tim at mexuar.com






More information about the asterisk-users mailing list