XML Dialplan cookbook
We present here a few scenarios that you may need to refer to from time-to-time because they are relatively common. The examples presented in this section are in the mold of the traditional cookbook full of recipes for the reader to try. Feel free to use and modify these recipes in your custom Dialplans.
Match by IP address and call a number
In the following example, the
particular extension will be selected only if the IP address of the calling endpoint is 192.168.1.1
. In the second condition, the dialed number is extracted in variable $1
and put in the data of the bridge
application, in order to dial out to IP address 192.168.2.2
.
<extension name="Test1"> <condition field="network_addr" expression="^192\.168\.1\.1$"/> <condition field="destination_number" expression="^(\d+)$"> <action application="bridge" data="sofia/profilename/$1@192.168.2.2"/> </condition> </extension>
The first condition field is terminated...