mod_dptools: redirect
About
Can redirect a channel to another endpoint, you must take care to not redirect incompatible channels, as that wont have the desired effect.
Click here to expand Table of Contents
Examples
If you redirect to a SIP url it should be a SIP channel. By providing a single SIP URI FreeSWITCH will issue a 302 "Moved Temporarily".
<action application="redirect" data="sip:foo@bar.com "/>
By providing multiple SIP URIs separated by a comma FreeSWITCH will send a 300 "Multiple Choices" (as of commit e15abcf9aaf6742765debb7ccb101965f5eae51b):
<action application="redirect" data="sip:foo@bar.com,sip:foo@end.com"/>
The 300 sent by FreeSWITCH will have multiple Contact: headers with each value.
redirect can only be used on new incoming calls that haven't been answered (Answer app). If the call has been answered, use the Deflect application instead.
Tips
Click here to expand...
--------------------------------
Server A where a phone is registered
--------------------------------
Server A make profile int/ext profiles use TCP transport
./sip_profile/internal.xml
<param name="bind-params" value="transport=tcp"/>
./sip_profile/external.xml
<param name="bind-params" value="transport=tcp"/>
--------------------------------
Server A Dialplan, I dial 9, and 8378 to send call to server B, where B external profile handles call
./dialplan/default.xml
<extension name="call_fs_right">
<condition field="destination_number" expression="^9(\d+)$">
<action application="answer"/>
<action application="bridge" data="sofia/external/sip:$1@192.168.150.3:5080"/>
</condition>
</extension>
--------------------------------
Sever B where redirect happens
--------------------------------
Sever B make external profile use TCP transport
./sip_profile/external.xml
<param name="bind-params" value="transport=tcp"/>
--------------------------------
Server B public dialplan I redirect call without answering it
./dialplan/public.xml
<extension name="redirect call">
<condition field="destination_number" expression="^(test|8378)$">
<action application="redirect" data="sip:music@iptel.org"/>
</condition>
</extension>
---------------------------------