[Asterisk-cvs] asterisk/channels chan_iax2.c,1.181,1.182

markster at lists.digium.com markster at lists.digium.com
Sun Sep 12 11:03:49 CDT 2004


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

Modified Files:
	chan_iax2.c 
Log Message:
Automatically send proper signal on iax switch following dial (bug #2420)


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -d -r1.181 -r1.182
--- chan_iax2.c	7 Sep 2004 23:45:34 -0000	1.181
+++ chan_iax2.c	12 Sep 2004 15:05:37 -0000	1.182
@@ -7063,7 +7063,7 @@
 #if 0
 	ast_log(LOG_NOTICE, "iax2_exists: con: %s, exten: %s, pri: %d, cid: %s, data: %s\n", context, exten, priority, callerid ? callerid : "<unknown>", data);
 #endif
-	if (priority != 1)
+	if ((priority != 1) && (priority != 2))
 		return 0;
 	ast_mutex_lock(&dpcache_lock);
 	dp = find_cache(chan, data, context, exten, priority);
@@ -7085,7 +7085,7 @@
 #if 0
 	ast_log(LOG_NOTICE, "iax2_canmatch: con: %s, exten: %s, pri: %d, cid: %s, data: %s\n", context, exten, priority, callerid ? callerid : "<unknown>", data);
 #endif
-	if (priority != 1)
+	if ((priority != 1) && (priority != 2))
 		return 0;
 	ast_mutex_lock(&dpcache_lock);
 	dp = find_cache(chan, data, context, exten, priority);
@@ -7107,7 +7107,7 @@
 #if 0
 	ast_log(LOG_NOTICE, "iax2_matchmore: con: %s, exten: %s, pri: %d, cid: %s, data: %s\n", context, exten, priority, callerid ? callerid : "<unknown>", data);
 #endif
-	if (priority != 1)
+	if ((priority != 1) && (priority != 2))
 		return 0;
 	ast_mutex_lock(&dpcache_lock);
 	dp = find_cache(chan, data, context, exten, priority);
@@ -7127,12 +7127,22 @@
 	char odata[256];
 	char req[256];
 	char *ncontext;
+	char *dialstatus;
 	struct iax2_dpcache *dp;
 	struct ast_app *dial;
 #if 0
 	ast_log(LOG_NOTICE, "iax2_exec: con: %s, exten: %s, pri: %d, cid: %s, data: %s, newstack: %d\n", context, exten, priority, callerid ? callerid : "<unknown>", data, newstack);
 #endif
-	if (priority != 1)
+	if (priority == 2) {
+		/* Indicate status, can be overridden in dialplan */
+		dialstatus = pbx_builtin_getvar_helper(chan, "DIALSTATUS");
+		if (dialstatus) {
+			dial = pbx_findapp(dialstatus);
+			if (dial) 
+				pbx_exec(chan, dial, "", newstack);
+		}
+		return -1;
+	} else if (priority != 1)
 		return -1;
 	ast_mutex_lock(&dpcache_lock);
 	dp = find_cache(chan, data, context, exten, priority);




More information about the svn-commits mailing list