prevent seg fault with attempt_transfer (bug #2741)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2004-11-02 12:56:15 +00:00
parent 808ecc893a
commit d612a5ce42
3 changed files with 61 additions and 38 deletions

View File

@@ -302,6 +302,12 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
int allowdisconnect_in,allowdisconnect_out,allowredirect_in,allowredirect_out;
char *monitor_exec;
if (chan && peer) {
pbx_builtin_setvar_helper(chan, "BRIDGEPEER", peer->name);
pbx_builtin_setvar_helper(peer, "BRIDGEPEER", chan->name);
} else if (chan)
pbx_builtin_setvar_helper(chan, "BLINDTRANSFER", NULL);
if (monitor_ok) {
if (!monitor_app) {
if (!(monitor_app = pbx_findapp("Monitor")))
@@ -480,6 +486,8 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
}
/* XXX Maybe we should have another message here instead of invalid extension XXX */
} else if (ast_exists_extension(transferee, transferer_real_context, newext, 1, transferer->callerid)) {
pbx_builtin_setvar_helper(peer, "BLINDTRANSFER", chan->name);
pbx_builtin_setvar_helper(chan, "BLINDTRANSFER", peer->name);
ast_moh_stop(transferee);
res=ast_autoservice_stop(transferee);
if (!transferee->pbx) {