<h1>Project "FreeSWITCH user-contributed scripts, etc" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
discards 9ff716208ae05c3e9cb55d639243371e8553bb17 (commit)
discards a4349bbeba56858b0c17f8b69ed69ecebba0bc58 (commit)
discards d93d8a0e353b8a112167961178bffda485356ee7 (commit)
discards f192c27939941db18bdf2c543a9e14b21ae16fd0 (commit)
via: 319c6bf92e7368d4ce0c7bfdd2efb569368579f2 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (9ff716208ae05c3e9cb55d639243371e8553bb17)
\
N -- N -- N (319c6bf92e7368d4ce0c7bfdd2efb569368579f2)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Mitch Capper
comments:
Fixed TLS / secure params and support secure media outbound dialing. Added checks to make sure certs are where they need to be for TLS to work properly.
<span style="color: #000080; font-weight: bold">diff --git a/mitchcapper/FSClient/Account.cs b/mitchcapper/FSClient/Account.cs</span>
<span style="color: #000080; font-weight: bold">index 59f0197..5d86035 100644</span>
<span style="color: #A00000">--- a/mitchcapper/FSClient/Account.cs</span>
<span style="color: #00A000">+++ b/mitchcapper/FSClient/Account.cs</span>
<span style="color: #800080; font-weight: bold">@@ -2,6 +2,7 @@</span>
using System;
using System.Collections.ObjectModel;
using System.Linq;
<span style="color: #00A000">+using System.Windows;</span>
using System.Xml;
using FreeSWITCH.Native;
using System.Xml.Serialization;
<span style="color: #800080; font-weight: bold">@@ -49,15 +50,17 @@ namespace FSClient {</span>
                                                                        new        Field(Field.FIELD_TYPE.String, "SIP URL for Checking Voicemail","sip_check_voicemail_url","","",""),
                                                                        new        Field(Field.FIELD_TYPE.String, "SIP URL for Sending to Voicemail","sip_send_voicemail_url","","",""),
                                                                        new Field(Field.FIELD_TYPE.Bool,"Register","register","register","true",""),
<span style="color: #00A000">+                                                                        new Field(Field.FIELD_TYPE.Combo,"Register Transport","register-transport","register-transport","udp","", "udp","tcp","sctp","tls"),</span>
<span style="color: #00A000">+                                                                        new Field(Field.FIELD_TYPE.Bool,"SIP Secure Media","sip_secure_media","sip_secure_media","false",""),</span>
<span style="color: #00A000">+</span>
                                                                        new Field(Field.FIELD_TYPE.String,"Proxy","proxy","proxy","","Advanced"),
<span style="color: #00A000">+                                                                        new Field(Field.FIELD_TYPE.Int,"Ping Seconds","ping","ping","30","Advanced"),</span>
                                                                        new Field(Field.FIELD_TYPE.String,"Outbound Proxy","outbound-proxy","outbound-proxy","","Advanced"),
                                                                        new Field(Field.FIELD_TYPE.String,"Register Proxy","register-proxy","register-proxy","","Advanced"),
<span style="color: #A00000">-                                                                        </span>
                                                                        new Field(Field.FIELD_TYPE.Int,"Expire Seconds","expire-seconds","expire-seconds","3600","Advanced"),
                                                                        new Field(Field.FIELD_TYPE.Int,"Retry Seconds","retry-seconds","retry-seconds","30","Advanced"),
<span style="color: #A00000">-                                                                        new Field(Field.FIELD_TYPE.Int,"Ping Seconds","ping","ping","30","Advanced"),</span>
<span style="color: #A00000">-                                                                        new Field(Field.FIELD_TYPE.Combo,"Register Transport","register-transport","register-transport","udp","Advanced", "udp","tcp","sctp","tls"),</span>
<span style="color: #A00000">-                                                                        new Field(Field.FIELD_TYPE.Bool,"SIP Secure Media","sip_secure_media","sip_secure_media","false","")</span>
<span style="color: #00A000">+                                                                        new Field(Field.FIELD_TYPE.String,"Contact Params","contact-params","contact-params","","Advanced")</span>
<span style="color: #00A000">+</span>
                                                                 };
                #region Static Methods
