mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
Add copyright headers. Formatting cleanup.
This commit is contained in:
@@ -43,7 +43,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
|
||||
Hashtable response = new Hashtable();
|
||||
|
||||
foreach(DictionaryEntry item in request)
|
||||
foreach (DictionaryEntry item in request)
|
||||
{
|
||||
m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value);
|
||||
}
|
||||
@@ -52,37 +52,37 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
response["keepalive"] = false;
|
||||
response["int_response_code"]=200;
|
||||
response["str_response_string"] = @"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||
<document type=""freeswitch/xml"">
|
||||
<section name=""dialplan"">
|
||||
<context name=""default"">
|
||||
|
||||
<!-- dial via SIP uri -->
|
||||
<extension name=""sip_uri"">
|
||||
<condition field=""destination_number"" expression=""^sip:(.*)$"">
|
||||
<action application=""bridge"" data=""sofia/${use_profile}/$1""/>
|
||||
<!--<action application=""bridge"" data=""$1""/>-->
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name=""opensim_conferences"">
|
||||
<condition field=""destination_number"" expression=""^confctl-(.*)$"">
|
||||
<action application=""answer""/>
|
||||
<action application=""conference"" data=""$1-${domain_name}@default""/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name=""avatar"">
|
||||
<condition field=""destination_number"" expression=""^(x.*)$"">
|
||||
<action application=""bridge"" data=""user/$1""/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
</context>
|
||||
</section>
|
||||
</document>";
|
||||
<document type=""freeswitch/xml"">
|
||||
<section name=""dialplan"">
|
||||
<context name=""default"">
|
||||
|
||||
<!-- dial via SIP uri -->
|
||||
<extension name=""sip_uri"">
|
||||
<condition field=""destination_number"" expression=""^sip:(.*)$"">
|
||||
<action application=""bridge"" data=""sofia/${use_profile}/$1""/>
|
||||
<!--<action application=""bridge"" data=""$1""/>-->
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name=""opensim_conferences"">
|
||||
<condition field=""destination_number"" expression=""^confctl-(.*)$"">
|
||||
<action application=""answer""/>
|
||||
<action application=""conference"" data=""$1-${domain_name}@default""/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name=""avatar"">
|
||||
<condition field=""destination_number"" expression=""^(x.*)$"">
|
||||
<action application=""bridge"" data=""user/$1""/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
</context>
|
||||
</section>
|
||||
</document>";
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
//domain=9.20.151.43
|
||||
//ip=9.167.220.137 // this is the correct IP rather than sip_contact_host above when through a vpn or NAT setup
|
||||
|
||||
foreach(DictionaryEntry item in request)
|
||||
foreach (DictionaryEntry item in request)
|
||||
{
|
||||
m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value);
|
||||
}
|
||||
@@ -71,41 +71,41 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
string eventCallingFunction = (string) request["Event-Calling-Function"];
|
||||
|
||||
|
||||
if(eventCallingFunction=="sofia_reg_parse_auth")
|
||||
if (eventCallingFunction=="sofia_reg_parse_auth")
|
||||
{
|
||||
string sipAuthMethod = (string)request["sip_auth_method"];
|
||||
|
||||
if(sipAuthMethod=="REGISTER")
|
||||
{
|
||||
response = HandleRegister(request);
|
||||
}
|
||||
else if(sipAuthMethod=="INVITE")
|
||||
{
|
||||
response = HandleInvite(request);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown sip_auth_method {0}",sipAuthMethod);
|
||||
response["int_response_code"]=404;
|
||||
}
|
||||
|
||||
if (sipAuthMethod=="REGISTER")
|
||||
{
|
||||
response = HandleRegister(request);
|
||||
}
|
||||
else if (sipAuthMethod=="INVITE")
|
||||
{
|
||||
response = HandleInvite(request);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown sip_auth_method {0}",sipAuthMethod);
|
||||
response["int_response_code"]=404;
|
||||
}
|
||||
}
|
||||
else if(eventCallingFunction=="switch_xml_locate_user")
|
||||
{
|
||||
response = HandleLocateUser(request);
|
||||
}
|
||||
else if(eventCallingFunction=="user_data_function") // gets called when an avatar to avatar call is made
|
||||
else if (eventCallingFunction=="switch_xml_locate_user")
|
||||
{
|
||||
response = HandleLocateUser(request);
|
||||
}
|
||||
else if(eventCallingFunction=="user_outgoing_channel")
|
||||
else if (eventCallingFunction=="user_data_function") // gets called when an avatar to avatar call is made
|
||||
{
|
||||
response = HandleLocateUser(request);
|
||||
}
|
||||
else if (eventCallingFunction=="user_outgoing_channel")
|
||||
{
|
||||
response = HandleRegister(request);
|
||||
}
|
||||
else if(eventCallingFunction=="config_sofia") // happens once on freeswitch startup
|
||||
else if (eventCallingFunction=="config_sofia") // happens once on freeswitch startup
|
||||
{
|
||||
response = HandleConfigSofia(request);
|
||||
}
|
||||
else if(eventCallingFunction=="switch_load_network_lists")
|
||||
else if (eventCallingFunction=="switch_load_network_lists")
|
||||
{
|
||||
//response = HandleLoadNetworkLists(request);
|
||||
response["int_response_code"]=404;
|
||||
@@ -266,24 +266,24 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
"<groups name=\"default\">\r\n"+
|
||||
"<users>\r\n"+
|
||||
"<user id=\"$${{default_provider}}\">\r\n"+
|
||||
"<gateways>\r\n"+
|
||||
"<gateway name=\"$${{default_provider}}\">\r\n"+
|
||||
"<param name=\"username\" value=\"$${{default_provider_username}}\"/>\r\n"+
|
||||
"<param name=\"password\" value=\"$${{default_provider_password}}\"/>\r\n"+
|
||||
"<param name=\"from-user\" value=\"$${{default_provider_username}}\"/>\r\n"+
|
||||
"<param name=\"from-domain\" value=\"$${{default_provider_from_domain}}\"/>\r\n"+
|
||||
"<param name=\"expire-seconds\" value=\"600\"/>\r\n"+
|
||||
"<param name=\"register\" value=\"$${{default_provider_register}}\"/>\r\n"+
|
||||
"<param name=\"retry-seconds\" value=\"30\"/>\r\n"+
|
||||
"<param name=\"extension\" value=\"$${{default_provider_contact}}\"/>\r\n"+
|
||||
"<param name=\"contact-params\" value=\"domain_name=$${{domain}}\"/>\r\n"+
|
||||
"<param name=\"context\" value=\"public\"/>\r\n"+
|
||||
"</gateway>\r\n"+
|
||||
"</gateways>\r\n"+
|
||||
"<params>\r\n"+
|
||||
"<param name=\"password\" value=\"$${{default_provider_password}}\"/>\r\n"+
|
||||
"</params>\r\n"+
|
||||
"</user>\r\n"+
|
||||
"<gateways>\r\n"+
|
||||
"<gateway name=\"$${{default_provider}}\">\r\n"+
|
||||
"<param name=\"username\" value=\"$${{default_provider_username}}\"/>\r\n"+
|
||||
"<param name=\"password\" value=\"$${{default_provider_password}}\"/>\r\n"+
|
||||
"<param name=\"from-user\" value=\"$${{default_provider_username}}\"/>\r\n"+
|
||||
"<param name=\"from-domain\" value=\"$${{default_provider_from_domain}}\"/>\r\n"+
|
||||
"<param name=\"expire-seconds\" value=\"600\"/>\r\n"+
|
||||
"<param name=\"register\" value=\"$${{default_provider_register}}\"/>\r\n"+
|
||||
"<param name=\"retry-seconds\" value=\"30\"/>\r\n"+
|
||||
"<param name=\"extension\" value=\"$${{default_provider_contact}}\"/>\r\n"+
|
||||
"<param name=\"contact-params\" value=\"domain_name=$${{domain}}\"/>\r\n"+
|
||||
"<param name=\"context\" value=\"public\"/>\r\n"+
|
||||
"</gateway>\r\n"+
|
||||
"</gateways>\r\n"+
|
||||
"<params>\r\n"+
|
||||
"<param name=\"password\" value=\"$${{default_provider_password}}\"/>\r\n"+
|
||||
"</params>\r\n"+
|
||||
"</user>\r\n"+
|
||||
"</users>"+
|
||||
"</groups>\r\n" +
|
||||
"<variables>\r\n"+
|
||||
@@ -332,4 +332,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
// is this a dialplan or directory request
|
||||
string section = (string) requestBody["section"];
|
||||
|
||||
if(section=="directory")
|
||||
if (section=="directory")
|
||||
response = m_FreeSwitchDirectory.HandleDirectoryRequest(requestBody);
|
||||
else if (section=="dialplan")
|
||||
response = m_FreeSwitchDialplan.HandleDialplanRequest(requestBody);
|
||||
|
||||
Reference in New Issue
Block a user