[Asterisk-cvs] asterisk/channels chan_zap.c,1.389,1.390

mattf at lists.digium.com mattf at lists.digium.com
Wed Dec 15 15:03:12 CST 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv31427/channels

Modified Files:
	chan_zap.c 
Log Message:
Add new variable for PRIREDIRECTREASON in dial plan if you a call is redirected
to you.  Also some E&M tweaking parameters.


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.389
retrieving revision 1.390
diff -u -d -r1.389 -r1.390
--- chan_zap.c	14 Dec 2004 23:36:29 -0000	1.389
+++ chan_zap.c	15 Dec 2004 19:59:52 -0000	1.390
@@ -157,6 +157,8 @@
 
 #define DCHAN_AVAILABLE	(DCHAN_PROVISIONED | DCHAN_NOTINALARM | DCHAN_UP)
 
+static int cur_emdigitwait = 250; /* Wait time in ms for digits on EM channel */
+
 static char context[AST_MAX_EXTENSION] = "default";
 static char cid_num[256] = "";
 static char cid_name[256] = "";
@@ -563,6 +565,7 @@
 	int dtmfrelax;		/* whether to run in relaxed DTMF mode */
 	int fake_event;
 	int zaptrcallerid;	/* should we use the callerid from incoming call on zap transfer or not */
+	int emdigitwait;
 	int hanguponpolarityswitch;
 	int polarityonanswerdelay;
 	struct timeval polaritydelaytv;
@@ -4835,7 +4838,7 @@
 				break;
 			    default:
 				/* If we got it, get the rest */
-				res = my_getsigstr(chan,dtmfbuf + 1,' ',250);
+				res = my_getsigstr(chan,dtmfbuf + 1,' ', p->emdigitwait);
 				break;
 			}
 		}
@@ -6592,6 +6595,7 @@
 		tmp->restrictcid = restrictcid;
 		tmp->use_callingpres = use_callingpres;
 		tmp->priindication_oob = priindication_oob;
+		tmp->emdigitwait = cur_emdigitwait;
 		if (tmp->usedistinctiveringdetection) {
 			if (!tmp->use_callerid) {
 				ast_log(LOG_NOTICE, "Distinctive Ring detect requires 'usecallerid' be on\n");
@@ -7778,6 +7782,27 @@
 								snprintf(ani2str, 5, "%.2d", e->ring.ani2);
 								pbx_builtin_setvar_helper(c, "ANI2", ani2str);
 							}
+
+							if(e->ring.redirectingreason >= 0) {
+								char redirstr[20] = "";
+								switch (e->ring.redirectingreason) {
+									case 0:
+										snprintf(redirstr, 20, "UNKNOWN");
+										break;
+									case 1:
+										snprintf(redirstr, 20, "BUSY");
+										break;
+									case 2:
+										snprintf(redirstr, 20, "NO_REPLY");
+										break;
+									case 0xF:
+										snprintf(redirstr, 20, "UNCONDITIONAL"); /* Other reason */
+										break;
+								}
+
+								pbx_builtin_setvar_helper(c, "PRIREDIRECTCAUSE", redirstr);
+							}
+							
 							ast_mutex_lock(&pri->lock);
 							if (c && !ast_pthread_create(&threadid, &attr, ss_thread, c)) {
 								if (option_verbose > 2)
@@ -9778,6 +9803,8 @@
 				cur_rxflash = atoi(v->value);
 			} else if (!strcasecmp(v->name, "debounce")) {
 				cur_debounce = atoi(v->value);
+			} else if (!strcasecmp(v->name, "emdigitwait")) {
+				cur_emdigitwait = atoi(v->value);
 			} else if (!strcasecmp(v->name, "polarityonanswerdelay")) {
 				polarityonanswerdelay = atoi(v->value);
 			} else if (!strcasecmp(v->name, "hanguponpolarityswitch")) {




More information about the svn-commits mailing list