Douglas Garstang
2006-Mar-18 12:21 UTC
[Asterisk-Users] Realtime SIP users/peers - Screwed?
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?> -----Original Message----- > From: Douglas Garstang > Sent: Saturday, March 18, 2006 11:55 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [Asterisk-Users] Realtime SIP users/peers > > > Just spent hours dicking around with SIP Realtime. > > Every time a phone came up and sent a registration to > Asterisk, Asterisk would simply NOT query the database. I had > sipusers in extconfig, but added sippeers as well. NOW I can > see Asterisk doing a 'SELECT * FROM sippeers WHERE name = '2944093''. > > Huh??? Uhm, why? It's not a peer! It's a bloody phone, and in > my mind should be a user or a friend! It should be looking in > sippeers! How does it decide which table to use? > > Has anyone made sense of this mess? > > Doug. > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
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@mexuar.com