via: d89c16dbe9b0293be09fc6f0d3d1905fd2470fd3 (commit)
from: 510a78e4ab5f20a15f09a69e39d4417da7a1dcf3 (commit)
= COMMIT LOG ===========================================================
committer: Mitch Capper
comments:
broker.cs: set event handlers to null to avoid pesky warning. Added no empty params check to EventSocket as it actually fixes a not yet patched issue in FS and add warning about tls port also if sofia cannot load and tls is enabled.
diff --git a/mitchcapper/FSClient/Broker.cs b/mitchcapper/FSClient/Broker.cs
index 959dc0d..7ba9817 100644
--- a/mitchcapper/FSClient/Broker.cs
+++ b/mitchcapper/FSClient/Broker.cs
@@ -481,7 +481,7 @@ namespace FSClient {
}
}
private bool _ClearDTMFS;
- public Utils.ObjectEventHandler<bool> ClearDTMFSChanged;
+ public Utils.ObjectEventHandler<bool> ClearDTMFSChanged = null;
public bool SpeakerphoneActive {
get { return _SpeakerphoneActive; }
@@ -525,7 +525,7 @@ namespace FSClient {
get { return _active_calls; }
}
private int _active_calls;
- public Utils.ObjectEventHandler<int> active_callsChanged;
+ public Utils.ObjectEventHandler<int> active_callsChanged = null;
public bool CanEnd //true when hangup would have an effect, an active call or a ringing call, dial tone
diff --git a/mitchcapper/FSClient/EventSocket.cs b/mitchcapper/FSClient/EventSocket.cs
index 76cc03b..3ba3fbb 100644
--- a/mitchcapper/FSClient/EventSocket.cs
+++ b/mitchcapper/FSClient/EventSocket.cs
@@ -33,12 +33,16 @@ namespace FSClient {
new Field(Field.FIELD_TYPE.Bool,"Nat Map","nat-map","nat-map","false",""),
new Field(Field.FIELD_TYPE.Combo,"Debug Mode","debug","debug","0","",new Field.FieldOption{display_value="true", value="1"},new Field.FieldOption{display_value="false", value="0"}),
};
+ private static string[] AllowedEmptyFields = new[] { "password", "listen-ip" };
public FieldValue[] values = FieldValue.FieldValues(fields);
public void gen_config(XmlNode config_node){
XmlNode settings = XmlUtils.AddNodeNode(config_node, "settings");
foreach (FieldValue value in values) {
- if (!String.IsNullOrEmpty(value.field.xml_name))
- Utils.add_xml_param(settings, value.field.xml_name, value.value);
+ if (String.IsNullOrEmpty(value.field.xml_name))
+ continue;
+ if (String.IsNullOrWhiteSpace(value.value) && !AllowedEmptyFields.Contains(value.field.name))
+ continue;
+ Utils.add_xml_param(settings, value.field.xml_name, value.value);
}
}
public void reload_config(){
diff --git a/mitchcapper/FSClient/Sofia.cs b/mitchcapper/FSClient/Sofia.cs
index 83dbbb5..40c1ad7 100644
--- a/mitchcapper/FSClient/Sofia.cs
+++ b/mitchcapper/FSClient/Sofia.cs
@@ -138,8 +138,11 @@ namespace FSClient {
public void sofia_profile_check() {
master_profile_ok = true;
String res = Utils.api_exec("sofia", "status profile softphone");
- if (res.Trim() == "Invalid Profile!") {
- MessageBox.Show("Warning the master sofia profile was not able to load and the phone will most likely _not_ work, make sure the local bind port (" + FieldValue.GetByName(values, "sip-port").value + ") is free(set under the Advanced tab of in the sofia settings) and FSClient is allowed through your firewall, otherwise check the freeswitch.log for more details. You can try reloading the sofia profile by editing the sofia settings and clicking save to see if fixed.");
+ if (res.Trim() == "Invalid Profile!"){
+ String tls_port_msg = "";
+ if (FieldValue.GetByName(values, "tls").value == "true")
+ tls_port_msg += " and tls bind port (" + FieldValue.GetByName(values, "tls-sip-port").value + ")";
+ MessageBox.Show("Warning the master sofia profile was not able to load and the phone will most likely _not_ work, make sure the local bind port (" + FieldValue.GetByName(values, "sip-port").value + ")" + tls_port_msg + " is free(set under the Advanced tab of in the sofia settings) and FSClient is allowed through your firewall, otherwise check the freeswitch.log for more details. You can try reloading the sofia profile by editing the sofia settings and clicking save to see if fixed.");
master_profile_ok = false;
}
Summary of changes: mitchcapper/FSClient/Broker.cs | 4 ++-- mitchcapper/FSClient/EventSocket.cs | 8 ++++++-- mitchcapper/FSClient/Sofia.cs | 7 +++++-- 3 files changed, 13 insertions(+), 6 deletions(-)
this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email
For more info, see http://blog.chomperstomp.com/?p=630
--
FreeSWITCH user-contributed scripts, etc