[asterisk-commits] file: trunk r103765 - in /trunk: apps/ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 18 09:47:00 CST 2008


Author: file
Date: Mon Feb 18 09:47:00 2008
New Revision: 103765

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103765
Log:
Add an API call (ast_async_parseable_goto) which parses a goto string and does an async goto instead of an explicit goto.
(closes issue #11753)
Reported by: johan

Modified:
    trunk/apps/app_channelredirect.c
    trunk/include/asterisk/pbx.h
    trunk/main/pbx.c

Modified: trunk/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_channelredirect.c?view=diff&rev=103765&r1=103764&r2=103765
==============================================================================
--- trunk/apps/app_channelredirect.c (original)
+++ trunk/apps/app_channelredirect.c Mon Feb 18 09:47:00 2008
@@ -72,7 +72,7 @@
 		return -1;
 	}
 
-	res = ast_parseable_goto(chan2, args.label);
+	res = ast_async_parseable_goto(chan2, args.label);
 
 	ast_channel_unlock(chan2);
 

Modified: trunk/include/asterisk/pbx.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/pbx.h?view=diff&rev=103765&r1=103764&r2=103765
==============================================================================
--- trunk/include/asterisk/pbx.h (original)
+++ trunk/include/asterisk/pbx.h Mon Feb 18 09:47:00 2008
@@ -864,6 +864,11 @@
 /*!
  * \note This function will handle locking the channel as needed.
  */
+int ast_async_parseable_goto(struct ast_channel *chan, const char *goto_string);
+
+/*!
+ * \note This function will handle locking the channel as needed.
+ */
 int ast_explicit_goto(struct ast_channel *chan, const char *context, const char *exten, int priority);
 
 /*!

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=103765&r1=103764&r2=103765
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Mon Feb 18 09:47:00 2008
@@ -7792,7 +7792,7 @@
 	return __ast_goto_if_exists(chan, context, exten, priority, 1);
 }
 
-int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
+static int pbx_parseable_goto(struct ast_channel *chan, const char *goto_string, int async)
 {
 	char *exten, *pri, *context;
 	char *stringp;
@@ -7836,8 +7836,22 @@
 	if (mode)
 		ipri = chan->priority + (ipri * mode);
 
-	ast_explicit_goto(chan, context, exten, ipri);
+	if (async)
+		ast_async_goto(chan, context, exten, ipri);
+	else
+		ast_explicit_goto(chan, context, exten, ipri);
+	
 	ast_cdr_update(chan);
 	return 0;
 
 }
+
+int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
+{
+	return pbx_parseable_goto(chan, goto_string, 0);
+}
+
+int ast_async_parseable_goto(struct ast_channel *chan, const char *goto_string)
+{
+	return pbx_parseable_goto(chan, goto_string, 1);
+}




More information about the asterisk-commits mailing list