/
freeswitch_xml.hrl
90 lines (83 loc) · 2.58 KB
/
freeswitch_xml.hrl
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
-define(EMPTYRESPONSE, ""). %"<document type=\"freeswitch/xml\"></document>").
%% not including dial string section so we can manually do the bridging
%% or something like that (ask Darren).
%% [Domain, User, Hash, ChannelVars]
-define(REGISTER_HASH_RESPONSE,
"<document type=\"freeswitch/xml\">
<section name=\"directory\">
<domain name=\"~s\">
<user id=\"~s\">
<params>
<param name=\"a1-hash\" value=\"~s\"/>
</params>
<variables>
~s
</variables>
</user>
</domain>
</section>
</document>").
%% [Domain, User, Password, ChannelVars]
-define(REGISTER_PASS_RESPONSE,
"<document type=\"freeswitch/xml\">
<section name=\"directory\">
<domain name=\"~s\">
<user id=\"~s\">
<params>
<param name=\"password\" value=\"~s\"/>
</params>
<variables>
~s
</variables>
</user>
</domain>
</section>
</document>").
%% create a list of these params to inject into the REGISTER_*_RESPONSE
-define(REGISTER_CHANNEL_PARAM, " <variable name=\"~s\" value=\"~s\" />~n").
-define(ROUTE_BRIDGE_RESPONSE,
"<document type=\"freeswitch/xml\">
<section name=\"dialplan\" description=\"Route Bridge Response\">
<context name=\"context_2\">
~s
</context>
</section>
</document>").
%% [IndexNum :: integer(), BypassMedia :: boolean
%% ,ChannelVars :: "{var=val}"
%% ,Route :: "sip:+12038293150@sip.flowroute.com"]
-define(ROUTE_BRIDGE_EXT,
"<extension name=\"match_~p\" continue=\"true\">
<condition>
<action application=\"set\" data=\"bypass_media=~s\"/>
<action application=\"set\" data=\"hangup_after_bridge=true\"/>
<action application=\"set\" data=\"failure_causes=NORMAL_CLEARING,ORIGINATOR_CANCEL,CRASH\"/>
<action application=\"bridge\" data=\"~ssofia/sipinterface_1/~s\" />
</condition>
</extension>").
-define(ROUTE_PARK_RESPONSE,
"<document type=\"freeswitch/xml\">
<section name=\"dialplan\" description=\"Route Park Response\">
<context name=\"context_2\">
<extension name=\"park\">
<condition>
<action application=\"park\" />
</condition>
</extension>
</context>
</section>
</document>").
-define(ROUTE_ERROR_RESPONSE,
"<document type=\"freeswitch/xml\">
<section name=\"dialplan\" description=\"Route Bridge Response\">
<context name=\"context_2\">
<action application=\"respond\" data=\"~s~s\" />
</context>
</section>
</document>").
-define(ROUTE_NOT_FOUND_RESPONSE,
"<document type=\"freeswitch/xml\">
<section name=\"result\">
<result status=\"not found\" />
</section>
</document>").