dect
/
asterisk
Archived
13
0
Fork 0

minor cleanup

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@21878 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
rizzo 2006-04-21 12:12:42 +00:00
parent 78de33e15b
commit d8d540470f
1 changed files with 6 additions and 9 deletions

15
pbx.c
View File

@ -4157,9 +4157,10 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex
/* In order to do it when the channel doesn't really exist within /* In order to do it when the channel doesn't really exist within
the PBX, we have to make a new channel, masquerade, and start the PBX the PBX, we have to make a new channel, masquerade, and start the PBX
at the new location */ at the new location */
struct ast_channel *tmpchan; struct ast_channel *tmpchan = ast_channel_alloc(0);
tmpchan = ast_channel_alloc(0); if (!tmpchan)
if (tmpchan) { res = -1;
else {
ast_string_field_build(tmpchan, name, "AsyncGoto/%s", chan->name); ast_string_field_build(tmpchan, name, "AsyncGoto/%s", chan->name);
ast_setstate(tmpchan, chan->_state); ast_setstate(tmpchan, chan->_state);
/* Make formats okay */ /* Make formats okay */
@ -4167,9 +4168,7 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex
tmpchan->writeformat = chan->writeformat; tmpchan->writeformat = chan->writeformat;
/* Setup proper location */ /* Setup proper location */
ast_explicit_goto(tmpchan, ast_explicit_goto(tmpchan,
S_OR(context, chan->context), S_OR(context, chan->context), S_OR(exten, chan->exten), priority);
S_OR(exten, chan->exten),
priority);
/* Masquerade into temp channel */ /* Masquerade into temp channel */
ast_channel_masquerade(tmpchan, chan); ast_channel_masquerade(tmpchan, chan);
@ -4184,8 +4183,6 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex
ast_hangup(tmpchan); ast_hangup(tmpchan);
res = -1; res = -1;
} }
} else {
res = -1;
} }
} }
ast_mutex_unlock(&chan->lock); ast_mutex_unlock(&chan->lock);
@ -4288,7 +4285,7 @@ int ast_add_extension2(struct ast_context *con,
if (callerid) if (callerid)
length += strlen(callerid) + 1; length += strlen(callerid) + 1;
else else
length ++; length ++; /* just the '\0' */
/* Be optimistic: Build the extension structure first */ /* Be optimistic: Build the extension structure first */
if (datad == NULL) if (datad == NULL)