Predial-hook for specific Outbound Route

I want to have a custom script run before calling for a specific Outbound Route that does a lookup and CID lookup.
When using the macro-dialout-trunk-predial-hook it works fine and does as I’d expect, but when I change the context to outrt-5-custom (the Outbound Route I’m trying to apply to, it seems to do nothing.

[macro-dialout-trunk-predial-hook]
;[outrt-5-custom]
exten => s,1,Verbose(breakout_reached)
 same => n,Read(TICKET,"goodbye",,,3,5)
; same => n,Set(CALLERID(num)=${TICKET})
 same => n,Set(CHANNEL(hangup_handler_push)=out_ticket_hangup_handler,s,1) ;
 same => n,AGI(csm_number_check.php,${TICKET})

In Advanced Settings you can enable “Noop Traces” and the name of the outbound route will be populated to a channel variable, OUTBOUND_ROUTE_NAME.

1 Like

Thanks for the pointer on that, I’ve managed to use that. For benefit of future people finding this thread, my predial-hook now looks like this

[macro-dialout-trunk-predial-hook]
exten => s,1,GotoIf($["${OUTBOUND_ROUTE_NAME}" != "Test_Route"]?noMatch)
 same => n,Read(TICKET,"goodbye",,,3,5)
 same => n,Set(CHANNEL(hangup_handler_push)=out_ticket_hangup_handler,s,1) ;
 same => n,AGI(csm_number_check.php,${TICKET})
 same => n(noMatch),NoOp(Not a ticket related call)
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.