[svn-commits] mogorman: trunk r46732 - /trunk/res/res_features.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Oct 31 17:07:37 MST 2006


Author: mogorman
Date: Tue Oct 31 18:07:37 2006
New Revision: 46732

URL: http://svn.digium.com/view/asterisk?rev=46732&view=rev
Log:
change default return extension after parking timeout.
6953 with minor changes.

Modified:
    trunk/res/res_features.c

Modified: trunk/res/res_features.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_features.c?rev=46732&r1=46731&r2=46732&view=diff
==============================================================================
--- trunk/res/res_features.c (original)
+++ trunk/res/res_features.c Tue Oct 31 18:07:37 2006
@@ -99,6 +99,7 @@
 
 static int transferdigittimeout;
 static int featuredigittimeout;
+static int comebacktoorigin = 1;
 
 static int atxfernoanswertimeout;
 
@@ -1529,6 +1530,7 @@
 	fd_set rfds, efds;	/* results from previous select, to be preserved across loops. */
 	FD_ZERO(&rfds);
 	FD_ZERO(&efds);
+	char parkingslot[AST_MAX_EXTENSION];
 
 	for (;;) {
 		struct parkeduser *pu, *pl, *pt = NULL;
@@ -1573,7 +1575,14 @@
 						snprintf(returnexten, sizeof(returnexten), "%s||t", peername);
 						ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", strdup(returnexten), ast_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 {
+							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);
+							set_c_e_p(chan, "parkedcallstimeout", peername, 1);
+							}
 				} 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 */
@@ -2112,6 +2121,7 @@
 	parking_stop = 750;
 	parkfindnext = 0;
 	adsipark = 0;
+	comebacktoorigin = 1;
 	parkaddhints = 0;
 
 	transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
@@ -2179,6 +2189,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);
 		} else if (!strcasecmp(var->name, "parkedmusicclass")) {
 			ast_copy_string(parkmohclass, var->value, sizeof(parkmohclass));
 		}



More information about the svn-commits mailing list