[asterisk-commits] irroot: branch irroot/distrotech-customers-10 r337260 - in /team/irroot/distr...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Sep 21 05:34:49 CDT 2011
Author: irroot
Date: Wed Sep 21 05:34:46 2011
New Revision: 337260
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=337260
Log:
Adds a timeout argument to app_originate
the default is 30s this will be used if the timout supplied is invalid or
no timeout is supplied.
Contributed by: jacco (thank you for the work)
Review: https://reviewboard.asterisk.org/r/1310/
Modified:
team/irroot/distrotech-customers-10/CHANGES
team/irroot/distrotech-customers-10/apps/app_originate.c
Modified: team/irroot/distrotech-customers-10/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/CHANGES?view=diff&rev=337260&r1=337259&r2=337260
==============================================================================
--- team/irroot/distrotech-customers-10/CHANGES (original)
+++ team/irroot/distrotech-customers-10/CHANGES Wed Sep 21 05:34:46 2011
@@ -205,6 +205,7 @@
a MeetMe conference
* Added 'k' option to MeetMe to automatically kill the conference when there's only
one participant left (much like a normal call bridge)
+ * Added extra argument to Originate to set timeout.
Asterisk Database
-----------------
Modified: team/irroot/distrotech-customers-10/apps/app_originate.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/apps/app_originate.c?view=diff&rev=337260&r1=337259&r2=337260
==============================================================================
--- team/irroot/distrotech-customers-10/apps/app_originate.c (original)
+++ team/irroot/distrotech-customers-10/apps/app_originate.c Wed Sep 21 05:34:46 2011
@@ -69,6 +69,9 @@
</parameter>
<parameter name="arg3" required="false">
<para>If the type is <literal>exten</literal>, then this is the priority that the channel is sent to. If the type is <literal>app</literal>, then this parameter is ignored.</para>
+ </parameter>
+ <parameter name="timeout" required="false">
+ <para>Timeout in seconds. Default is 30 seconds.</para>
</parameter>
</syntax>
<description>
@@ -101,12 +104,13 @@
AST_APP_ARG(arg1);
AST_APP_ARG(arg2);
AST_APP_ARG(arg3);
+ AST_APP_ARG(timeout);
);
char *parse;
char *chantech, *chandata;
int res = -1;
int outgoing_status = 0;
- static const unsigned int timeout = 30;
+ unsigned int timeout = 30;
static const char default_exten[] = "s";
struct ast_format tmpfmt;
struct ast_format_cap *cap_slin = ast_format_cap_alloc_nolock();
@@ -129,6 +133,13 @@
if (args.argc < 3) {
ast_log(LOG_ERROR, "Incorrect number of arguments\n");
goto return_cleanup;
+ }
+
+ if (!ast_strlen_zero(args.timeout)) {
+ if(sscanf(args.timeout, "%u", &timeout) != 1) {
+ ast_log(LOG_NOTICE, "Invalid timeout: '%s'. Setting timeout to 30 seconds\n", args.timeout);
+ timeout = 30;
+ }
}
chandata = ast_strdupa(args.tech_data);
More information about the asterisk-commits
mailing list