--- res/res_features.c 2006-08-24 21:37:54.000000000 -0400 +++ /usr/src/asterisk-1.2.10/res/res_features.c 2006-08-24 21:34:39.000000000 -0400 @@ -108,6 +108,8 @@ static int transferdigittimeout; static int featuredigittimeout; +static int comebacktoorigin = 1; + /* Default courtesy tone played when party joins conference */ /* Registrar for operations */ @@ -1494,6 +1496,7 @@ fd_set nrfds, nefds; FD_ZERO(&rfds); FD_ZERO(&efds); + char parkingslot[5]; for (;;) { ms = -1; @@ -1532,9 +1535,18 @@ snprintf(returnexten, sizeof(returnexten), "%s||t", peername); ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", strdup(returnexten), FREE, registrar); } - ast_copy_string(pu->chan->exten, peername, sizeof(pu->chan->exten)); - ast_copy_string(pu->chan->context, parking_con_dial, sizeof(pu->chan->context)); - pu->chan->priority = 1; + if ( comebacktoorigin) { + ast_copy_string(pu->chan->exten, peername, sizeof(pu->chan->exten)); + ast_copy_string(pu->chan->context, parking_con_dial, sizeof(pu->chan->context)); + pu->chan->priority = 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(pu->chan, "PARKINGSLOT", parkingslot); + ast_copy_string(pu->chan->exten, "s", sizeof(pu->chan->exten)); + ast_copy_string(pu->chan->context,"parkedcallstimeout", sizeof(pu->chan->context)); + pu->chan->priority = 1; + } } else { /* They've been waiting too long, send them back to where they came. Theoretically they @@ -1984,6 +1996,7 @@ parking_stop = 750; parkfindnext = 0; adsipark = 0; + comebacktoorigin = 1; transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT; featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT; @@ -2037,7 +2050,10 @@ ast_copy_string(xferfailsound, var->value, sizeof(xferfailsound)); } else if (!strcasecmp(var->name, "pickupexten")) { ast_copy_string(pickup_ext, var->value, sizeof(pickup_ext)); - } + } else if (!strcasecmp(var->name, "comebacktoorigin")) { + comebacktoorigin = ast_true(var->value); + } + var = var->next; }