[Home]

Summary:ASTERISK-13599: [patch] SIP Realtime not reading database for changes to realtime peers after initial registration
Reporter:agjohnson (agjohnson)Labels:
Date Opened:2009-10-21 21:14:55Date Closed:2011-07-27 13:34:28
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 16112_v1.diff
( 1) create_table.sql
( 2) sip_peers.html
( 3) SQL_Structure_that_worked_for_me.txt
Description:After a realtime sip peer has registered, changes to the sip_peers table for the related peer will never be picked up by Asterisk.  In my test I changed the context from from-test to from-softphone.  The change was not picked up until after restarting asterisk.

Sip.conf has rtcachefriends=no set.

SELECT * FROM sip_peers WHERE name = 'ajohnson'
5797, 'ajohnson', 'dynamic', 'no', 'friend', '', '', , '', '8448', 'yes', 'yes', 'from-test', '', '', '', '', '', '', '', '', '', '', '', '', '', 'no', '', '', '', '', '97983', '', 'all', 'all', '', '10.210.20.192', 5060, 'pbx2', 1256176828, 'ajohnson', '', 0, 'SJphone/1.65.377a (SJ Labs)'



   -- Registered SIP 'ajohnson' at 10.210.20.192 port 5060
 == Using SIP RTP CoS mark 5
   -- Executing [6027414660@from-test:1] Dial("SIP/ajohnson-b757d498", "SIP/sbc/6027414660)") in new stack
 == Using SIP RTP CoS mark 5
   -- Called sbc/6027414660)
 == Spawn extension (from-test, 6027414660, 1) exited non-zero on 'SIP/ajohnson-b757d498'


 == Using SIP RTP CoS mark 5
   -- Executing [6027414660@from-test:1] Dial("SIP/ajohnson-b7589b98", "SIP/sbc/6027414660)") in new stack
 == Using SIP RTP CoS mark 5
   -- Called sbc/6027414660)
 == Spawn extension (from-test, 6027414660, 1) exited non-zero on 'SIP/ajohnson-b7589b98'



SELECT * FROM sip_peers WHERE name = 'ajohnson'
5797, 'ajohnson', 'dynamic', 'no', 'friend', '', '', , '', '8448', 'yes', 'yes', 'from-softphone', '', '', '', '', '', '', '', '', '', '', '', '', '', 'no', '', '', '', '', '97983', '', 'all', 'all', '', '10.210.20.192', 5060, 'pbx2', 1256176828, 'ajohnson', '', 0, 'SJphone/1.65.377a (SJ Labs)'



pbx2*CLI> sip reload
Reloading SIP
 == Parsing '/etc/asterisk/sip.conf':   == Found
 == Parsing '/etc/asterisk/sipaccounts.conf':   == Found
 == Parsing '/etc/asterisk/users.conf':   == Found
 == Parsing '/etc/asterisk/sip_notify.conf':   == Found
 == Using SIP RTP CoS mark 5
   -- Executing [6027414660@from-test:1] Dial("SIP/ajohnson-b7589098", "SIP/sbc/6027414660)") in new stack
 == Using SIP RTP CoS mark 5
   -- Called sbc/6027414660)
 == Spawn extension (from-test, 6027414660, 1) exited non-zero on 'SIP/ajohnson-b7589098'



pbx2*CLI> sip prune realtime
peer  all
pbx2*CLI> sip prune realtime all
No peers found to prune.
 == Using SIP RTP CoS mark 5
   -- Executing [6027414660@from-test:1] Dial("SIP/ajohnson-b758da30", "SIP/sbc/6027414660)") in new stack
 == Using SIP RTP CoS mark 5
   -- Called sbc/6027414660)
 == Spawn extension (from-test, 6027414660, 1) exited non-zero on 'SIP/ajohnson-b758da30'



pbx2*CLI> module reload chan_sip.so
   -- Reloading module 'chan_sip.so' (Session Initiation Protocol (SIP))
Reloading SIP
 == Parsing '/etc/asterisk/sip.conf':   == Found
 == Parsing '/etc/asterisk/sipaccounts.conf':   == Found
 == Parsing '/etc/asterisk/users.conf':   == Found
 == Parsing '/etc/asterisk/sip_notify.conf':   == Found
 == Using SIP RTP CoS mark 5
   -- Executing [6027414660@from-test:1] Dial("SIP/ajohnson-b780f5c0", "SIP/sbc/6027414660)") in new stack
 == Using SIP RTP CoS mark 5
   -- Called sbc/6027414660)
 == Spawn extension (from-test, 6027414660, 1) exited non-zero on 'SIP/ajohnson-b780f5c0'



