I should have taken a closer look at trunk/1.6.x, as this bug has already been
fixed in a much more simple manner, by just settings o->vars to NULL after the
ast_pbx_outgoing_* calls.
(issue #16554)
Reported by: mav3rick
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@241544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
ast_verbose(VERBOSE_PREFIX_3"Attempting call on %s/%s for %s@%s:%d (Retry %d)\n",o->tech,o->dest,o->exten,o->context,o->priority,o->retries);
res=ast_pbx_outgoing_exten(o->tech,o->format,o->dest,o->waittime*1000,o->context,o->exten,o->priority,&reason,2/* wait to finish */,o->cid_num,o->cid_name,o->vars,o->account,NULL);
}
o->vars=NULL;
if(res){
ast_log(LOG_NOTICE,"Call failed to go through, reason (%d) %s\n",reason,ast_channel_reason2str(reason));