[Home]

Summary:ASTERISK-10305: "Presence" subscription causes Internal Server Error on Polycom 600 (re-open bug #5164)
Reporter:s0l4rb03 (s0l4rb03)Labels:
Date Opened:2007-09-14 18:49:14Date Closed:2008-02-25 17:19:20.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Subscriptions
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 10727.diff
( 1) 10727-2.diff
( 2) buddywatch_sip_capture.txt
( 3) buddywatch_sip_capture2.txt
Description:From previous issue . . .
0005164: "Presence" subscription causes Internal Server Error on Polycom 600
I'm subscribed to a "buddy" on my Polycom phone. Periodically I'd get this error: 'Incoming call: Got SIP response 500 "Internal Server Error" back from 10.1.1.200'.

Additional Description

We have six(6) Polycom 601 attenendant consoles monitoring roughly forty(40) Polycom 430 phones each for a total of one hundred (100) or so watchers/hints.

To reproduce the behaviour you need only interrupt chan_sip via reload, or an Asterisk restart.  Once this has been done, presence notifications sent to the phones will no longer take place properly.  It is unclear as to whether this problem is due to the Asterisk system not sending the right messages, or the Polycom not responding properly to a properly formatted message.  But, after a while, the phones will start sending messages back in response to messages from Asterisk that say "Internal Server Error".  One thing is for certain.  After the channel is interrupted, by reload or restart, presence no longer works.

****** ADDITIONAL INFORMATION ******

To resolve this issue, STOPGAP/WORKAROUND, we do not interrupt chan_sip.  And, if we do, we send a notify to the phones that are watching to reboot.

If we interrupt chan_sip and do not reboot the phones, the next time we auto-answer page all the phones being watched, the 601 will reboot (Yep, that's right!  It's a feature.), stranding all the phones in a conference reporting a presence of unavailable.  We then have to power-cycle all the watched phones to get them back.

We would be happy to run debug for you all to see if this is an Asterisk problem.  But, you will need to tell us what you need/require.  

Thanks so much for all your hard work!!!

Using Ubuntu 6.06.1.
Polycoms are running SIP 2.1.2.0078
Comments:By: s0l4rb03 (s0l4rb03) 2007-09-18 09:14:44

601 rebooted while someone was on hold and a page was being made.  All members of the page conference were stranded in the conferences.  We were able to kill the conferences and release the members without a reboot of the watched phones.

This is not exclusive behaviour.  The reload and broken watching may contribute to the reboot of the 601 . . . may not.  The resulting state was different than when a reload preceeds the 601 reboot.

The reboot of the 601 seems to be a failover watchdog issue on the Polycom.  We are investigating it as a seperate issue.  Maybe we can cure the reboots.

But, the Internal Server Error is still, at this point, reproducible.

By: callguy (callguy) 2007-09-18 13:43:11

We are seeing similar behavior, though we are not experiencing any reboot issues and we do not see it on reload of chan_sip, but whenever restarting asterisk the 601's will start sending out the same "Internal Server Error" messages.

Rebooting them resolves the issue. Also, it does appear that over time if the status of the watched phones changes, it will slowly sort itself out - but either way the situation isn't ideal.

If someone could let us know what debug data would be needed to help troubleshoot we are happy to test.

By: mlegas (mlegas) 2007-09-25 04:53:13

I can confirm the same issue with Thomson ST2030 SIP phones
Whenever Asterisk is restarted, thomson phones loose their subscriptions. It is needed to restart them to get it working again.
We can monitor that they are sending subscriptions requests every 30 minutes (before their expiration) which are acknowledged by Asterisk but then when they received NOTIFY they answer with Internal Server Error.
After investigation it seems related to the field CSeq in SIP. After a restart CSeq starts over and the thomson phone does not seem to like it.

Snom phones do not have this problem !
so it could be a phone problem in fact.

By: Theo Belder (tbelder) 2007-10-04 09:48:18

In sip.conf, make sure that pedantic=no

By: mlegas (mlegas) 2007-10-10 10:34:42

My running sip configuration show:
Pedantic SIP support:   No

By: mlegas (mlegas) 2007-10-10 10:38:03

the same pb appears with Aastra phones which report the right error:
<--- SIP read from 10.65.0.178:5060 --->
SIP/2.0 500 CSeq Number Out of order
Via: SIP/2.0/UDP
194.50.29.xxxx:5060;branch=z9hG4bK50dbdf8b;rport=5060;received=194.50.29.xxx
From: <sip:4900@194.50.29.xxxx:5060>;tag=as1d319de5
To: Test Aastra <sip:0178164908@194.50.29.xxxx:5060>;tag=8f78e7f670
Call-ID: 00e0780be94b3304
CSeq: 105 NOTIFY
Server: Aastra 55i/2.1.0.2145
Content-Length: 0

By: mlegas (mlegas) 2007-10-29 03:36:53

i discovered that if you put pedantic=yes then it WORKS
When a subcribe is sent from the Aastra phone, Asterisk forces a new SIP dialog by sending Call/Leg Transaction does not exist.
Then the aastra phone sends again a new subscribe which is a new dialog so the notify works

By: Olle Johansson (oej) 2007-11-05 15:32:47.000-0600

Fixed summary of bug report so people can see what it's really about.

By: Olle Johansson (oej) 2007-11-05 15:38:16.000-0600

pedantic=no makes your asterisk sip channel really bad and doesn't help anything. Bad advice.

When you restart or reload asterisk all subscriptions go away. The phones will have to re-subscribe. In some cases, we tell the phones that they have to resubscribe since you changed your dialplan. The next time the phone subscribes, usually within an hour, things start to work properly again.

As always (and required by the bug guidelines) I need to see a SIP debug of this. A single error message doesn't say anything really. Fun to look at, but doesn't help me understanding what's going on.

By: dtyoo (dtyoo) 2007-11-06 17:53:17.000-0600

We also run into this problem quite a bit.  We have a large environment running asterisk 1.4.13 and remote polycom endpoints running sip 2.1.1 and sip 2.1.2.  Any time we restart asterisk all the subscriptions on the server are lost.  Some phones seem to recover from this during re-subscription.  Some phones do not.  I'm still trying to figure out why some phones do not recover.  It seems to be more of a problem on phones which have many subscriptions.

Oej-

In case you want to see a sip capture of the "Internal Server Error" it is attached in a scenario where the phone did recover on re-subscription.  The error is given by the polycom when it gets the notify immediately following the re-subscribe.  I think its getting freaked out by a CSeq id it is not expecting.  Perhaps it would be best if asterisk forced the polycom to subcribe from scratch when it gets a re-subscribe and there is are no existing subscription?  The RFC seems to say that this could be accomplished by setting the Subscription-State to "terminated".  Of course we would have to see if the polycoms do the right thing with this header.

By: Olle Johansson (oej) 2008-01-22 09:54:25.000-0600

Let's focus on a restart. Stopping asterisk and starting. Resetoring the subscriptions should be trivial.

By: Gregory Hinton Nietsky (irroot) 2008-01-22 14:27:13.000-0600

the polycoms do not IMHO like the subscriptions at all please see the work i started (mostly a nasty hack at this point) to allow subscriptions to lists this is meant to work better and the phone should resubscribe after a reset ... according to the RFC

i have stalled on this and most other dev at the moment but i do plan on completing this soon.

prehaps a relationship ??

See ASTERISK-9999

By: Olle Johansson (oej) 2008-01-22 14:36:49.000-0600

Well, we still need to fix bugs :-)

