[asterisk-commits] mjordan: branch 11 r410106 - in /branches/11: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Mar 6 22:38:50 CST 2014
Author: mjordan
Date: Thu Mar 6 22:38:47 2014
New Revision: 410106
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410106
Log:
chan_sip: Allow static realtime members to be qualified during module load.
When a static realtime peer with qualify=yes is loaded, Asterisk will fail to
send an OPTIONS request due to the lastms being equal to 0. This results in
the peer being unable to receive calls from Asterisk because the status is
permanently UNKNOWN.
This patch allows an OPTIONS request to be sent during module load by
ignoring the lastms value on startup only.
Review: https://reviewboard.asterisk.org/r/3294/
(closes issue ASTERISK-17523)
Reported by: Maciej Krajewski
Tested by: wushumasters
patches:
realtime_fix_11.7.0.txt uploaded by Trevor Peirce (license 6112)
........
Merged revisions 410105 from http://svn.asterisk.org/svn/asterisk/branches/1.8
Modified:
branches/11/ (props changed)
branches/11/channels/chan_sip.c
Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_sip.c?view=diff&rev=410106&r1=410105&r2=410106
==============================================================================
--- branches/11/channels/chan_sip.c (original)
+++ branches/11/channels/chan_sip.c Thu Mar 6 22:38:47 2014
@@ -31193,21 +31193,26 @@
peer->socket.port = htons(((peer->socket.type & SIP_TRANSPORT_TLS) ? STANDARD_TLS_PORT : STANDARD_SIP_PORT));
}
- if (!sip_cfg.ignore_regexpire && peer->host_dynamic && realtime) {
- time_t nowtime = time(NULL);
-
- if ((nowtime - regseconds) > 0) {
- destroy_association(peer);
- memset(&peer->addr, 0, sizeof(peer->addr));
- peer->lastms = -1;
- ast_debug(1, "Bah, we're expired (%d/%d/%d)!\n", (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
- }
- }
-
- /* Startup regular pokes */
- if (!devstate_only && realtime && peer->lastms > 0) {
- sip_ref_peer(peer, "schedule qualify");
- sip_poke_peer(peer, 0);
+ if (realtime) {
+ int enablepoke = 1;
+
+ if (!sip_cfg.ignore_regexpire && peer->host_dynamic) {
+ time_t nowtime = time(NULL);
+
+ if ((nowtime - regseconds) > 0) {
+ destroy_association(peer);
+ memset(&peer->addr, 0, sizeof(peer->addr));
+ peer->lastms = -1;
+ enablepoke = 0;
+ ast_debug(1, "Bah, we're expired (%d/%d/%d)!\n", (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
+ }
+ }
+
+ /* Startup regular pokes */
+ if (!devstate_only && enablepoke) {
+ sip_ref_peer(peer, "schedule qualify");
+ sip_poke_peer(peer, 0);
+ }
}
if (ast_test_flag(&peer->flags[1], SIP_PAGE2_ALLOWSUBSCRIBE)) {
More information about the asterisk-commits
mailing list