public.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!--
  2. NOTICE:
  3. This context is usually accessed via the external sip profile listening 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. <action application="export" data="RFC2822_DATE=${strftime(%a, %d %b %Y %T %z)}"/>
  27. </condition>
  28. </extension>
  29. <extension name="call_debug" continue="true">
  30. <condition field="${call_debug}" expression="^true$" break="never">
  31. <action application="info"/>
  32. </condition>
  33. </extension>
  34. <extension name="public_extensions">
  35. <condition field="destination_number" expression="^(10[01][0-9])$">
  36. <action application="transfer" data="$1 XML default"/>
  37. </condition>
  38. </extension>
  39. <extension name="public_conference_extensions">
  40. <condition field="destination_number" expression="^(3[5-8][01][0-9])$">
  41. <action application="transfer" data="$1 XML default"/>
  42. </condition>
  43. </extension>
  44. <!--
  45. You can place files in the public directory to get included.
  46. -->
  47. <X-PRE-PROCESS cmd="include" data="public/*.xml"/>
  48. <!--
  49. If you have made it this far lets challenge the caller and if they authenticate
  50. lets try what they dialed in the default context. (commented out by default)
  51. -->
  52. <!--
  53. <extension name="check_auth" continue="true">
  54. <condition field="${sip_authorized}" expression="^true$" break="never">
  55. <anti-action application="respond" data="407"/>
  56. </condition>
  57. </extension>
  58. <extension name="transfer_to_default">
  59. <condition>
  60. <action application="transfer" data="${destination_number} XML default"/>
  61. </condition>
  62. </extension>
  63. -->
  64. </context>
  65. </include>