Merge "app_queue: Prevent crash when a call is forwarded to an invalid location" into 13

changes/36/3536/1
zuul 9 years ago committed by Gerrit Code Review
commit b3586baeea

@ -4838,6 +4838,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
char tmpchan[256];
char *stuff;
char *tech;
int failed = 0;
ast_copy_string(tmpchan, ast_channel_call_forward(o->chan), sizeof(tmpchan));
ast_copy_string(forwarder, ast_channel_name(o->chan), sizeof(forwarder));
@ -4950,14 +4951,20 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
if (ast_call(o->chan, stuff, 0)) {
ast_log(LOG_NOTICE, "Forwarding failed to dial '%s/%s'\n",
tech, stuff);
do_hang(o);
numnochan++;
failed = 1;
}
}
ast_channel_publish_dial(qe->chan, o->chan, stuff, NULL);
ast_channel_publish_dial_forward(qe->chan, original, o->chan, NULL,
"CANCEL", ast_channel_call_forward(original));
if (o->chan) {
ast_channel_publish_dial(qe->chan, o->chan, stuff, NULL);
}
if (failed) {
do_hang(o);
numnochan++;
}
/* Hangup the original channel now, in case we needed it */
ast_hangup(winner);

Loading…
Cancel
Save