ast_verb(3,"Attempting call on %s/%s for application %s(%s) (Retry %d)\n",o->tech,o->dest,o->app,o->data,o->retries);
res=ast_pbx_outgoing_app(o->tech,AST_FORMAT_SLINEAR,o->dest,o->waittime*1000,o->app,o->data,&reason,2/* wait to finish */,o->cid_num,o->cid_name,o->vars,o->account,NULL);
res=ast_pbx_outgoing_app(o->tech,o->format,o->dest,o->waittime*1000,o->app,o->data,&reason,2/* wait to finish */,o->cid_num,o->cid_name,o->vars,o->account,NULL);
}else{
ast_verb(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,AST_FORMAT_SLINEAR,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);
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);
}
if(res){
ast_log(LOG_NOTICE,"Call failed to go through, reason (%d) %s\n",reason,ast_channel_reason2str(reason));