<span style="color: #800080; font-weight: bold">@@ -131,10 +134,10 @@ namespace FSClient {</span>
                        ReloadSofia();
                }
<span style="color: #A00000">-                public static void create_gateway_nodes(XmlNode gateways_node) {</span>
<span style="color: #00A000">+                public static void create_gateway_nodes(XmlNode gateways_node, bool tls_enabled) {</span>
                        foreach (Account account in accounts) {
                                if (account.enabled)
<span style="color: #A00000">-                                        account.create_gateway_node(gateways_node);</span>
<span style="color: #00A000">+                                        account.create_gateway_node(gateways_node,tls_enabled);</span>
                        }
                }
                public static void HandleGatewayEvent(FSEvent evt) {
<span style="color: #800080; font-weight: bold">@@ -197,7 +200,8 @@ namespace FSClient {</span>
                public void CreateCall(String number) {
                        if (!enabled)
                                return;
<span style="color: #A00000">-                        PortAudio.Call("sofia/gateway/" + gateway_id + "/" + number);</span>
<span style="color: #00A000">+                        String sec_media = secure_media ? "{sip_secure_media=true}" : "";</span>
<span style="color: #00A000">+                        PortAudio.Call(sec_media + "sofia/gateway/" + gateway_id + "/" + number);</span>
                }
                private void KillGateway() {
                        if (!String.IsNullOrEmpty(old_gateway_id))
<span style="color: #800080; font-weight: bold">@@ -269,6 +273,16 @@ namespace FSClient {</span>
                }
                private bool _enabled;
<span style="color: #00A000">+                public bool secure_media {</span>
<span style="color: #00A000">+                        get { return _secure_media; }</span>
<span style="color: #00A000">+                        private set {</span>
<span style="color: #00A000">+                                if (value == _secure_media)</span>
<span style="color: #00A000">+                                        return;</span>
<span style="color: #00A000">+                                _secure_media = value;</span>
<span style="color: #00A000">+                                RaisePropertyChanged("secure_media");</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+                private bool _secure_media;</span>
                public string name {
                        get { return _name.value; }
<span style="color: #800080; font-weight: bold">@@ -317,13 +331,22 @@ namespace FSClient {</span>
                                Broker.get_instance().reload_sofia(Sofia.RELOAD_CONFIG_MODE.SOFT);
                }
<span style="color: #A00000">-                private void create_gateway_node(XmlNode gateways_node) {</span>
<span style="color: #00A000">+                private void create_gateway_node(XmlNode gateways_node, bool tls_enabled) {</span>
                        XmlNode node = XmlUtils.AddNodeNode(gateways_node, "gateway");
                        XmlUtils.AddNodeAttrib(node, "name", gateway_id);
                        old_gateway_id = gateway_id;
                        foreach (FieldValue value in values) {
<span style="color: #A00000">-                                if (!String.IsNullOrEmpty(value.field.xml_name))</span>
<span style="color: #00A000">+                                if (!String.IsNullOrEmpty(value.field.xml_name)){</span>
<span style="color: #00A000">+                                        if (value.field.name == "register-transport" && value.value == "tls" && ! tls_enabled){</span>
<span style="color: #00A000">+                                                MessageBox.Show("Warning the register-transport for account: " + name + " is set to tls, however you have tls disabled in your sofia settings this account will be disabled for now");</span>
<span style="color: #00A000">+                                                gateways_node.RemoveChild(node);</span>
<span style="color: #00A000">+                                                enabled = false;</span>
<span style="color: #00A000">+                                                return;</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #00A000">+                                        if (value.field.name == "sip_secure_media")</span>
<span style="color: #00A000">+                                                secure_media = value.value == "true";</span>
                                        Utils.add_xml_param(node, value.field.xml_name, value.value);
<span style="color: #00A000">+                                }</span>
                        }
                        //Was preventing gateway ID from being passed to create_channel so removed (needed for incoming calls)
                        //FieldValue user = FieldValue.GetByName(values, "username");
<span style="color: #000080; font-weight: bold">diff --git a/mitchcapper/FSClient/Sofia.cs b/mitchcapper/FSClient/Sofia.cs</span>
<span style="color: #000080; font-weight: bold">index b3f3b3d..4051172 100644</span>
<span style="color: #A00000">--- a/mitchcapper/FSClient/Sofia.cs</span>
<span style="color: #00A000">+++ b/mitchcapper/FSClient/Sofia.cs</span>
<span style="color: #800080; font-weight: bold">@@ -46,11 +46,13 @@ namespace FSClient {</span>
                                                                                        /*Security*/
                                                                                        new Field(Field.FIELD_TYPE.Bool,"TLS","tls","tls","false","Security"),
<span style="color: #A00000">-                                                                                        new Field(Field.FIELD_TYPE.Combo,"TLS Version","tls-version","tls-version","tlsv1","Security","tlsv1","sslv23"),</span>
<span style="color: #00A000">+                                                                                        new Field(Field.FIELD_TYPE.Combo,"TLS Verify Policy","tls-verify-policy","tls-verify-policy","subjects_out","Security",new Field.FieldOption{display_value="None", value=""},new Field.FieldOption{display_value="Outbound Certificates", value="out"},new Field.FieldOption{display_value="Outbound Certs & Hostnames", value="subjects_out"}),</span>
<span style="color: #00A000">+                                                                                        new Field(Field.FIELD_TYPE.Combo,"TLS Version","tls-version","tls-version","sslv23","Security","sslv23","tlsv1"),</span>
                                                                                        new Field(Field.FIELD_TYPE.String,"TLS Bind Params","tls-bind-params","tls-bind-params","transport=tls","Security"),
                                                                                        new Field(Field.FIELD_TYPE.Int,"TLS SIP Port","tls-sip-port","tls-sip-port","12347","Security"),
<span style="color: #A00000">-                                                                                        new Field(Field.FIELD_TYPE.Bool,"Auth All Packets","auth-all-packets","auth-all-packets","false","Security"),</span>
<span style="color: #A00000">-                                                                                        new Field(Field.FIELD_TYPE.Bool,"Auth Calls","auth-calls","auth-calls","false","Security"),</span>
<span style="color: #00A000">+                                                                                        new Field(Field.FIELD_TYPE.String,"TLS Certificate Directory","tls-cert-dir","tls-cert-dir","conf/ssl","Security"),</span>
<span style="color: #00A000">+                                                                                        new Field(Field.FIELD_TYPE.Int,"TLS Max Verify Depth","tls-verify-depth","tls-verify-depth","2","Security"),</span>
<span style="color: #00A000">+                                                                                        new Field(Field.FIELD_TYPE.Bool,"TLS No Certificate Date Validation","tls-no-verify-date","tls-no-verify-date","false","Security"),</span>
                                                                                        /*Advanced*/
                                                                                        new Field(Field.FIELD_TYPE.String,"Challenge Realm","challenge-realm","challenge-realm","auto_from","Advanced"),
<span style="color: #800080; font-weight: bold">@@ -66,7 +68,7 @@ namespace FSClient {</span>
                                                                                        new Field(Field.FIELD_TYPE.Int,"RTP Hold Timeout Seconds","rtp-hold-timeout-sec","rtp-hold-timeout-sec","1800","Advanced"),
                                                                                        new Field(Field.FIELD_TYPE.Int,"RTP Tiemout Seconds","rtp-timeout-sec","rtp-timeout-sec","300","Advanced"),
                                                                                        new Field(Field.FIELD_TYPE.String,"RTP Timer Name","rtp-timer-name","rtp-timer-name","soft","Advanced"),
<span style="color: #A00000">-                                                                                        </span>
<span style="color: #00A000">+</span>
                                                                         };
<span style="color: #800080; font-weight: bold">@@ -80,18 +82,35 @@ namespace FSClient {</span>
                        XmlNode profile = XmlUtils.AddNodeNode(profiles, "profile");
                        XmlUtils.AddNodeAttrib(profile, "name", "softphone");
                        XmlNode gateways = XmlUtils.AddNodeNode(profile, "gateways");
<span style="color: #A00000">-                        Account.create_gateway_nodes(gateways);</span>
<span style="color: #00A000">+                        Account.create_gateway_nodes(gateways,FieldValue.GetByName(values, "tls").value == "true");</span>
                        XmlNode settings = XmlUtils.AddNodeNode(profile, "settings");
                        Utils.add_xml_param(settings, "context", "public");
                        Utils.add_xml_param(settings, "dialplan", "xml");
                        Utils.add_xml_param(settings, "disable-register", "true");
                        foreach (FieldValue value in values) {
<span style="color: #A00000">-                                if (!String.IsNullOrEmpty(value.field.xml_name))</span>
<span style="color: #A00000">-                                        Utils.add_xml_param(settings, value.field.xml_name, value.value);</span>
<span style="color: #00A000">+                                if (!String.IsNullOrEmpty(value.field.xml_name)){</span>
<span style="color: #00A000">+                                        String param_value = value.value;</span>
<span style="color: #00A000">+                                        if (value.field.name == "tls" && value.value == "true") {//lets make sure that we have a cafile.pem</span>
<span style="color: #00A000">+                                                </span>
<span style="color: #00A000">+                                                String base_dir = FieldValue.GetByName(values, "tls-cert-dir").value;</span>
<span style="color: #00A000">+                                                if (String.IsNullOrWhiteSpace(base_dir))</span>
<span style="color: #00A000">+                                                        base_dir = "conf/ssl";</span>
<span style="color: #00A000">+                                                                //this is what freeswitch uses by default if its empty, if this changes this code needs to be updated</span>
<span style="color: #00A000">+                                                base_dir = base_dir.Replace('/', '\\'); //windows file path</span>
<span style="color: #00A000">+                                                if (base_dir[base_dir.Length - 1] != '\\')</span>
<span style="color: #00A000">+                                                        base_dir += '\\';</span>
<span style="color: #00A000">+                                                if (!System.IO.File.Exists(base_dir + "cafile.pem")){</span>
<span style="color: #00A000">+                                                        MessageBox.Show("Your sofia settings have TLS enabled however you do not have a cafile.pem in your cert folder, this will most likely cause the entire softphone profile not to load so I am disabling TLS in the profile for now");</span>
<span style="color: #00A000">+                                                        param_value = "false";</span>
<span style="color: #00A000">+                                                }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                        }</span>
<span style="color: #00A000">+                                        Utils.add_xml_param(settings, value.field.xml_name, param_value);</span>
<span style="color: #00A000">+                                }</span>
                        }
<span style="color: #A00000">-</span>
<span style="color: #00A000">+                        DelayedFunction.DelayedCall("SofiaProfileCheck", sofia_profile_check, 1200);</span>
                }
                public enum RELOAD_CONFIG_MODE {
<span style="color: #800080; font-weight: bold">@@ -106,11 +125,9 @@ namespace FSClient {</span>
                                        break;
                                case RELOAD_CONFIG_MODE.HARD:
                                        Utils.api_exec("sofia", "profile softphone restart reloadxml");
<span style="color: #A00000">-                                        DelayedFunction.DelayedCall("SofiaProfileCheck", sofia_profile_check, 100);</span>
                                        break;
                                case RELOAD_CONFIG_MODE.MODULE:
                                        Utils.api_exec("reload", "mod_sofia");
<span style="color: #A00000">-                                        DelayedFunction.DelayedCall("SofiaProfileCheck", sofia_profile_check, 500);</span>
                                        break;
                        }
                }
</pre></div>
========================================================================<pre>
Summary of changes:
hunmonk/jester/conf.lua | 1 -
hunmonk/jester/modules/record/help.lua | 4 +-
hunmonk/jester/modules/service/conf.lua | 5 --
hunmonk/jester/modules/service/help.lua | 39 ------------
hunmonk/jester/modules/service/service.lua | 91 ----------------------------
mitchcapper/FSClient/Account.cs | 41 ++++++++++---
mitchcapper/FSClient/Sofia.cs | 37 ++++++++---
7 files changed, 61 insertions(+), 157 deletions(-)
delete mode 100644 hunmonk/jester/modules/service/conf.lua
delete mode 100644 hunmonk/jester/modules/service/help.lua
delete mode 100644 hunmonk/jester/modules/service/service.lua
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH user-contributed scripts, etc</p>