Index: configs/features.conf.sample =================================================================== --- configs/features.conf.sample (revision 98558) +++ configs/features.conf.sample (working copy) @@ -35,6 +35,11 @@ ; They can not be used while the remote party is ringing or in progress. If you require this feature you can use ; chan_local in combination with Answer to accomplish it. +; if parked calls time out, you can specify what context, exten and priority to return to +;timeoutcontext=ring_all ; context to return to after a parked call times out +;timeoutexten=s ; extension in this context to return to +;timeoutpriority=1 ; priority to go to + [featuremap] ;blindxfer => #1 ; Blind transfer (default is #) ;disconnect => *0 ; Disconnect (default is *) Index: res/res_features.c =================================================================== --- res/res_features.c (revision 98558) +++ res/res_features.c (working copy) @@ -91,6 +91,10 @@ static int parkedplay = 0; /*!< Who to play the courtesy tone to */ static char xfersound[256]; /*!< Call transfer sound */ static char xferfailsound[256]; /*!< Call transfer failure sound */ +static char parktimeoutcontext[AST_MAX_EXTENSION]; /*!< Context to move to after a parked call times out */ +static char parktimeoutexten[AST_MAX_EXTENSION]; /*!< Extension to move to after a parked call times out */ +static int parktimeoutpriority; /*!< Priority of exten in context to move to after a parked call times out */ + static int parking_offset; static int parkfindnext; @@ -1695,8 +1699,21 @@ post_manager_event("ParkedCallTimeOut", pu->parkingexten, chan); - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Timeout for %s parked on %d. Returning to %s,%s,%d\n", chan->name, pu->parkingnum, chan->context, chan->exten, chan->priority); + if (option_verbose > 1) { + /*ast_verbose(VERBOSE_PREFIX_2 "Line=%d, Context size=%d, context length=%d, exten size=%d, exten length=%d\n", __LINE__, sizeof( chan->context ), strlen( chan->context ), sizeof( chan->exten ), strlen( chan->exten )) ;*/ + ast_verbose(VERBOSE_PREFIX_2 "context=%s, exten=%s, pri=%d\n", parktimeoutcontext, parktimeoutexten, parktimeoutpriority) ; + if (strlen(parktimeoutcontext)>0) + strcpy(chan->context,parktimeoutcontext) ; + + if (strlen(parktimeoutexten)>0) + strcpy(chan->exten,parktimeoutexten) ; + + if (parktimeoutpriority>-1) + chan->priority=parktimeoutpriority ; + + ast_verbose(VERBOSE_PREFIX_2 "Line=%d, Timeout for %s parked on %d. Returning to %s,%s,%d\n", __LINE__, chan->name, pu->parkingnum, chan->context, chan->exten, chan->priority); + } + /* Start up the PBX, or hang them up */ if (ast_pbx_start(chan)) { ast_log(LOG_WARNING, "Unable to restart the PBX for user on '%s', hanging them up...\n", chan->name); @@ -2249,6 +2266,10 @@ parkfindnext = 0; adsipark = 0; parkaddhints = 0; + memset(parktimeoutcontext, 0, sizeof(parktimeoutcontext)); + memset(parktimeoutexten, 0, sizeof(parktimeoutexten)); + parktimeoutpriority =- 1; + transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT; featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT; @@ -2317,6 +2338,12 @@ ast_copy_string(pickup_ext, var->value, sizeof(pickup_ext)); } else if (!strcasecmp(var->name, "parkedmusicclass")) { ast_copy_string(parkmohclass, var->value, sizeof(parkmohclass)); + } else if(!strcasecmp(var->name, "timeoutcontext")) { + ast_copy_string(parktimeoutcontext, var->value, sizeof(parktimeoutcontext)); + } else if(!strcasecmp(var->name, "timeoutexten")) { + ast_copy_string(parktimeoutexten, var->value, sizeof(parktimeoutexten)); + } else if(!strcasecmp(var->name, "timeoutpriority")) { + parktimeoutpriority=atoi(var->value) ; } }