Summary:ASTERISK-16022: [patch] Multiple SIP NOTIFY packets sent with LDAP realtime peers
Reporter:Sean Brady (sbrady_gtfservices)Labels:
Date Opened:2010-04-27 16:48:33Date Closed:2010-06-22 13:14:53
Versions:Frequency of
Environment:Attachments:( 0) Asterisk_CLI_output_
( 1) chan_sip.c.rej
( 2) extensions.conf
( 3) issue16320.patch
( 4) SIPPEER_Station999
( 5) troubleshooting.1
Description:Multiple SIP NOTIFY packets are sent when a peer configured using the LDAP realtime driver is used and the peer checks or receives a voicemail.  Tested on 2 different systems with Polycom 301's, 501's, 430's, Ekiga and X-Lite softphones. I do not see this issue with peers configured via sip.conf, and have not been able to test any other realtime drivers.    


I see this issue in and  I am using Fedora Directory Services with the schema provided with Asterisk, modified only to work with FDS.

I have also noticed that after checking or leaving a voicemail, the SIP peer will show the same mailbox more than once.  

This was marked as major due to the fact that the volume of NOTIFY packets can crash a Polycom UA.
Comments:By: Sean Brady (sbrady_gtfservices) 2010-04-27 16:53:00

Attached 3 files:
troubleshooting.1: complete logging with SIP debug enabled showing the replication of the issue.
Asterisk CLI output: a copy and paste of "sip show peer X" displaying the multiple mailboxes
Extensions.conf: a stripped down extensions.conf used to replicate this issue.

Please let me know if you need anything else.

By: Sean Brady (sbrady_gtfservices) 2010-04-27 16:55:44

For some reason I can't add the OS, sorry about that...

System 1: Centos 5.4 x86_64
System 2: RHEL 5.5 x86_64

Both systems have been updated fully using yum within the last 3 days.

By: Paul Belanger (pabelanger) 2010-04-27 17:07:26

This looks odd (from CLI output):
Mailbox      : 9999@saa,9999@saa,9999@saa

By: Paul Belanger (pabelanger) 2010-04-27 17:09:12

Severity downgraded (represents affected users).

By: Paul Belanger (pabelanger) 2010-04-27 17:16:49

Looking at the debug log it seems res_config_ldap is parsing the mailbox attribute multiple times.  Can you post your ldap schema for this extension.

By: Sean Brady (sbrady_gtfservices) 2010-04-27 17:25:13

SIP peer's schema is attached.

I thought that the mailbox showing multiple times and the NOTIFY messages are related somehow. As you can see on load, the mailbox is showing once, which is how it's configured. Once you check the voicemail, or the peer receives a voicemail, it will show 3 times. Checking or receiving voicemail again will make it show 5 times, etc etc.

By: Paul Belanger (pabelanger) 2010-04-27 18:41:25

I'll wait for a developer to confirm, but it looks like the the multiple parsing of res_config_ldap might the issue.

By: Leif Madsen (lmadsen) 2010-04-28 11:53:09

According to Marquis42 on IRC, this may not actually be related to LDAP specifically. See issue ASTERISK-15212 which I've marked as related and has a patch attached to it. Perhaps that would resolve the issue.

By: Sean Brady (sbrady_gtfservices) 2010-04-28 12:49:05

The patch doesn't seem to apply correctly to, and the behavior persists. I get the following when applying the patch (chan_sip.c.rej is attached)

patching file channels/chan_sip.c
Hunk #1 succeeded at 2513 (offset 341 lines).
Hunk #2 succeeded at 4394 (offset 45 lines).
Hunk #3 succeeded at 4810 (offset 341 lines).
Hunk #4 succeeded at 4525 (offset 45 lines).
Hunk ASTERISK-1 FAILED at 4655.
1 out of 5 hunks FAILED -- saving rejects to file channels/chan_sip.c.rej

I also get an error on make:

chan_sip.c: In function ‘find_peer’:
chan_sip.c:4987: error: too few arguments to function ‘realtime_peer’
make[1]: *** [chan_sip.o] Error 1
make: *** [channels] Error 2

By: Paul Belanger (pabelanger) 2010-04-28 14:00:21

Here is the same patch against 1.6.2 branch.

By: Sean Brady (sbrady_gtfservices) 2010-04-28 14:45:30

The patch compiled clean against and fixed all the issues. I believe that this is resolved.  Are we looking at a merge of this prior to the release of

By: Leif Madsen (lmadsen) 2010-04-28 15:10:13

This will be part of -- has already been branched for release candidate status, which means only blockers are merged in. This will be available for presuming it is merged prior to that tag being created.

By: Leif Madsen (lmadsen) 2010-04-28 15:11:59

Marking as Resolved as this is fixed by ASTERISK-15212