[asterisk-commits] russell: trunk r278425 - in /trunk: ./ configs/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 21 08:02:51 CDT 2010


Author: russell
Date: Wed Jul 21 08:02:46 2010
New Revision: 278425

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=278425
Log:
Update documentation for 'comebacktoorigin' in featuers.conf.

The documentation for this option did not match the code.  Fix that along with
some minor cleanups to the code along the way.  Document a slight change in
behavior (to something that was previously undocumented) in UPGRADE.txt.

Modified:
    trunk/UPGRADE.txt
    trunk/configs/features.conf.sample
    trunk/main/features.c

Modified: trunk/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/trunk/UPGRADE.txt?view=diff&rev=278425&r1=278424&r2=278425
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Wed Jul 21 08:02:46 2010
@@ -19,6 +19,13 @@
 ===========================================================
 
 From 1.6.2 to 1.8:
+
+* The behavior of the 'parkedcallstimeout' has changed slightly.  The formulation
+  of the extension name that a timed out parked call is delivered to when this
+  option is set to 'no' was modified such that instead of converting '/' to '0',
+  the '/' is converted to an underscore '_'.  See the updated documentation in
+  features.conf.sample for more information on the behavior of the
+  'parkedcallstimeout' option.
 
 * Asterisk-addons no longer exists as an independent package.  Those modules
   now live in the addons directory of the main Asterisk source tree.  They

Modified: trunk/configs/features.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/features.conf.sample?view=diff&rev=278425&r1=278424&r2=278425
==============================================================================
--- trunk/configs/features.conf.sample (original)
+++ trunk/configs/features.conf.sample Wed Jul 21 08:02:46 2010
@@ -11,9 +11,33 @@
 ;parkinghints = no		; Add hints priorities automatically for parking slots (default is no).
 ;parkingtime => 45		; Number of seconds a call can be parked for
 				; (default is 45 seconds)
-;comebacktoorigin = yes	; Whether to return to the original calling extension upon parking
-				; timeout or to send the call to context 'parkedcallstimeout' at
-				; extension 's', priority '1' (default is yes).
+
+;comebacktoorigin = yes         ; Setting this option configures the behavior of call parking when the
+                                ; parked call times out (See the parkingtime option).  The default value is 'yes'.
+                                ;
+                                ; 'yes' - When the parked call times out, attempt to send the call back to the peer
+                                ;         that parked this call.  This is done by saving off the name of the channel
+                                ;         that parked the call.
+                                ;
+                                ; 'no'  - This option is useful for performing custom dialplan functionality prior to
+                                ;         sending the call back to the extension that initially parked the call, or to
+                                ;         an entirely different destination.
+                                ;
+                                ;         When the parked call times out, send it back to the dialplan.  The location
+                                ;         will be the 'parkedcallstimeout' context.  The extension will be built from
+                                ;         the saved channel name that parked the call.  For example, if a SIP peer named
+                                ;         '0004F2040001' parked this call, the extension will be 'SIP_0004F2040001'.
+                                ;         (Note that an underscore is used here because the '/' character has a special
+                                ;         meaning in extension names for CallerID matching.)  If this extension does not
+                                ;         exist, the call will be sent to the 's' extension, instead.  Finally, if the 's'
+                                ;         extension of 'parkedcallstimeout' does not exist, the call will fall back to the
+                                ;         's' extension of the 'default' context.
+                                ;
+                                ;         Additionally, in this example an extension of 'SIP_0004F2040001' will be
+                                ;         created in the 'park-dial' context.  This extension will be set up to do a
+                                ;         Dial() to 'SIP/0004F2040001'.
+                                ;
+
 ;courtesytone = beep		; Sound file to play to the parked caller
 				; when someone dials a parked call
 				; or the Touch Monitor is activated/deactivated.

Modified: trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features.c?view=diff&rev=278425&r1=278424&r2=278425
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Wed Jul 21 08:02:46 2010
@@ -3629,21 +3629,24 @@
 			if (pu->peername[0]) {
 				char *peername = ast_strdupa(pu->peername);
 				char *cp = strrchr(peername, '-');
-				char peername_flat[AST_MAX_EXTENSION]; /* using something like DAHDI/52 for an extension name is NOT a good idea */
+				char *peername_flat; /* using something like DAHDI/52 for an extension name is NOT a good idea */
 				int i;
 
-				if (cp) 
+				if (cp) {
 					*cp = 0;
-				ast_copy_string(peername_flat,peername,sizeof(peername_flat));
-				for(i=0; peername_flat[i] && i < AST_MAX_EXTENSION; i++) {
-					if (peername_flat[i] == '/') 
-						peername_flat[i]= '0';
 				}
+
+				peername_flat = ast_strdupa(peername);
+				for (i = 0; peername_flat[i]; i++) {
+					if (peername_flat[i] == '/') {
+						peername_flat[i]= '_';
+					}
+				}
+
 				con = ast_context_find_or_create(NULL, NULL, pu->parkinglot->parking_con_dial, registrar);
 				if (!con) {
 					ast_log(LOG_ERROR, "Parking dial context '%s' does not exist and unable to create\n", pu->parkinglot->parking_con_dial);
-				}
-				if (con) {
+				} else {
 					char returnexten[AST_MAX_EXTENSION];
 					struct ast_datastore *features_datastore;
 					struct ast_dial_features *dialfeatures = NULL;
@@ -3663,7 +3666,7 @@
 						char buf[MAX_DIAL_FEATURE_OPTIONS] = {0,};
 						snprintf(returnexten, sizeof(returnexten), "%s,30,%s", peername, callback_dialoptions(&(dialfeatures->features_callee), &(dialfeatures->features_caller), buf, sizeof(buf)));
 					} else { /* Existing default */
-						ast_log(LOG_WARNING, "Dialfeatures not found on %s, using default!\n", chan->name);
+						ast_log(LOG_NOTICE, "Dial features not found on %s, using default!\n", chan->name);
 						snprintf(returnexten, sizeof(returnexten), "%s,30,t", peername);
 					}
 
@@ -3676,7 +3679,6 @@
 					if (comebacktoorigin) {
 						set_c_e_p(chan, pu->parkinglot->parking_con_dial, peername_flat, 1);
 					} else {
-						ast_log(LOG_WARNING, "now going to parkedcallstimeout,s,1 | ps is %d\n",pu->parkingnum);
 						snprintf(parkingslot, sizeof(parkingslot), "%d", pu->parkingnum);
 						pbx_builtin_setvar_helper(chan, "PARKINGSLOT", parkingslot);
 						set_c_e_p(chan, "parkedcallstimeout", peername_flat, 1);




More information about the asterisk-commits mailing list