pbx2*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status     Realtime
corppbx                    10.210.10.76                5060     OK (1 ms)
inbound/inbound            (Unspecified)    D          5060     UNKNOWN
outbound/outbound          (Unspecified)    D          5060     UNKNOWN
pvpbx                      10.208.8.25                 5060     OK (1 ms)
pvutil                     10.200.10.51                5060     OK (1 ms)
sbc                        10.230.10.90                5060     OK (1 ms)
6 sip peers [Monitored: 4 online, 2 offline Unmonitored: 0 online, 0 offline]
pbx2*CLI>

Comments:By: agjohnson (agjohnson) 2009-10-21 21:15:17

I will test against 1.6.0.15 tomorrow.

By: agjohnson (agjohnson) 2009-10-22 09:43:22

Problem does not show up in Asterisk 1.6.0.15

By: agjohnson (agjohnson) 2009-10-22 11:06:38

Attached patch corrects the issue.

By: Elazar Broad (ebroad) 2009-10-30 11:02:25

Per my discussion with file and kpfleming on #asterisk-dev, this patch possibly goes about it all wrong, it short circuits the search for the peer in the ao2 container, which would break rtcachefriends among other things.

With that said, I am unable to reproduce this under 1.6.2.0-rc3 and a recent revision of SVN trunk. In speaking with the reporter, he is working with a clustered environment, in which I do not have the necessary resources to replicate. Maybe someone else out there with a similar environment could test this out and report back, it would be much appreciated. TIA!



By: Jeff Peeler (jpeeler) 2009-11-03 17:57:36.000-0600

I haven't been able to reproduce this either. Does it ever occur on a single host?

By: agjohnson (agjohnson) 2009-11-04 14:50:30.000-0600

It occurs on all of my servers, even when there was only one.

By: Elazar Broad (ebroad) 2009-11-05 11:23:02.000-0600

Can you post the SQL statement(s) that you used to create the table? Thanks!

By: Jeff Peeler (jpeeler) 2009-11-05 13:17:39.000-0600

Unassigning from myself as this won't get looked at for at least a few weeks.

By: agjohnson (agjohnson) 2009-11-10 11:40:17.000-0600

I uploaded details on the format of the table.

By: agjohnson (agjohnson) 2009-11-11 14:48:43.000-0600

The newly uploaded create statement does not experience the error.  The breakage appears to be related to either my table structure or the name of the table.

By: Leif Madsen (lmadsen) 2009-11-11 14:50:49.000-0600

Dropping this status down to Major after a discussion on IRC that ajohnson may have found a way of working around this as the issue has presented itself because of table naming structures.

Perhaps he will elaborate here in case the information is useful to a developer.

By: Andrew Parisio (parisioa) 2010-08-30 15:43:56

I had the same problem because i was missing the mask field in my table definition.  I set mask to 0.0.0.0/0.0.0.0 and now my peer is able to register.  

Can somebody explain what exactly mask is supposed to be/do?  I've set permit/deny like i had in sip.conf with deny=0.0.0.0/0.0.0.0 and permit to 192.168.0.0/255.255.0.0 and that seems to work.  It follows these settings as well, with mask set to 0.0.0.0.  It appears as though mask doesn't actually do anything at all.

By: Leif Madsen (lmadsen) 2010-09-07 15:27:44

The issue tracker is not a good place for discussions, so I'd suggest you ask your question on the asterisk-users mailing list.

Thanks!

By: Andrew Parisio (parisioa) 2010-09-07 15:32:25

Sorry.  Just to clarify by adding the mask field and putting something in it this bug goes away.  I've uploaded my structure that worked: SQL Structure that worked for me.txt

By: Russell Bryant (russell) 2011-07-27 13:34:20.567-0500

Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.4 and 1.6.x branches has ended. For continued maintenance support please move to the 1.8 branch which is a long term support (LTS) branch. For more information about branch support, please see https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions

If this is still an issue, please open a new issue so it can be re-triaged appropriately. Thanks!