[asterisk-commits] file: branch file/originate_dial r387019 - /team/file/originate_dial/main/dial.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 30 15:02:00 CDT 2013
Author: file
Date: Tue Apr 30 15:01:56 2013
New Revision: 387019
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387019
Log:
Fix a bug with timeout that was driving me mad and allow ast_dial_run to be called synchronously with no channel.
Modified:
team/file/originate_dial/main/dial.c
Modified: team/file/originate_dial/main/dial.c
URL: http://svnview.digium.com/svn/asterisk/team/file/originate_dial/main/dial.c?view=diff&rev=387019&r1=387018&r2=387019
==============================================================================
--- team/file/originate_dial/main/dial.c (original)
+++ team/file/originate_dial/main/dial.c Tue Apr 30 15:01:56 2013
@@ -553,6 +553,11 @@
struct ast_dial_channel *channel = NULL;
int diff = ast_tvdiff_ms(ast_tvnow(), start), lowest_timeout = -1, new_timeout = -1;
+ /* If there is no difference yet return the dial timeout so we can go again, we were likely interrupted */
+ if (!diff) {
+ return dial->timeout;
+ }
+
/* If the global dial timeout tripped switch the state to timeout so our channel loop will drop every channel */
if (diff >= dial->timeout) {
set_state(dial, AST_DIAL_RESULT_TIMEOUT);
@@ -770,7 +775,7 @@
enum ast_dial_result res = AST_DIAL_RESULT_TRYING;
/* Ensure required arguments are passed */
- if (!dial || (!chan && !async)) {
+ if (!dial) {
ast_debug(1, "invalid #1\n");
return AST_DIAL_RESULT_INVALID;
}
More information about the asterisk-commits
mailing list