Find me on IRC or mail me to get jabber/msn handles :-)

By: Douglas Gillespie (douglasg) 2008-02-04 09:51:42.000-0600

I too am having this problem with polycoms not re-subscribing after a restart.  Is anyone working on this?

By: Joshua C. Colp (jcolp) 2008-02-04 09:54:36.000-0600

Yes, it is being worked on. It is just not that easy to solve.

By: Joshua C. Colp (jcolp) 2008-02-13 17:59:37.000-0600

I have spent a few hours today looking at possible solutions for this and almost have one completed. Please stay tuned.

By: Joshua C. Colp (jcolp) 2008-02-14 10:22:10.000-0600

Attached is a patch for latest 1.4 from SVN that should fix the issue. It keeps the outgoing CSeq in the astdb so that it is persistent across restarts. It will also perform an audit at startup so old subscriptions do not hang around.

By: callguy (callguy) 2008-02-19 13:43:34.000-0600

file: we've been testing this patch for a couple of days and from what we can see so far it does appear to solve the problem. We are going to do some additional testing tonight to make sure there isn't anything we've missed, but so far so good.

By: Olle Johansson (oej) 2008-02-20 07:35:01.000-0600

file: we need to discuss this. While it looks like it solves the issue, I think it's way too much file I/O to handle for larger servers.

By: Joshua C. Colp (jcolp) 2008-02-20 12:58:38.000-0600

After talking with oej some more the new attached patch 10727-2.diff should have the same end result but not require storing/updating anything in the astdb continually.

