Overview
Pre-dial handlers allow you to execute a dialplan subroutine on a channel before a call is placed but after the application performing a dial action is invoked. This means that the handlers are executed after the creation of the caller/callee channels, but before any actions have been taken to actually dial the callee channels. You can execute a dialplan subroutine on the caller channel and on each callee channel dialed.
There are two ways in which a pre-dial handler can be invoked:
- The 'B' option in an application executes a dialplan subroutine on the caller channel before any callee channels are created.
- The 'b' option in an application executes a dialplan subroutine on each callee channel after it is created but before the call is placed to the end-device.
Syntax
For Dial or FollowMe, handlers are invoked using similar nomenclature as other options (such as M or U in Dial) that cause some portion of the dialplan to execute.
b([[context^]exten^]priority[(arg1[^...][^argN])]) B([[context^]exten^]priority[(arg1[^...][^argN])])
Examples
The examples illustrated below use the following channels:
- SIP/foo is calling either SIP/bar, SIP/baz, or both
- SIP/foo is the caller
- SIP/bar is a callee
- SIP/baz is another callee
Example 1 - Executing a pre-dial handler on the caller channel
Example 1 CLI Output
<SIP/foo-123> Dial(SIP/bar,,B(default^caller_handler^1)) <SIP/foo-123> Executing default,caller_handler,1 <SIP/foo-123> In caller pre-dial handler! <SIP/foo-123> calling SIP/bar-124
Example 2 - Executing a pre-dial handler on a callee channel
Example 2 CLI Output
<SIP/foo-123> Dial(SIP/bar,,b(default^callee_handler^1)) <SIP/bar-124> Executing default,callee_handler,1 <SIP/bar-124> In callee pre-dial handler! <SIP/foo-123> calling SIP/bar-124
Example 3 - Executing a pre-dial handler on multiple callee channels
Example 3 CLI Output
<SIP/foo-123> Dial(SIP/bar&SIP/baz,,b(default^callee_handler^1)) <SIP/bar-124> Executing default,callee_handler,1 <SIP/bar-124> In callee pre-dial handler! <SIP/baz-125> Executing default,callee_handler,1 <SIP/baz-125> In callee pre-dial handler! <SIP/foo-123> calling SIP/bar-124 <SIP/foo-123> calling SIP/baz-125
No hay comentarios:
Publicar un comentario