Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 361906) +++ channels/chan_dahdi.c (working copy) @@ -5893,7 +5893,7 @@ /* Data will be our digit string */ struct dahdi_pvt *pvt; char *parse; - int res = -1; + int res; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(destination); AST_APP_ARG(original); @@ -5940,10 +5940,17 @@ args.reason = NULL; } - pri_send_callrerouting_facility_exec(pvt->sig_pvt, chan->_state, args.destination, - args.original, args.reason); + res = pri_send_callrerouting_facility_exec(pvt->sig_pvt, chan->_state, + args.destination, args.original, args.reason); + if (!res) { + /* + * Wait up to 5 seconds for a reply before hanging up this call + * leg if the peer does not disconnect first. + */ + ast_safe_sleep(chan, 5000); + } - return res; + return -1; } #endif /* defined(HAVE_PRI_PROG_W_CAUSE) */ #endif /* defined(HAVE_PRI) */ Index: channels/sig_pri.c =================================================================== --- channels/sig_pri.c (revision 361906) +++ channels/sig_pri.c (working copy) @@ -7955,7 +7955,7 @@ int pri_send_callrerouting_facility_exec(struct sig_pri_chan *p, enum ast_channel_state chanstate, const char *destination, const char *original, const char *reason) { - int res = -1; + int res; sig_pri_lock_private(p);