By: Digium Subversion (svnbot) 2008-02-25 10:12:40.000-0600

Repository: asterisk
Revision: 104084

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r104084 | file | 2008-02-25 10:12:38 -0600 (Mon, 25 Feb 2008) | 6 lines

If a resubscription comes in for a dialog we no longer know about tell the remote side that the dialog does not exist so they subscribe again using a new dialog.
(closes issue ASTERISK-10305)
Reported by: s0l4rb03
Patches:
     10727-2.diff uploaded by file (license 11)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=104084

By: Digium Subversion (svnbot) 2008-02-25 10:15:09.000-0600

Repository: asterisk
Revision: 104085

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r104085 | file | 2008-02-25 10:15:09 -0600 (Mon, 25 Feb 2008) | 14 lines

Merged revisions 104084 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104084 | file | 2008-02-25 12:16:13 -0400 (Mon, 25 Feb 2008) | 6 lines

If a resubscription comes in for a dialog we no longer know about tell the remote side that the dialog does not exist so they subscribe again using a new dialog.
(closes issue ASTERISK-10305)
Reported by: s0l4rb03
Patches:
     10727-2.diff uploaded by file (license 11)

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=104085

By: Digium Subversion (svnbot) 2008-02-25 13:02:51.000-0600

Repository: asterisk
Revision: 104090

_U  team/seanbright/NoLossCDR-Redux/
U   team/seanbright/NoLossCDR-Redux/channels/chan_agent.c
U   team/seanbright/NoLossCDR-Redux/channels/chan_iax2.c
U   team/seanbright/NoLossCDR-Redux/channels/chan_sip.c
U   team/seanbright/NoLossCDR-Redux/configs/sip.conf.sample
U   team/seanbright/NoLossCDR-Redux/doc/siptls.txt
U   team/seanbright/NoLossCDR-Redux/res/res_config_pgsql.c

------------------------------------------------------------------------
r104090 | seanbright | 2008-02-25 13:02:46 -0600 (Mon, 25 Feb 2008) | 68 lines

Merged revisions 104081,104083,104085,104087-104089 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r104081 | file | 2008-02-25 10:12:48 -0500 (Mon, 25 Feb 2008) | 2 lines

Fix building of trunk. dbpass is always going to exist.

................
r104083 | file | 2008-02-25 10:19:58 -0500 (Mon, 25 Feb 2008) | 14 lines

Merged revisions 104082 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104082 | file | 2008-02-25 11:17:18 -0400 (Mon, 25 Feb 2008) | 6 lines

Due to recent changes tag will no longer be NULL if not present so we have to use ast_strlen_zero to see if it's actually blank.
(closes issue ASTERISK-11502)
Reported by: flefoll
Patches:
     chan_sip.c.br14.patch_pedantic_no_totag uploaded by flefoll (license 244)

........

................
r104085 | file | 2008-02-25 11:18:46 -0500 (Mon, 25 Feb 2008) | 14 lines

Merged revisions 104084 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104084 | file | 2008-02-25 12:16:13 -0400 (Mon, 25 Feb 2008) | 6 lines

If a resubscription comes in for a dialog we no longer know about tell the remote side that the dialog does not exist so they subscribe again using a new dialog.
(closes issue ASTERISK-10305)
Reported by: s0l4rb03
Patches:
     10727-2.diff uploaded by file (license 11)

........

................
r104087 | russell | 2008-02-25 13:38:51 -0500 (Mon, 25 Feb 2008) | 12 lines

Merged revisions 104086 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104086 | russell | 2008-02-25 12:38:10 -0600 (Mon, 25 Feb 2008) | 4 lines

Ensure that the channel doesn't disappear in agent_logoff().  If it does, it
could cause a crash.
(fixes the crash reported in BE-396)

........

................
r104088 | bbryant | 2008-02-25 14:00:16 -0500 (Mon, 25 Feb 2008) | 1 line

Adding more tls configuration details to sip.conf sample, with a list of valid ciphers provided in both files. .. First commit since July, woot
................
r104089 | file | 2008-02-25 14:02:33 -0500 (Mon, 25 Feb 2008) | 2 lines

Instead of outputting a verbose message every so often let's make it a debug message.

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=104090

By: Digium Subversion (svnbot) 2008-02-25 17:19:20.000-0600

Repository: asterisk
Revision: 104105

_U  team/murf/bug11210/
U   team/murf/bug11210/apps/app_voicemail.c
U   team/murf/bug11210/channels/chan_agent.c
U   team/murf/bug11210/channels/chan_iax2.c
U   team/murf/bug11210/channels/chan_sip.c
U   team/murf/bug11210/configs/sip.conf.sample
U   team/murf/bug11210/doc/siptls.txt
U   team/murf/bug11210/funcs/func_global.c
U   team/murf/bug11210/main/config.c

