asterisk/channels
Michael L. Young 1468246e5c chan_sip: Fix Realtime Peer Update Problem When Un-registering And Expires Header In 200ok
1st Issue
When a realtime peer sends an un-REGISTER request, Asterisk
un-registers the peer but the database table record still has regseconds and
fullcontact for the peer.  This results in calls attempting to be routed to the
peer which is no longer registered.  The expected behavior is to get
busy/congested when attempting to call an un-registered peer through the
dialplan.

What was discovered is that we are clearing out the peer's registration in the
database in parse_register_contact() when calling expire_register() but then
upon returning from parse_register_contact(), update_peer() is run which stores
back in the database table regseconds and fullcontact.

2nd Issue
The reporter pointed out that the 200 ok being returned by Asterisk
after un-registering a peer contains a Contact header with ;expires= and the
Expires header is not set to 0.  This is actually a regression.

Tests were created for this second issue (ASTERISK-22548).  The tests have been
reviewed and a Ship It! was received on those tests.

This patch does the following:

* Do not ignore the Expires header value even when it is set to 0.  The patch
  sets the pvt->expiry earlier on in the function so that it is set properly and
  used.

* If pvt->expiry is 0, do not call update_peer since that means the peer has
  already been un-registered and there is no need to update the database record
  again since nothing has changed.

(closes issue ASTERISK-22428)
Reported by: Ben Smithurst
Tested by: Ben Smithurst, Michael L. Young
Patches:
  asterisk-22428-rt-peer-update-and-expires-header.diff
                                              by Michael L. Young (license 5026)

Review: https://reviewboard.asterisk.org/r/2869/
........

Merged revisions 399794 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 399795 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 399796 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-25 19:29:38 +00:00
..
dahdi A great big renaming patch 2013-07-25 04:06:32 +00:00
h323 Asterisk media architecture conversion - no more format bitfields 2011-02-03 16:22:10 +00:00
iax2 chan_iax2: Add missing control frame names to debug frame decode output. 2013-09-04 23:07:41 +00:00
misdn Allow mISDN to send PROGRESS messsage. 2013-05-10 22:12:52 +00:00
sip chan_sip: Revert r398835 due to failing tests involving originate 2013-09-12 20:27:56 +00:00
Makefile chan_dahdi: Add some missing build cleanup. 2013-08-26 16:15:02 +00:00
chan_alsa.c Don't attempt to create a voice frame on a read error 2013-04-14 02:35:04 +00:00
chan_bridge_media.c Hide the Surrogate channels from external consumers; kill Masquerade events 2013-08-08 14:13:05 +00:00
chan_console.c Doxygen Updates - Title update 2012-10-14 21:47:40 +00:00
chan_dahdi.c Fix uninitialized value in struct ast_control_pvt_cause_code usage. 2013-08-27 16:51:08 +00:00
chan_dahdi.h Some chan_dahdi protected function renaming. 2013-07-23 16:26:36 +00:00
chan_gtalk.c Remove dead code from features.c; refactor pickup code into pickup.c 2013-08-02 02:32:44 +00:00
chan_h323.c Fix chan_h323 compilation 2013-09-06 16:01:05 +00:00
chan_iax2.c chan_iax2: Prevent some needless breaking of the native IAX2 bridge. 2013-09-24 20:37:32 +00:00
chan_jingle.c Refactor RTCP events over to Stasis; associate with channels 2013-07-05 17:33:33 +00:00
chan_mgcp.c Update chan_mgcp to the modified parking API 2013-08-18 03:05:23 +00:00
chan_misdn.c chan_misdn: Fix misdn debug output printed with arbitrary verbose levels. 2013-09-04 16:03:14 +00:00
chan_motif.c Fix uninitialized value in struct ast_control_pvt_cause_code usage. 2013-08-27 16:51:08 +00:00
chan_multicast_rtp.c Refactor RTCP events over to Stasis; associate with channels 2013-07-05 17:33:33 +00:00
chan_nbs.c Opaquification for ast_format structs in struct ast_channel 2012-02-24 00:32:20 +00:00
chan_oss.c Get rid of ast_bridged_channel() and the bridged_channel field on ast_channels. 2013-08-02 14:05:07 +00:00
chan_phone.c Doxygen Updates - Title update 2012-10-14 21:47:40 +00:00
chan_phone.h rename DialTone.h to chan_phone.h because chan_phone.c is the only file using it 2008-05-28 20:00:21 +00:00
chan_pjsip.c Add a missing session supplement unregistration in chan_pjsip for ACKs. 2013-09-20 16:18:42 +00:00
chan_sip.c chan_sip: Fix Realtime Peer Update Problem When Un-registering And Expires Header In 200ok 2013-09-25 19:29:38 +00:00
chan_skinny.c Allow res_parking to be unloadable 2013-08-17 15:01:54 +00:00
chan_unistim.c Strip down the old event system 2013-08-17 14:39:27 +00:00
chan_vpb.cc Remove some dead code dealing with: AST_BRIDGE_REC_CHANNEL_0, AST_BRIDGE_REC_CHANNEL_1, and AST_BRIDGE_IGNORE_SIGS. 2013-08-15 15:12:16 +00:00
console_board.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
console_gui.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
console_video.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
console_video.h implement the 'freeze' function for incoming frames; 2008-06-30 15:45:15 +00:00
misdn_config.c Add named callgroups/pickupgroups 2012-08-07 12:46:36 +00:00
sig_analog.c Fix uninitialized value in struct ast_control_pvt_cause_code usage. 2013-08-27 16:51:08 +00:00
sig_analog.h Convert sig_analog to use a global callback table. 2012-08-08 20:32:53 +00:00
sig_pri.c Fix uninitialized value in struct ast_control_pvt_cause_code usage. 2013-08-27 16:51:08 +00:00
sig_pri.h Strip down the old event system 2013-08-17 14:39:27 +00:00
sig_ss7.c Fix uninitialized value in struct ast_control_pvt_cause_code usage. 2013-08-27 16:51:08 +00:00
sig_ss7.h Convert sig_ss7 to use a global callback table. 2012-08-08 00:15:54 +00:00
vcodecs.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
vgrabbers.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00