Skip to main content

Asterisk

Dialplan

When generating a UCS dialplan, it adds content to the /etc/asterisk/extensions.conf file of the /etc/asterisk/extensions.merge file.

Hooks for outgoing calls

For outgoing UCS filters, it is possible to perform a hook, which is executed for each outgoing call. Hooks are defined in the outgoinghooks context, each hook has an extension filter<Filter ID in UCS>. Hook statements are executed using Gosub(outgoinghooks,filter\<Filter ID in UCS\>,1(<Trunk ID in UCS>,\$\{EXTEN\})). They are added via the /etc/asterisk/extensions.merge file:

[outgoinghooks]
exten => filter1,1,Verbose(1,Outgoing call through filter ID 1 via trunk ID ${ARG1} to number ${ARG2})
exten => filter1,n,SIPAddHeader(X-Email:name@customer.com)
exten => filter1,n,Return()

exten => filter2,1,Verbose(1,Outgoing call through filter ID 2 via trunk ID ${ARG1} to number ${ARG2})
exten => filter2,n,Set(CALLERID(name)=Oldřich Lavička)
exten => filter2,n,Return()
warning

Be sure to end the hook for each filter with a Return() command, otherwise Asterisk will terminate the call at the end of that hook.