Summary: | ASTERISK-06279: peercontext is not updated on reload | ||
Reporter: | Edward Eastman (whisk) | Labels: | |
Date Opened: | 2006-02-08 05:51:41.000-0600 | Date Closed: | 2008-01-15 16:34:38.000-0600 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) asterisk-iax-peercontext.patch | |
Description: | The iax peer configuration option "peercontext=somecontext" is not updated on a reload or iax2 reload. Restarting asterisk or unloading/loading chan_iax2.so does update it. ****** ADDITIONAL INFORMATION ****** I've tested this with 1.2 and trunk - from past mailing list posts it looks like this has been around for a while. I've added a very simple patch, which does work for me, although i'm not entirely sure it's the correct way to do it. | ||
Comments: | By: Edward Eastman (whisk) 2006-02-08 05:56:31.000-0600 Sorry forgot to put [patch] in the bug title :o By: Edward Eastman (whisk) 2006-02-08 06:01:59.000-0600 I'd like to send in a disclaimer, but only for bugs submitted by me under this username on mantis (I do asterisk stuff at work as well at home and I don't want to get in a mess without realizing it) - I believe this has been done before by other people - would the following be acceptable if faxed to digium: Edward Eastman hereby disclaims all copyright interest in the changes and enhancements made by Edward Eastman under the username “Whisk” on the website http://bugs.digium.com to the program "asterisk" (the "Program"). Edward Eastman affirms that it has no other intellectual property interest that would undermine this release, or the use of the Program, and will do nothing to undermine it in the future. By: Peng Yong (ppyy) 2006-02-08 06:23:26.000-0600 1. i check the code, another bug when reload "context" 2. i think we would better to just add a "!" Index: channels/chan_iax2.c =================================================================== --- channels/chan_iax2.c (revision 9210) +++ channels/chan_iax2.c (working copy) @@ -8203,12 +8203,12 @@ maskfound++; inet_aton(v->value, &peer->mask); } else if (!strcasecmp(v->name, "context")) { - if (ast_strlen_zero(peer->context)) + if (!ast_strlen_zero(peer->context)) ast_copy_string(peer->context, v->value, sizeof(peer->context)); } else if (!strcasecmp(v->name, "regexten")) { ast_copy_string(peer->regexten, v->value, sizeof(peer->regexten)); } else if (!strcasecmp(v->name, "peercontext")) { - if (ast_strlen_zero(peer->peercontext)) + if (!ast_strlen_zero(peer->peercontext)) ast_copy_string(peer->peercontext, v->value, sizeof(peer->peercontext)); } else if (!strcasecmp(v->name, "port")) { if (ast_test_flag(peer, IAX_DYNAMIC)) By: Peng Yong (ppyy) 2006-02-08 06:25:11.000-0600 it should be fixed in 1.0, 1.2 and trunk By: Edward Eastman (whisk) 2006-02-08 15:30:54.000-0600 I didn't change context in my patch because I thought from my testing it wasn't affected - which was one of the things I was a little confused about - having said that I haven't tested that very thouroughly yet so I wouldn't be certain. Thinking about it again, is context even used for a peer? I'm still not quite sure why we need to check to see if peercontext is or isn't null before adding it to the peer - that isn't done for any of the other settings (apart from context). By: Russell Bryant (russell) 2006-02-08 18:37:44.000-0600 This has been fixed in 1.2 and the trunk in revisions 9246 and 9247. I fixed it in a different way, though. The issue of checking the string length came up when a bug report was filed for this same problem, but for "context". Mark preferred to keep it this way so that if multiple "context" options, or in this case, "peercontext" options were specified, that we use the first one. Thanks! By: Digium Subversion (svnbot) 2008-01-15 16:34:08.000-0600 Repository: asterisk Revision: 9246 U branches/1.2/channels/chan_iax2.c ------------------------------------------------------------------------ r9246 | russell | 2008-01-15 16:34:08 -0600 (Tue, 15 Jan 2008) | 2 lines reload peercontext on iax2 reload (issue ASTERISK-6279) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=9246 By: Digium Subversion (svnbot) 2008-01-15 16:34:09.000-0600 Repository: asterisk Revision: 9247 _U trunk/ U trunk/channels/chan_iax2.c ------------------------------------------------------------------------ r9247 | russell | 2008-01-15 16:34:09 -0600 (Tue, 15 Jan 2008) | 10 lines Merged revisions 9246 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r9246 | russell | 2006-02-08 20:24:55 -0500 (Wed, 08 Feb 2006) | 2 lines reload peercontext on iax2 reload (issue ASTERISK-6279) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=9247 By: Digium Subversion (svnbot) 2008-01-15 16:34:33.000-0600 Repository: asterisk Revision: 9275 _U team/oej/astum/ U team/oej/astum/Makefile U team/oej/astum/apps/Makefile U team/oej/astum/apps/app_macro.c U team/oej/astum/cdr/Makefile U team/oej/astum/channels/chan_iax2.c U team/oej/astum/channels/chan_misdn.c U team/oej/astum/channels/chan_misdn_config.c U team/oej/astum/channels/chan_oss.c U team/oej/astum/channels/chan_zap.c U team/oej/astum/channels/misdn/Makefile U team/oej/astum/channels/misdn/isdn_lib.c U team/oej/astum/channels/misdn/isdn_lib_intern.h U team/oej/astum/channels/misdn/isdn_msg_parser.c U team/oej/astum/configs/misdn.conf.sample U team/oej/astum/dsp.c U team/oej/astum/enum.c U team/oej/astum/file.c U team/oej/astum/include/asterisk/sha1.h U team/oej/astum/logger.c U team/oej/astum/sha1.c ------------------------------------------------------------------------ r9275 | oej | 2008-01-15 16:34:33 -0600 (Tue, 15 Jan 2008) | 129 lines Merged revisions 9150,9157,9163,9166,9186,9194,9215,9223,9225,9238-9239,9247-9248,9259-9261,9263 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r9150 | russell | 2006-02-04 17:32:27 +0100 (Sat, 04 Feb 2006) | 2 lines remove windows-style line endings ................ r9157 | tilghman | 2006-02-05 18:20:29 +0100 (Sun, 05 Feb 2006) | 10 lines Merged revisions 9156 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r9156 | tilghman | 2006-02-05 11:10:19 -0600 (Sun, 05 Feb 2006) | 2 lines Bug 6176 - Fix race condition ........ ................ r9163 | kpfleming | 2006-02-06 21:18:17 +0100 (Mon, 06 Feb 2006) | 2 lines rename properties for forward-porting fixes so they don't conflict with developer branches ................ r9166 | kpfleming | 2006-02-06 21:30:49 +0100 (Mon, 06 Feb 2006) | 2 lines minor cleanup ................ r9186 | crichter | 2006-02-07 14:34:59 +0100 (Tue, 07 Feb 2006) | 1 line default values of jitterbuffer and jitterbuffer_upper_threshold should be > 0, this fixes the tv_fix warnings, because we use ast_read to transmit frames to asterisk in jitterbuffer mode, instead of queueing the audio data with ast_queue_frame. ................ r9194 | mattf | 2006-02-07 19:00:42 +0100 (Tue, 07 Feb 2006) | 2 lines Make sure we output the APDU debug on pri debug commands ................ r9215 | crichter | 2006-02-08 17:10:21 +0100 (Wed, 08 Feb 2006) | 8 lines * dozens of white-space removements * some // comment removements * debugging optimization, use port where possible * fixed pickup problem (pickup didn't work anymore after mqueue) * removed some mIDSN_JOLLY defines which are not needed anymore in mqueue * adapted the new cli.h constifications ................ r9223 | crichter | 2006-02-08 20:39:37 +0100 (Wed, 08 Feb 2006) | 1 line L2 Signalling in PTP-TE Mode fixed ................ r9225 | crichter | 2006-02-08 20:51:53 +0100 (Wed, 08 Feb 2006) | 1 line fix for the L2 Signalling ................ r9238 | tilghman | 2006-02-09 00:10:39 +0100 (Thu, 09 Feb 2006) | 10 lines Merged revisions 9233 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r9233 | tilghman | 2006-02-08 16:34:38 -0600 (Wed, 08 Feb 2006) | 2 lines Leave it to RH/CentOS to put the freetds headers in a completely nonstandard location. ........ ................ r9239 | mogorman | 2006-02-09 00:14:17 +0100 (Thu, 09 Feb 2006) | 12 lines Merged revisions 9232 via svnmerge from https://svn.digium.com/svn/asterisk/branches/1.2 ........ r9232 | mogorman | 2006-02-08 16:12:34 -0600 (Wed, 08 Feb 2006) | 4 lines Make logger report error,warning,notice if logger.conf not found, also updated chan_oss to give correct error message if its config file is not found. ........ ................ r9247 | russell | 2006-02-09 02:33:50 +0100 (Thu, 09 Feb 2006) | 10 lines Merged revisions 9246 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r9246 | russell | 2006-02-08 20:24:55 -0500 (Wed, 08 Feb 2006) | 2 lines reload peercontext on iax2 reload (issue ASTERISK-6279) ........ ................ r9248 | russell | 2006-02-09 02:52:09 +0100 (Thu, 09 Feb 2006) | 2 lines clarify return value (issue ASTERISK-6271) ................ r9259 | russell | 2006-02-09 03:08:04 +0100 (Thu, 09 Feb 2006) | 4 lines various code cleanup changes including changing #define'd constants to enums, comments to doxygen style, memory allocation to use ast_ wrappers, use calloc instead of malloc+memset, and removing duplicated error messages (issue ASTERISK-6272) ................ r9260 | russell | 2006-02-09 03:21:57 +0100 (Thu, 09 Feb 2006) | 3 lines remove unnecessary format check in zt_request so that we will actually accept a requested format of ALAW (issue ASTERISK-6259, different patch) ................ r9261 | russell | 2006-02-09 03:27:30 +0100 (Thu, 09 Feb 2006) | 2 lines remove some Makefile targets for things that don't exist in the tree ................ r9263 | russell | 2006-02-09 03:35:34 +0100 (Thu, 09 Feb 2006) | 1 line ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=9275 By: Digium Subversion (svnbot) 2008-01-15 16:34:36.000-0600 Repository: asterisk Revision: 9279 _U team/oej/managerstuff/ U team/oej/managerstuff/Makefile U team/oej/managerstuff/apps/Makefile U team/oej/managerstuff/apps/app_macro.c U team/oej/managerstuff/cdr/Makefile U team/oej/managerstuff/channels/chan_iax2.c U team/oej/managerstuff/channels/chan_oss.c U team/oej/managerstuff/logger.c U team/oej/managerstuff/res/res_odbc.c ------------------------------------------------------------------------ r9279 | oej | 2008-01-15 16:34:36 -0600 (Tue, 15 Jan 2008) | 42 lines Merged revisions 9073,9086,9156,9232-9233,9246,9262 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r9073 | mattf | 2006-02-02 17:12:13 +0100 (Thu, 02 Feb 2006) | 2 lines Fix for (ASTERISK-6149), potential (highly unlikely) memory leak in res_odbc ........ r9086 | kpfleming | 2006-02-02 19:37:04 +0100 (Thu, 02 Feb 2006) | 2 lines don't override ASTERISKVERSIONNUM to 000000 for non-svn builds ........ r9156 | tilghman | 2006-02-05 18:10:19 +0100 (Sun, 05 Feb 2006) | 2 lines Bug 6176 - Fix race condition ........ r9232 | mogorman | 2006-02-08 23:12:34 +0100 (Wed, 08 Feb 2006) | 4 lines Make logger report error,warning,notice if logger.conf not found, also updated chan_oss to give correct error message if its config file is not found. ........ r9233 | tilghman | 2006-02-08 23:34:38 +0100 (Wed, 08 Feb 2006) | 2 lines Leave it to RH/CentOS to put the freetds headers in a completely nonstandard location. ........ r9246 | russell | 2006-02-09 02:24:55 +0100 (Thu, 09 Feb 2006) | 2 lines reload peercontext on iax2 reload (issue ASTERISK-6279) ........ r9262 | russell | 2006-02-09 03:31:21 +0100 (Thu, 09 Feb 2006) | 2 lines add another location for postgresql headers (issue ASTERISK-6257) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=9279 By: Digium Subversion (svnbot) 2008-01-15 16:34:38.000-0600 Repository: asterisk Revision: 9281 _U team/oej/metermaids/ U team/oej/metermaids/Makefile U team/oej/metermaids/apps/Makefile U team/oej/metermaids/apps/app_macro.c U team/oej/metermaids/cdr/Makefile U team/oej/metermaids/channels/chan_iax2.c U team/oej/metermaids/channels/chan_oss.c U team/oej/metermaids/logger.c U team/oej/metermaids/res/res_odbc.c ------------------------------------------------------------------------ r9281 | oej | 2008-01-15 16:34:38 -0600 (Tue, 15 Jan 2008) | 42 lines Merged revisions 9073,9086,9156,9232-9233,9246,9262 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r9073 | mattf | 2006-02-02 17:12:13 +0100 (Thu, 02 Feb 2006) | 2 lines Fix for (ASTERISK-6149), potential (highly unlikely) memory leak in res_odbc ........ r9086 | kpfleming | 2006-02-02 19:37:04 +0100 (Thu, 02 Feb 2006) | 2 lines don't override ASTERISKVERSIONNUM to 000000 for non-svn builds ........ r9156 | tilghman | 2006-02-05 18:10:19 +0100 (Sun, 05 Feb 2006) | 2 lines Bug 6176 - Fix race condition ........ r9232 | mogorman | 2006-02-08 23:12:34 +0100 (Wed, 08 Feb 2006) | 4 lines Make logger report error,warning,notice if logger.conf not found, also updated chan_oss to give correct error message if its config file is not found. ........ r9233 | tilghman | 2006-02-08 23:34:38 +0100 (Wed, 08 Feb 2006) | 2 lines Leave it to RH/CentOS to put the freetds headers in a completely nonstandard location. ........ r9246 | russell | 2006-02-09 02:24:55 +0100 (Thu, 09 Feb 2006) | 2 lines reload peercontext on iax2 reload (issue ASTERISK-6279) ........ r9262 | russell | 2006-02-09 03:31:21 +0100 (Thu, 09 Feb 2006) | 2 lines add another location for postgresql headers (issue ASTERISK-6257) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=9281 |