summaryrefslogtreecommitdiffstats
path: root/contrib/testpbx/configs/public.xml
blob: d9b1d1738cf47032007099184c0da95ed397a0ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!--
    NOTICE:

    This context is usually accessed via the external sip profile listening on port 5080.

    It is recommended to have separate inbound and outbound contexts.  Not only for security
    but clearing up why you would need to do such a thing.  You don't want outside un-authenticated
    callers hitting your default context which allows dialing calls thru your providers and results
    in Toll Fraud.
-->

<!-- http://wiki.freeswitch.org/wiki/Dialplan_XML -->
<include>
  <context name="public">

    <extension name="unloop">
      <condition field="${unroll_loops}" expression="^true$"/>
      <condition field="${sip_looped_call}" expression="^true$">
	<action application="deflect" data="${destination_number}"/>
      </condition>
    </extension>
    <!--
	Tag anything pass thru here as an outside_call so you can make sure not
	to create any routing loops based on the conditions that it came from
	the outside of the switch.
    -->
    <extension name="outside_call" continue="true">
      <condition>
	<action application="set" data="outside_call=true"/>
	<action application="export" data="RFC2822_DATE=${strftime(%a, %d %b %Y %T %z)}"/>
      </condition>
    </extension>

    <extension name="call_debug" continue="true">
      <condition field="${call_debug}" expression="^true$" break="never">
	<action application="info"/>
      </condition>
    </extension>

    <extension name="public_extensions">
      <condition field="destination_number" expression="^(10[01][0-9])$">
	<action application="transfer" data="$1 XML default"/>
      </condition>
    </extension>

    <!--
	You can place files in the public directory to get included.
    -->
    <X-PRE-PROCESS cmd="include" data="public/*.xml"/>
    <!--
	If you have made it this far lets challenge the caller and if they authenticate
	lets try what they dialed in the default context. (commented out by default)
    -->
    <!--
    <extension name="check_auth" continue="true">
      <condition field="${sip_authorized}" expression="^true$" break="never">
	<anti-action application="respond" data="407"/>
      </condition>
    </extension>

    -->
    <extension name="transfer_to_default">
      <condition>
	<action application="transfer" data="${destination_number} XML default"/>
      </condition>
    </extension>
  </context>
</include>