Index: res/res_features.c =================================================================== --- res/res_features.c (revision 22155) +++ res/res_features.c (working copy) @@ -92,7 +92,7 @@ static int parkfindnext; static int adsipark; - +static int comebacktoorigin = 1; static int transferdigittimeout; static int featuredigittimeout; @@ -133,6 +133,7 @@ int notquiteyet; char peername[1024]; unsigned char moh_trys; + int comebacktoorigin; struct parkeduser *next; }; @@ -1439,7 +1440,11 @@ snprintf(returnexten, sizeof(returnexten), "%s||t", peername); ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", strdup(returnexten), FREE, registrar); } - set_c_e_p(chan, parking_con_dial, peername, 1); + if ( comebacktoorigin ) { + set_c_e_p(chan, parking_con_dial, peername, 1); + } else { + set_c_e_p(chan, pu->context, pu->chan->exten, pu->chan->priority); + } } else { /* They've been waiting too long, send them back to where they came. Theoretically they should have their original extensions and such, but we copy to be on the safe side */ @@ -1943,6 +1948,7 @@ parking_stop = 750; parkfindnext = 0; adsipark = 0; + comebacktoorigin = 1; transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT; featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT; @@ -1997,6 +2003,8 @@ 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); } }