------------------------------------------------------------------------
r104105 | murf | 2008-02-25 17:19:19 -0600 (Mon, 25 Feb 2008) | 133 lines

Merged revisions 104081,104083,104085,104087-104089,104093,104096-104098 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r104081 | file | 2008-02-25 08:12:48 -0700 (Mon, 25 Feb 2008) | 2 lines

Fix building of trunk. dbpass is always going to exist.

................
r104083 | file | 2008-02-25 08:19:58 -0700 (Mon, 25 Feb 2008) | 14 lines

Merged revisions 104082 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104082 | file | 2008-02-25 11:17:18 -0400 (Mon, 25 Feb 2008) | 6 lines

Due to recent changes tag will no longer be NULL if not present so we have to use ast_strlen_zero to see if it's actually blank.
(closes issue ASTERISK-11502)
Reported by: flefoll
Patches:
     chan_sip.c.br14.patch_pedantic_no_totag uploaded by flefoll (license 244)

........

................
r104085 | file | 2008-02-25 09:18:46 -0700 (Mon, 25 Feb 2008) | 14 lines

Merged revisions 104084 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104084 | file | 2008-02-25 12:16:13 -0400 (Mon, 25 Feb 2008) | 6 lines

If a resubscription comes in for a dialog we no longer know about tell the remote side that the dialog does not exist so they subscribe again using a new dialog.
(closes issue ASTERISK-10305)
Reported by: s0l4rb03
Patches:
     10727-2.diff uploaded by file (license 11)

........

................
r104087 | russell | 2008-02-25 11:38:51 -0700 (Mon, 25 Feb 2008) | 12 lines

Merged revisions 104086 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104086 | russell | 2008-02-25 12:38:10 -0600 (Mon, 25 Feb 2008) | 4 lines

Ensure that the channel doesn't disappear in agent_logoff().  If it does, it
could cause a crash.
(fixes the crash reported in BE-396)

........

................
r104088 | bbryant | 2008-02-25 12:00:16 -0700 (Mon, 25 Feb 2008) | 1 line

Adding more tls configuration details to sip.conf sample, with a list of valid ciphers provided in both files. .. First commit since July, woot
................
r104089 | file | 2008-02-25 12:02:33 -0700 (Mon, 25 Feb 2008) | 2 lines

Instead of outputting a verbose message every so often let's make it a debug message.

................
r104093 | qwell | 2008-02-25 13:50:57 -0700 (Mon, 25 Feb 2008) | 19 lines

Merged revisions 104092 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104092 | qwell | 2008-02-25 14:49:42 -0600 (Mon, 25 Feb 2008) | 11 lines

Allow the use of #include and #exec in situations where the max include depth was only 1.
Specifically, this fixes using #include and #exec in extconfig.conf.

This was basically caused because the config file itself raises the include level to 1.

I opted not to raise the include limit, because recursion here could cause very bizarre behavior.

Pointed out, and tested by jmls

(closes issue ASTERISK-11505)

........

................
r104096 | file | 2008-02-25 14:40:30 -0700 (Mon, 25 Feb 2008) | 14 lines

Merged revisions 104095 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104095 | file | 2008-02-25 17:37:20 -0400 (Mon, 25 Feb 2008) | 6 lines

Make it so a users.conf user creates both a SIP peer and a SIP user. The user will be used for inbound authentication for the device, and peer will be used for placing calls to the device.
(closes issue ASTERISK-8785)
Reported by: queuetue
Patches:
     sip-gui-friend.diff uploaded by qwell (license 4)

........

................
r104097 | tilghman | 2008-02-25 14:53:36 -0700 (Mon, 25 Feb 2008) | 13 lines

Merged revisions 104094 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104094 | tilghman | 2008-02-25 15:31:47 -0600 (Mon, 25 Feb 2008) | 5 lines

If the destination folder is full, don't delete a message when exiting.
(closes issue ASTERISK-11506)
Reported by: selsky
Patch by: (myself)

........

................
r104098 | tilghman | 2008-02-25 14:56:19 -0700 (Mon, 25 Feb 2008) | 7 lines

Shared space for variables (instead of letting other channels muck with your own)
(closes issue ASTERISK-11392)
Reported by: ramonpeek
Patches:
      20080208__bug11943__2.diff.txt uploaded by Corydon76 (license 14)
Tested by: jmls

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=104105