[asterisk-commits] file: branch file/originate_dial r388214 - in /team/file/originate_dial: incl...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu May 9 13:44:04 CDT 2013
Author: file
Date: Thu May 9 13:44:02 2013
New Revision: 388214
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388214
Log:
Incorporate review feedback.
Modified:
team/file/originate_dial/include/asterisk/dial.h
team/file/originate_dial/main/dial.c
team/file/originate_dial/main/pbx.c
Modified: team/file/originate_dial/include/asterisk/dial.h
URL: http://svnview.digium.com/svn/asterisk/team/file/originate_dial/include/asterisk/dial.h?view=diff&rev=388214&r1=388213&r2=388214
==============================================================================
--- team/file/originate_dial/include/asterisk/dial.h (original)
+++ team/file/originate_dial/include/asterisk/dial.h Thu May 9 13:44:02 2013
@@ -169,7 +169,7 @@
* \param num Channel number to get channel of
* \return Pointer to channel, without reference
*/
-struct ast_channel *ast_dial_channel(struct ast_dial *dial, int num);
+struct ast_channel *ast_dial_get_channel(struct ast_dial *dial, int num);
/*! \brief Set a callback for state changes
* \param dial The dial structure to watch for state changes
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=388214&r1=388213&r2=388214
==============================================================================
--- team/file/originate_dial/main/dial.c (original)
+++ team/file/originate_dial/main/dial.c Thu May 9 13:44:02 2013
@@ -316,7 +316,7 @@
int ast_dial_prerun(struct ast_dial *dial, struct ast_channel *chan, struct ast_format_cap *cap)
{
- struct ast_dial_channel *channel = NULL;
+ struct ast_dial_channel *channel;
int res = -1;
AST_LIST_LOCK(&dial->channels);
@@ -1144,18 +1144,18 @@
{
struct ast_dial_channel *channel;
- if (!dial || AST_LIST_EMPTY(&dial->channels) | !(channel = find_dial_channel(dial, num))) {
+ if (!dial || AST_LIST_EMPTY(&dial->channels) || !(channel = find_dial_channel(dial, num))) {
return -1;
}
return channel->cause;
}
-struct ast_channel *ast_dial_channel(struct ast_dial *dial, int num)
+struct ast_channel *ast_dial_get_channel(struct ast_dial *dial, int num)
{
struct ast_dial_channel *channel;
- if (!dial || AST_LIST_EMPTY(&dial->channels) | !(channel = find_dial_channel(dial, num))) {
+ if (!dial || AST_LIST_EMPTY(&dial->channels) || !(channel = find_dial_channel(dial, num))) {
return NULL;
}
Modified: team/file/originate_dial/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/file/originate_dial/main/pbx.c?view=diff&rev=388214&r1=388213&r2=388214
==============================================================================
--- team/file/originate_dial/main/pbx.c (original)
+++ team/file/originate_dial/main/pbx.c Thu May 9 13:44:02 2013
@@ -9956,9 +9956,7 @@
ast_mutex_destroy(&outgoing->lock);
ast_cond_destroy(&outgoing->cond);
- if (outgoing->appdata) {
- ast_free(outgoing->appdata);
- }
+ ast_free(outgoing->appdata);
}
/*! \brief Internal function which dials an outgoing leg and sends it to a provided extension or application */
@@ -10029,7 +10027,7 @@
return;
}
- if (!(channel = ast_dial_channel(dial, 0))) {
+ if (!(channel = ast_dial_get_channel(dial, 0))) {
return;
}
@@ -10078,7 +10076,7 @@
return -1;
}
- dialed = ast_dial_channel(outgoing->dial, 0);
+ dialed = ast_dial_get_channel(outgoing->dial, 0);
ast_set_variables(dialed, vars);
@@ -10147,7 +10145,7 @@
*reason = ast_dial_reason(outgoing->dial, 0);
}
- if (ast_dial_state(outgoing->dial) != AST_DIAL_RESULT_ANSWERED &&
+ if ((synchronous > 1) && ast_dial_state(outgoing->dial) != AST_DIAL_RESULT_ANSWERED &&
ast_strlen_zero(app) && ast_exists_extension(NULL, context, "failed", 1, NULL)) {
struct ast_channel *failed = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", NULL, 0, "OutgoingSpoolFailed");
More information about the asterisk-commits
mailing list