public.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!--
  2. NOTICE:
  3. This context is usually accessed via the external sip profile sitting on port 5080.
  4. It is recommended to have separate inbound and outbound contexts. Not only for security
  5. but clearing up why you would need to do such a thing. You don't want outside un-authenticated
  6. callers hitting your default context which allows dialing calls thru your providers and results
  7. in Toll Fraud.
  8. -->
  9. <!-- http://wiki.freeswitch.org/wiki/Dialplan_XML -->
  10. <include>
  11. <context name="public">
  12. <extension name="unloop">
  13. <condition field="$${unroll_loops}" expression="^true$"/>
  14. <condition field="${sip_looped_call}" expression="^true$">
  15. <action application="deflect" data="${destination_number}"/>
  16. </condition>
  17. </extension>
  18. <!--
  19. Tag anything pass thru here as an outside_call so you can make sure not
  20. to create any routing loops based on the conditions that it came from
  21. the outside of the switch.
  22. -->
  23. <extension name="outside_call" continue="true">
  24. <condition>
  25. <action application="set" data="outside_call=true"/>
  26. </condition>
  27. </extension>
  28. <extension name="call_debug" continue="true">
  29. <condition field="$${call_debug}" expression="^true$" break="never">
  30. <action application="info"/>
  31. </condition>
  32. </extension>
  33. <!-- Try to get domain_name from the sip_req_params variable -->
  34. <extension name="set_domain" continue="true">
  35. <condition field="${domain_name}" expression="^$"/>
  36. <condition field="source" expression="mod_sofia"/>
  37. <condition field="${sip_req_params}" expression="domain_name=([A-Z-a-z0-9.]+)">
  38. <!-- We need to export this so the B-Leg will have it after transfer too. -->
  39. <action application="export" data="domain_name=$1"/>
  40. <anti-action application="export" data="domain_name=${sip_req_host}"/>
  41. </condition>
  42. </extension>
  43. <extension name="public_extensions">
  44. <condition field="destination_number" expression="^(10[01][0-9])$">
  45. <action application="transfer" data="$1 XML default"/>
  46. </condition>
  47. </extension>
  48. <!--
  49. You can place files in the public directory to get included.
  50. -->
  51. <X-PRE-PROCESS cmd="include" data="public/*.xml"/>
  52. <!--
  53. If you have made it this far lets challenge the caller and if they authenticate
  54. lets try what they dialed in the default context. (commented out by default)
  55. -->
  56. <!--
  57. <extension name="check_auth" continue="true">
  58. <condition field="${sip_authorized}" expression="^true$" break="never">
  59. <anti-action application="respond" data="407"/>
  60. </condition>
  61. </extension>
  62. <extension name="transfer_to_default">
  63. <condition>
  64. <action application="transfer" data="${destination_number} XML default"/>
  65. </condition>
  66. </extension>
  67. -->
  68. </context>
  69. </include>