From a9e49f4e45fe01a7535ebb8775296bb2099791bf Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 21 Jul 2010 13:02:46 +0000 Subject: 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278425 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- UPGRADE.txt | 7 +++++++ configs/features.conf.sample | 30 +++++++++++++++++++++++++++--- main/features.c | 22 ++++++++++++---------- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/UPGRADE.txt b/UPGRADE.txt index 1ac0b758e..677fdb7c2 100644 --- a/UPGRADE.txt +++ b/UPGRADE.txt @@ -20,6 +20,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 are not enabled by default. For more information about why modules live in diff --git a/configs/features.conf.sample b/configs/features.conf.sample index 84a0ee06c..eb04c3c41 100644 --- a/configs/features.conf.sample +++ b/configs/features.conf.sample @@ -11,9 +11,33 @@ context => parkedcalls ; Which context parked calls are in (default parking lot ;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. diff --git a/main/features.c b/main/features.c index 46eee14d3..ac0bc7cbf 100644 --- a/main/features.c +++ b/main/features.c @@ -3629,21 +3629,24 @@ int manage_parkinglot(struct ast_parkinglot *curlot, fd_set *rfds, fd_set *efds, 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 @@ int manage_parkinglot(struct ast_parkinglot *curlot, fd_set *rfds, fd_set *efds, 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 @@ int manage_parkinglot(struct ast_parkinglot *curlot, fd_set *rfds, fd_set *efds, 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); -- cgit v1.2.3