Freeswitch-trunk
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- 14172 discussions
[freeswitch] Anthony Minessale updated branch: FreeSWITCH Source/master.
by git@svn.freeswitch.org 03 Feb '11
by git@svn.freeswitch.org 03 Feb '11
03 Feb '11
1
0
[freeswitch] Anthony Minessale updated branch: FreeSWITCH Source/master.
by git@svn.freeswitch.org 03 Feb '11
by git@svn.freeswitch.org 03 Feb '11
03 Feb '11
1
0
[freeswitch] Jeff Lenk updated branch: FreeSWITCH Source/master.
by git@svn.freeswitch.org 03 Feb '11
by git@svn.freeswitch.org 03 Feb '11
03 Feb '11
1
0
[freeswitch-contrib] Raymond Chandler updated branch: FreeSWITCH user-contributed scripts, etc/master.
by git@svn.freeswitch.org 02 Feb '11
by git@svn.freeswitch.org 02 Feb '11
02 Feb '11
1
0
[freeswitch-contrib] FreeSWITCH user-contributed scripts, etc branch master updated. java-esl-client-0.9.2-394-g9aa2f07
by git@svn.freeswitch.org 02 Feb '11
by git@svn.freeswitch.org 02 Feb '11
02 Feb '11
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FreeSWITCH user-contributed scripts, etc".
The branch, master has been updated
via 9aa2f07c369938230c5c4b8b61b67b1c53749efe (commit)
via b6c998685330b7c689cd08726438271ac68f0361 (commit)
via 75bbd885eb1eef0bcfea9b5371557823ca584522 (commit)
via 274a7dd627ab98012ebf26c68c0ed5f440fa9033 (commit)
via 2bd0da508187e942e4c906275e286cefedb3a62e (commit)
via 48590eca54e7c93ef987768a24a844dfd72986d1 (commit)
via 594536af195a45e9515ff1c40979a3f036934e49 (commit)
via 4a414482ddc08fe77a42daab560a1bd860235154 (commit)
via 3f2c531df509383cd93d9ae4379bfb656a969c7e (commit)
via fc1ff4f95853eb0a66db9b3658f596c19f8e66c4 (commit)
via 4277bdbadddb4bd6bd034812a4f59db60bd6e2aa (commit)
via 5247b0c1000e9aa6e642cdd238396d679d7c6bb3 (commit)
via 09778f943674b470c51a636aa8e3e3b22589708e (commit)
via 007d9a09df8e52d540e46eb009b44f69121fc275 (commit)
via f3c9f291d9c4854ff8c17e81552d9ed2a4c3b1e5 (commit)
from cfaca250a7c49387abd98ef3fbd7124efb02d422 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9aa2f07c369938230c5c4b8b61b67b1c53749efe
Merge: cfaca25 b6c9986
Author: Raymond Chandler <intralanman(a)freeswitch.org>
Date: Wed Feb 2 18:40:03 2011 -0500
Merge branch 'master' of git.freeswitch.org:freeswitch-contrib
commit b6c998685330b7c689cd08726438271ac68f0361
Author: Jeff Lenk <jeff(a)jefflenk.com>
Date: Wed Feb 2 14:26:55 2011 -0600
add quotes on path
diff --git a/mitchcapper/FSClient/FSClient.csproj b/mitchcapper/FSClient/FSClient.csproj
index b12ef37..3e6aaa1 100644
--- a/mitchcapper/FSClient/FSClient.csproj
+++ b/mitchcapper/FSClient/FSClient.csproj
@@ -252,7 +252,7 @@ if not exist ".\conf" md conf
copy ..\..\"external items"\conf\freeswitch.xml .\conf</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
- <PreBuildEvent>if exist "%25FREESWITCH_SRC_LOCATION%25" copy %25FREESWITCH_SRC_LOCATION%25\Win32\$(ConfigurationName)\mod\FreeSWITCH.Managed.dll ..\..\"external items"</PreBuildEvent>
+ <PreBuildEvent>if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25"\Win32\$(ConfigurationName)\mod\FreeSWITCH.Managed.dll ..\..\"external items"</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
commit 75bbd885eb1eef0bcfea9b5371557823ca584522
Author: Jeff Lenk <jeff(a)jefflenk.com>
Date: Wed Feb 2 14:10:08 2011 -0600
try to fix the localization install fail again
diff --git a/mitchcapper/FSClient/Setup/FSCore.wxs b/mitchcapper/FSClient/Setup/FSCore.wxs
index b59f5f8..2e95778 100644
--- a/mitchcapper/FSClient/Setup/FSCore.wxs
+++ b/mitchcapper/FSClient/Setup/FSCore.wxs
@@ -18,7 +18,7 @@
<Component Id="cmp3900B358BC2FB69DF2C42DDE35C5BBB2" Guid="*">
<File Id="fil322A57E96A97A8179B75065ABF94F809" KeyPath="yes" Source="$(var.FSClient.TargetDir)\FreeSwitch.dll" />
<CreateFolder Directory="INSTALLLOCATION">
- <Permission User="Users" GenericAll="yes" />
+ <PermissionEx User="Users" GenericRead="yes" GenericWrite="yes" CreateFile="yes" xmlns="http://schemas.microsoft.com/wix/UtilExtension"/>
</CreateFolder>
</Component>
<Component Id="cmp3CD83BDDE0C679AC83F36ABCCC44B85F" Guid="*">
diff --git a/mitchcapper/FSClient/Setup/Setup.wixproj b/mitchcapper/FSClient/Setup/Setup.wixproj
index 62c873c..7fea603 100644
--- a/mitchcapper/FSClient/Setup/Setup.wixproj
+++ b/mitchcapper/FSClient/Setup/Setup.wixproj
@@ -72,6 +72,10 @@
</BootstrapperFile>
</ItemGroup>
<ItemGroup>
+ <WixExtension Include="WixUtilExtension">
+ <HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
+ <Name>WixUtilExtension</Name>
+ </WixExtension>
<WixExtension Include="WixNetFxExtension">
<HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath>
<Name>WixNetFxExtension</Name>
commit 274a7dd627ab98012ebf26c68c0ed5f440fa9033
Author: Mitch Capper <mitch.capper(a)gmail.com>
Date: Wed Feb 2 10:02:48 2011 -0800
Reset contact search bar string on escape or dial
diff --git a/mitchcapper/FSClient/Broker.cs b/mitchcapper/FSClient/Broker.cs
index 0372d51..0195525 100644
--- a/mitchcapper/FSClient/Broker.cs
+++ b/mitchcapper/FSClient/Broker.cs
@@ -229,7 +229,7 @@ namespace FSClient {
public void DialString(String str){
if (string.IsNullOrWhiteSpace(str))
return;
- MainWindowRemoveFocus();
+ MainWindowRemoveFocus(true);
if (str.StartsWith("#") && str.Length > 2) {
String acct_num = str.Substring(1, 1);
@@ -572,8 +572,8 @@ namespace FSClient {
public OurAutoCompleteBox GetContactSearchBox() {
return MainWindow.get_instance().GetContactSearchBox();
}
- public void MainWindowRemoveFocus(){
- MainWindow.get_instance().RemoveFocus();
+ public void MainWindowRemoveFocus(bool ResetContactSearchText=false){
+ MainWindow.get_instance().RemoveFocus(ResetContactSearchText);
}
private delegate void BroadcastEventDel(FSEvent evt);
BroadcastEventDel BroadcastHandler;
diff --git a/mitchcapper/FSClient/MainWindow.xaml.cs b/mitchcapper/FSClient/MainWindow.xaml.cs
index 2dd780b..2201cf0 100644
--- a/mitchcapper/FSClient/MainWindow.xaml.cs
+++ b/mitchcapper/FSClient/MainWindow.xaml.cs
@@ -268,8 +268,10 @@ namespace FSClient {
}
- public void RemoveFocus(){
+ public void RemoveFocus(bool ResetContactSearchText=false){
btnMute.Focus(); //should really divert focus a better way
+ if (ResetContactSearchText)
+ ResetContactSearchStr();
}
@@ -424,10 +426,11 @@ namespace FSClient {
return txtSearchBox;
}
+ private const string contact_search_text = "Contact Search";
private void txtSearchBox_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) {
text_interception_enabled = false;
txtSearchBox.Opacity = 1;
- if (txtSearchBox.Text == "Contact Search")
+ if (txtSearchBox.Text == contact_search_text)
txtSearchBox.Text = "";
}
@@ -436,7 +439,10 @@ namespace FSClient {
txtSearchBox.Opacity = 0.8;
if (String.IsNullOrWhiteSpace(txtSearchBox.Text))
- txtSearchBox.Text = "Contact Search";
+ ResetContactSearchStr();
+ }
+ public void ResetContactSearchStr(){
+ txtSearchBox.Text = contact_search_text;
}
private bool ContactMenuOpen;
diff --git a/mitchcapper/FSClient/SimpleContactPluginBase.cs b/mitchcapper/FSClient/SimpleContactPluginBase.cs
index d2fbc41..4575f30 100644
--- a/mitchcapper/FSClient/SimpleContactPluginBase.cs
+++ b/mitchcapper/FSClient/SimpleContactPluginBase.cs
@@ -150,7 +150,7 @@ namespace FSClient
if (e.Key == Key.Enter)
call_current_contact();
else if (e.Key == Key.Escape)
- Broker.get_instance().MainWindowRemoveFocus();
+ Broker.get_instance().MainWindowRemoveFocus(true);
}
protected OurAutoCompleteBox search_box;
commit 2bd0da508187e942e4c906275e286cefedb3a62e
Merge: 48590ec 594536a
Author: Mitch Capper <mitch.capper(a)gmail.com>
Date: Wed Feb 2 09:43:04 2011 -0800
Merge branch 'master' of ssh://git.freeswitch.org/freeswitch-contrib
commit 48590eca54e7c93ef987768a24a844dfd72986d1
Author: Mitch Capper <mitch.capper(a)gmail.com>
Date: Wed Feb 2 09:42:55 2011 -0800
Added ability to remove focus to main window in broker, and made simplecontact base do this on escape in the box
diff --git a/mitchcapper/FSClient/Broker.cs b/mitchcapper/FSClient/Broker.cs
index e0098b7..0372d51 100644
--- a/mitchcapper/FSClient/Broker.cs
+++ b/mitchcapper/FSClient/Broker.cs
@@ -6,8 +6,8 @@ using System.Windows;
using System.Windows.Controls;
using System.Xml;
-using FreeSWITCH.Native;
-using FSClient.Controls;
+using FreeSWITCH.Native;
+using FSClient.Controls;
using Timer = System.Timers.Timer;
namespace FSClient {
@@ -229,7 +229,7 @@ namespace FSClient {
public void DialString(String str){
if (string.IsNullOrWhiteSpace(str))
return;
- MainWindow.get_instance().RemoveFocus();
+ MainWindowRemoveFocus();
if (str.StartsWith("#") && str.Length > 2) {
String acct_num = str.Substring(1, 1);
@@ -567,11 +567,14 @@ namespace FSClient {
if (BroadcastHandler == null)
BroadcastHandler = new BroadcastEventDel(BroadcastEvent);
Application.Current.Dispatcher.BeginInvoke(BroadcastHandler, new object[] { new FSEvent(args.EventObj) });
- }
-
+ }
+
public OurAutoCompleteBox GetContactSearchBox() {
return MainWindow.get_instance().GetContactSearchBox();
}
+ public void MainWindowRemoveFocus(){
+ MainWindow.get_instance().RemoveFocus();
+ }
private delegate void BroadcastEventDel(FSEvent evt);
BroadcastEventDel BroadcastHandler;
private void BroadcastEvent(FSEvent evt) {
diff --git a/mitchcapper/FSClient/SimpleContactPluginBase.cs b/mitchcapper/FSClient/SimpleContactPluginBase.cs
index bcf73d1..d2fbc41 100644
--- a/mitchcapper/FSClient/SimpleContactPluginBase.cs
+++ b/mitchcapper/FSClient/SimpleContactPluginBase.cs
@@ -1,5 +1,5 @@
using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
@@ -49,25 +49,25 @@ namespace FSClient
MenuItem item = new MenuItem();
item.Click += item_Click;
item.Header = "Edit Contact";
- items.Add(item);
- item = new MenuItem();
- item.Click +=contact_call_click;
- item.Header = "Call";
+ items.Add(item);
+ item = new MenuItem();
+ item.Click +=contact_call_click;
+ item.Header = "Call";
items.Add(item);
return items;
- }
-
- private void contact_call_click(object sender, RoutedEventArgs e){
- MenuItem item = sender as MenuItem;
- if (item == null)
- return;
-
- SearchAutoCompleteEntry entry = item.DataContext as SearchAutoCompleteEntry ?? search_box.SelectedItem as SearchAutoCompleteEntry;
- if (entry == null)
- return;
- Broker.get_instance().DialString(entry.number);
- }
-
+ }
+
+ private void contact_call_click(object sender, RoutedEventArgs e){
+ MenuItem item = sender as MenuItem;
+ if (item == null)
+ return;
+
+ SearchAutoCompleteEntry entry = item.DataContext as SearchAutoCompleteEntry ?? search_box.SelectedItem as SearchAutoCompleteEntry;
+ if (entry == null)
+ return;
+ Broker.get_instance().DialString(entry.number);
+ }
+
protected void item_Click(object sender, RoutedEventArgs e)
{
MenuItem item = sender as MenuItem;
@@ -82,8 +82,8 @@ namespace FSClient
default_edit_value = DefaultEditValue(c);
}
else{
- SearchAutoCompleteEntry entry = item.DataContext as SearchAutoCompleteEntry ?? search_box.SelectedItem as SearchAutoCompleteEntry;
-
+ SearchAutoCompleteEntry entry = item.DataContext as SearchAutoCompleteEntry ?? search_box.SelectedItem as SearchAutoCompleteEntry;
+
if (entry == null)
return;
number = entry.number;
@@ -147,9 +147,10 @@ namespace FSClient
}
}
protected void search_box_PreviewKeyUp(object sender, KeyEventArgs e){
- if (e.Key == Key.Enter){
- call_current_contact();
- }
+ if (e.Key == Key.Enter)
+ call_current_contact();
+ else if (e.Key == Key.Escape)
+ Broker.get_instance().MainWindowRemoveFocus();
}
protected OurAutoCompleteBox search_box;
@@ -165,19 +166,19 @@ namespace FSClient
real_search_box.ContextMenu.Items.Add(item);
}
- search_box.PreviewKeyUp += search_box_PreviewKeyUp;
+ search_box.PreviewKeyUp += search_box_PreviewKeyUp;
search_box.MouseDoubleClick += search_box_MouseDoubleClick;
if (number_to_alias.Count > 0)
refresh_search_box();
return true;
- }
- protected void call_current_contact(){
- SearchAutoCompleteEntry entry = search_box.SelectedItem as SearchAutoCompleteEntry;
- if (entry != null)
- Broker.get_instance().DialString(entry.number);
- }
- void search_box_MouseDoubleClick(object sender, MouseButtonEventArgs e){
- call_current_contact();
+ }
+ protected void call_current_contact(){
+ SearchAutoCompleteEntry entry = search_box.SelectedItem as SearchAutoCompleteEntry;
+ if (entry != null)
+ Broker.get_instance().DialString(entry.number);
+ }
+ void search_box_MouseDoubleClick(object sender, MouseButtonEventArgs e){
+ call_current_contact();
}
void search_box_ContextMenuOpening(object sender, ContextMenuEventArgs e){
commit 594536af195a45e9515ff1c40979a3f036934e49
Merge: 4a41448 3f2c531
Author: Jeff Lenk <jeff(a)jefflenk.com>
Date: Wed Feb 2 09:29:16 2011 -0600
Merge branch 'master' of ssh://git.freeswitch.org/freeswitch-contrib
commit 4a414482ddc08fe77a42daab560a1bd860235154
Author: Jeff Lenk <jeff(a)jefflenk.com>
Date: Wed Feb 2 09:28:49 2011 -0600
Fix installation problem - with non English locales
diff --git a/mitchcapper/FSClient/Setup/FSCore.wxs b/mitchcapper/FSClient/Setup/FSCore.wxs
index ac22889..b59f5f8 100644
--- a/mitchcapper/FSClient/Setup/FSCore.wxs
+++ b/mitchcapper/FSClient/Setup/FSCore.wxs
@@ -18,7 +18,7 @@
<Component Id="cmp3900B358BC2FB69DF2C42DDE35C5BBB2" Guid="*">
<File Id="fil322A57E96A97A8179B75065ABF94F809" KeyPath="yes" Source="$(var.FSClient.TargetDir)\FreeSwitch.dll" />
<CreateFolder Directory="INSTALLLOCATION">
- <Permission User="Authenticated Users" GenericAll="yes" />
+ <Permission User="Users" GenericAll="yes" />
</CreateFolder>
</Component>
<Component Id="cmp3CD83BDDE0C679AC83F36ABCCC44B85F" Guid="*">
commit 3f2c531df509383cd93d9ae4379bfb656a969c7e
Merge: fc1ff4f 4277bdb
Author: Mitch Capper <mitch.capper(a)gmail.com>
Date: Tue Feb 1 22:29:18 2011 -0800
Merge branch 'master' of ssh://git.freeswitch.org/freeswitch-contrib
commit fc1ff4f95853eb0a66db9b3658f596c19f8e66c4
Author: Mitch Capper <mitch.capper(a)gmail.com>
Date: Tue Feb 1 22:28:48 2011 -0800
Minor text changes to make things clearer
diff --git a/mitchcapper/FSClient/README.txt b/mitchcapper/FSClient/README.txt
index 6863643..68288a3 100644
--- a/mitchcapper/FSClient/README.txt
+++ b/mitchcapper/FSClient/README.txt
@@ -22,7 +22,7 @@ Plugins
There are two native headset plugins provided for Jabra and Plantronics headsets. If you do not have one of these you can still leave the plugin in the directory it will not harm anything. If you do have one of these headsets you will then be able to select the headset in the options. This will automatically open/close the audio link, support muting and buttons, caller id, etc in the headset. You may need the runtime/sdk for the headset installed for it to work.
Contact Plugins
- There is one contact plugin provided by default, SimpleXML. This plugin allows you to attach a name/alias to a phone number so future calls show this information for the number. Right click and click edit on a call to edit the name/alias. The plugin stores all the names in an xml file in the AppData\Local folder for the app. Note you cannot have more than one contact plugin in the plugins folder or else only the first will be used. There are two ways to write a contact plugin, you can inherit from the SimpleContactPluginBase or IContactPlugin classes. SimpleContactPluginBase is just a base class that inherits from IContactPlugin to make things a bit easier. It uses basically the same interface as SimpleXML but you could replace SimpleXML with something to tie it to outlook, a ldap address book etc.
+ There is one contact plugin provided by default, SimpleXML. This plugin allows you to attach a name/alias to a phone number so future calls show this information for the number. Right click and click edit on a call to edit the name/alias. Control +F or click in the contact search box on the bottom right, search by name right click for options. The plugin stores all the names in an xml file in the AppData\Local folder for the app. Note you cannot have more than one contact plugin in the plugins folder or else only the first will be used. There are two ways to write a contact plugin, you can inherit from the SimpleContactPluginBase or IContactPlugin classes. SimpleContactPluginBase is just a base class that inherits from IContactPlugin to make things a bit easier. It uses basically the same interface as SimpleXML but you could replace SimpleXML with something to tie it to outlook, a ldap address book etc.
Plugin Development
FSClient was made to make it easy to extend through plugins. The two plugin types supported are noted above. Writing a plugin is exceptionally easy, you simply inherit the base interface fill in a few functions and are good to go. Use the above for examples. As for how easy, well the SimpleXML Contact Plugin was written in under an hour and under 100 lines of code. Writing plugins is easiest in a .net language (although you can write them in any language). FSClient will try to load any plugins in the plugin dir.
diff --git a/mitchcapper/FSClient/Sofia.cs b/mitchcapper/FSClient/Sofia.cs
index 15fd750..f33d963 100644
--- a/mitchcapper/FSClient/Sofia.cs
+++ b/mitchcapper/FSClient/Sofia.cs
@@ -126,7 +126,7 @@ namespace FSClient {
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), otherwise check the freeswitch.log for more details. You can try reloading the sofia profile by editing the sofia settings and clicking save.");
+ 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.");
master_profile_ok = false;
}
diff --git a/mitchcapper/FSClient/TODO.txt b/mitchcapper/FSClient/TODO.txt
index 7e3f1fb..4e65bb3 100644
--- a/mitchcapper/FSClient/TODO.txt
+++ b/mitchcapper/FSClient/TODO.txt
@@ -1,4 +1,2 @@
-Better address book integration. Right now the integration is pretty lame to say the least, you cannot lookup contacts or do much in the way of editing them. I think a nice interm solution would be a control + f support to find a contact to atleast make outgoing calls. Right now contact plugins can add right click menus but maybe making a more central way for them to add right click options so they don't have to do so much work would be better.
-Volume control / gain. Right now you can use the system volume to adjust things but it would be nice to have this built into the GUI and also have a gain option. Gain would require changes to portaudio to support it most likely (although should be decently simple) or using set_audio_level. -- Partially implemented now with the ability to set audio levels on a call by right clicking on it.
Plugin control, ability to enable or disable plugins from the options menu.
Figure out a way to sort codecs, a draggable combo box may work well.
\ No newline at end of file
commit 4277bdbadddb4bd6bd034812a4f59db60bd6e2aa
Author: Jeff Lenk <jeff(a)jefflenk.com>
Date: Tue Feb 1 23:15:44 2011 -0600
add dependency for new file
diff --git a/mitchcapper/FSClient/Setup/FSClient.wxs b/mitchcapper/FSClient/Setup/FSClient.wxs
index 68d0886..ba6960a 100644
--- a/mitchcapper/FSClient/Setup/FSClient.wxs
+++ b/mitchcapper/FSClient/Setup/FSClient.wxs
@@ -4,6 +4,7 @@
<ComponentGroup Id="FSClientComp">
<ComponentRef Id="cmp98E16C7E23D449F3BC0ECF003543C3F9"/>
<ComponentRef Id="cmp32DB946E4669A895FAC4826678D1CE7A"/>
+ <ComponentRef Id="cmpD17CBE22A3B94CCE9CF46B849289D40D"/>
</ComponentGroup>
<DirectoryRef Id="INSTALLLOCATION">
<Component Id="cmp98E16C7E23D449F3BC0ECF003543C3F9" Guid="*">
@@ -12,6 +13,9 @@
<Component Id="cmp32DB946E4669A895FAC4826678D1CE7A" Guid="*">
<File Id="filE4CB78ABCF2AE91B89FB0446A607E70C" KeyPath="yes" Source="$(var.FSClient.TargetDir)\WPFToolkit.dll" />
</Component>
+ <Component Id="cmpD17CBE22A3B94CCE9CF46B849289D40D" Guid="*">
+ <File Id="fil00037BE15D6A4893973045263EA4B117" KeyPath="yes" Source="$(var.FSClient.TargetDir)\System.Windows.Controls.Input.Toolkit.dll" />
+ </Component>
</DirectoryRef>
</Fragment>
</Wix>
\ No newline at end of file
commit 5247b0c1000e9aa6e642cdd238396d679d7c6bb3
Author: Mitch Capper <mitch.capper(a)gmail.com>
Date: Tue Feb 1 20:27:15 2011 -0800
Make sure to hide the contact search box if no contact plugin supports it
diff --git a/mitchcapper/FSClient/IContactPlugin.cs b/mitchcapper/FSClient/IContactPlugin.cs
index b064ff6..c1a1c24 100644
--- a/mitchcapper/FSClient/IContactPlugin.cs
+++ b/mitchcapper/FSClient/IContactPlugin.cs
@@ -5,9 +5,9 @@ using System.ComponentModel;
using System.IO;
using System.Reflection;
using System.Windows;
-using System.Windows.Controls;
-using FSClient.Controls;
-
+using System.Windows.Controls;
+using FSClient.Controls;
+
namespace FSClient {
public class ContactPluginManager : IDisposable {
private bool IsTypeOf(Type to_check, Type of) {
@@ -36,19 +36,24 @@ namespace FSClient {
}
private void ContactInit(){
IContactPlugin plugin = plugins[0];
- ContactMenuItems = plugin.ContactRightClickMenu();
+ ContactMenuItems = plugin.ContactRightClickMenu();
OurAutoCompleteBox box = Broker.get_instance().GetContactSearchBox();
- if (!plugin.HandleSearchBox(box))
- box.Visibility = Visibility.Collapsed;
+ if (plugin.HandleSearchBox(box))
+ box.Visibility = Visibility.Visible;
}
private void HandleError(IContactPlugin plugin, Exception e) {
Utils.PluginLog("Contact Plugin Manager", "Plugin \"" + plugin.ProviderName() + "\" had an error Due to: " + e.Message);
}
- public ContactPluginManager() {
-
-
+ public ContactPluginManager() {
+ OurAutoCompleteBox box = Broker.get_instance().GetContactSearchBox();
+ Application.Current.Dispatcher.BeginInvoke((Action) (() => {
+ box.Visibility = Visibility.Collapsed;
+ }));
+
+
+
String plugin_dir = Utils.plugins_dir();
string[] dlls;
try {
@@ -161,7 +166,7 @@ namespace FSClient {
public abstract IEnumerable<MenuItem> ContactRightClickMenu();
public abstract void Initialize();
public abstract void Terminate();
- public abstract string ProviderName();
+ public abstract string ProviderName();
public abstract bool HandleSearchBox(OurAutoCompleteBox box);
}
commit 09778f943674b470c51a636aa8e3e3b22589708e
Author: Mitch Capper <mitch.capper(a)gmail.com>
Date: Tue Feb 1 20:04:51 2011 -0800
Made NO_FS a bit more robust
Moved broker to have an actuall make call function so other things can place calls
Added Contact Search Box support, it is a bit hacky to say the least.....
diff --git a/mitchcapper/FSClient/Broker.cs b/mitchcapper/FSClient/Broker.cs
index 924d714..e0098b7 100644
--- a/mitchcapper/FSClient/Broker.cs
+++ b/mitchcapper/FSClient/Broker.cs
@@ -6,7 +6,8 @@ using System.Windows;
using System.Windows.Controls;
using System.Xml;
-using FreeSWITCH.Native;
+using FreeSWITCH.Native;
+using FSClient.Controls;
using Timer = System.Timers.Timer;
namespace FSClient {
@@ -70,6 +71,8 @@ namespace FSClient {
try {//it would be better if this was in the init function but it seems some dll load errors won't be caught if it is.
#if ! NO_FS
fs_core_init();
+#else
+ fs_inited = false;
#endif
if (FreeswitchLoaded != null)
FreeswitchLoaded(this, null);
@@ -82,14 +85,16 @@ namespace FSClient {
Environment.Exit(-1);
}
+#if ! NO_FS
DelayedFunction.DelayedCall("SofiaProfileCheck", sofia.sofia_profile_check, 100);
+#endif
}
private void initContactManager() {
contact_plugin_manager = new ContactPluginManager();
}
-
+
#region Text Input
@@ -118,8 +123,10 @@ namespace FSClient {
if (Call.active_call != null && Call.active_call.state == Call.CALL_STATE.Answered)
Call.active_call.send_dtmf(key.ToString());
else {
+#if ! NO_FS
PortAudio.PlayDTMF(key, null, true);
DelayedFunction.DelayedCall("PortAudioLastDigitHitStreamClose", close_streams, 5000);
+#endif
}
}
private void close_streams() {
@@ -219,6 +226,26 @@ namespace FSClient {
//OffHook = true;
//Utils.bgapi_exec("pa", "play tone_stream://%(10000,0,350,440);loops=20");
}
+ public void DialString(String str){
+ if (string.IsNullOrWhiteSpace(str))
+ return;
+ MainWindow.get_instance().RemoveFocus();
+
+ if (str.StartsWith("#") && str.Length > 2) {
+ String acct_num = str.Substring(1, 1);
+ str = str.Substring(2);
+ Account acct = (from a in Account.accounts where a.guid == acct_num select a).SingleOrDefault();
+ if (acct != null) {
+ acct.CreateCall(str);
+ return;
+ }
+ }
+ if (Account.default_account == null) {
+ MessageBox.Show("no default account, make sure you have added one or more accounts (right click in the account area to add) and they are enabled (checked)");
+ return;
+ }
+ Account.default_account.CreateCall(str);
+ }
public void TalkPressed() {
if (Call.active_call != null) {
if (Call.active_call.state == Call.CALL_STATE.Ringing && Call.active_call.is_outgoing == false)
@@ -228,22 +255,8 @@ namespace FSClient {
} else {
if (String.IsNullOrEmpty(cur_dial_str))
DialTone();
- else {
- if (cur_dial_str.StartsWith("#") && cur_dial_str.Length > 2) {
- String acct_num = cur_dial_str.Substring(1, 1);
- cur_dial_str = cur_dial_str.Substring(2);
- Account acct = (from a in Account.accounts where a.guid == acct_num select a).SingleOrDefault();
- if (acct != null) {
- acct.CreateCall(cur_dial_str);
- cur_dial_str = "";
- return;
- }
- }
- if (Account.default_account == null) {
- MessageBox.Show("no default account, make sure you have added one or more accounts (right click in the account area to add) and they are enabled (checked)");
- return;
- }
- Account.default_account.CreateCall(cur_dial_str);
+ else{
+ DialString(cur_dial_str);
cur_dial_str = "";
}
}
@@ -548,12 +561,16 @@ namespace FSClient {
sofia.reload_config(mode);
}
public static EventHandler<EventArgs> FreeswitchLoaded;
- public static EventHandler<FSEvent> NewEvent;
+ public static EventHandler<FSEvent> NewEvent;
private void event_handler(FreeSWITCH.EventBinding.EventBindingArgs args) {
if (BroadcastHandler == null)
BroadcastHandler = new BroadcastEventDel(BroadcastEvent);
Application.Current.Dispatcher.BeginInvoke(BroadcastHandler, new object[] { new FSEvent(args.EventObj) });
+ }
+
+ public OurAutoCompleteBox GetContactSearchBox() {
+ return MainWindow.get_instance().GetContactSearchBox();
}
private delegate void BroadcastEventDel(FSEvent evt);
BroadcastEventDel BroadcastHandler;
@@ -587,7 +604,7 @@ namespace FSClient {
private bool is_inited;
private bool fs_inited;
private static IDisposable event_bind;
-
+
private void fs_core_init() {
fs_inited = true;
freeswitch.switch_core_set_globals();
diff --git a/mitchcapper/FSClient/Controls/OurAutoCompleteBox.cs b/mitchcapper/FSClient/Controls/OurAutoCompleteBox.cs
new file mode 100644
index 0000000..edc358f
--- /dev/null
+++ b/mitchcapper/FSClient/Controls/OurAutoCompleteBox.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows.Controls;
+
+namespace FSClient.Controls {
+ public class OurAutoCompleteBox : AutoCompleteBox {
+
+ private TextBox the_textbox;
+ private void find_textbox(){
+ if (the_textbox != null)
+ return;
+ the_textbox = Template.FindName("Text", this) as TextBox;
+ }
+ public TextBox GetActualTextbox() {
+ find_textbox();
+ return the_textbox;
+ }
+ public bool TextBoxHasFocus(){
+ find_textbox();
+ if (the_textbox == null)
+ return false;
+ return the_textbox.IsFocused;
+ }
+ public void TextBoxFocus(){
+ find_textbox();
+ if (the_textbox != null)
+ the_textbox.Focus();
+ }
+ }
+}
diff --git a/mitchcapper/FSClient/FSClient.csproj b/mitchcapper/FSClient/FSClient.csproj
index f4e250c..b12ef37 100644
--- a/mitchcapper/FSClient/FSClient.csproj
+++ b/mitchcapper/FSClient/FSClient.csproj
@@ -68,6 +68,10 @@
<Reference Include="System.configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Controls.Input.Toolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>C:\Program Files (x86)\WPF Toolkit\v3.5.50211.1\System.Windows.Controls.Input.Toolkit.dll</HintPath>
+ </Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml">
@@ -91,6 +95,7 @@
<Compile Include="Account.cs" />
<Compile Include="Broker.cs" />
<Compile Include="Call.cs" />
+ <Compile Include="Controls\OurAutoCompleteBox.cs" />
<Compile Include="Controls\PhonePadButton.xaml.cs">
<DependentUpon>PhonePadButton.xaml</DependentUpon>
</Compile>
diff --git a/mitchcapper/FSClient/IContactPlugin.cs b/mitchcapper/FSClient/IContactPlugin.cs
index 4d59e57..b064ff6 100644
--- a/mitchcapper/FSClient/IContactPlugin.cs
+++ b/mitchcapper/FSClient/IContactPlugin.cs
@@ -5,7 +5,9 @@ using System.ComponentModel;
using System.IO;
using System.Reflection;
using System.Windows;
-using System.Windows.Controls;
+using System.Windows.Controls;
+using FSClient.Controls;
+
namespace FSClient {
public class ContactPluginManager : IDisposable {
private bool IsTypeOf(Type to_check, Type of) {
@@ -15,6 +17,9 @@ namespace FSClient {
return true;
return IsTypeOf(to_check.BaseType, of);
}
+
+ public static IEnumerable<MenuItem> ContactMenuItems { get; set; }
+
private List<IContactPlugin> plugins = new List<IContactPlugin>();
public void RegisterPlugin(IContactPlugin plugin) {
if (plugins.Count > 0)
@@ -22,13 +27,24 @@ namespace FSClient {
try {
plugins.Add(plugin);
plugin.Initialize();
+ Application.Current.Dispatcher.BeginInvoke((Action)ContactInit);
+
+
} catch (Exception e) {
HandleError(plugin, e);
}
}
+ private void ContactInit(){
+ IContactPlugin plugin = plugins[0];
+ ContactMenuItems = plugin.ContactRightClickMenu();
+ OurAutoCompleteBox box = Broker.get_instance().GetContactSearchBox();
+ if (!plugin.HandleSearchBox(box))
+ box.Visibility = Visibility.Collapsed;
+ }
private void HandleError(IContactPlugin plugin, Exception e) {
Utils.PluginLog("Contact Plugin Manager", "Plugin \"" + plugin.ProviderName() + "\" had an error Due to: " + e.Message);
- }
+
+ }
public ContactPluginManager() {
@@ -62,17 +78,17 @@ namespace FSClient {
Utils.PluginLog("Contact Plugin Manager", "Error creating contact plugin from dll \"" + dll + "\" of: " + e.Message);
}
}
- Call.calls.CollectionChanged += calls_CollectionChanged;
- Call.CallRightClickMenuShowing += calls_RightClickMenuShowing;
- }
-
- private void calls_RightClickMenuShowing(object sender, Call.CallRightClickEventArgs e){
- if (plugins.Count == 0)
- return;
- plugins[0].CallRightClickMenu(e.call, e.menu);
- }
-
-
+ Call.calls.CollectionChanged += calls_CollectionChanged;
+ Call.CallRightClickMenuShowing += calls_RightClickMenuShowing;
+ }
+
+ private void calls_RightClickMenuShowing(object sender, Call.CallRightClickEventArgs e){
+ if (plugins.Count == 0)
+ return;
+ plugins[0].CallRightClickMenu(e.call, e.menu);
+ }
+
+
private void calls_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { //We want to background resolve things incase a plugin does something that takes awhile
if (e.NewItems == null || plugins.Count != 1)
return;
@@ -140,11 +156,13 @@ namespace FSClient {
public abstract class IContactPlugin {
public delegate void NumberResolved(String DisplayName);
- public abstract void ResolveNumber(String number, NumberResolved on_resolved);
+ public abstract void ResolveNumber(String number, NumberResolved on_resolved);
public abstract void CallRightClickMenu(Call call, ContextMenu menu);
+ public abstract IEnumerable<MenuItem> ContactRightClickMenu();
public abstract void Initialize();
public abstract void Terminate();
- public abstract string ProviderName();
+ public abstract string ProviderName();
+ public abstract bool HandleSearchBox(OurAutoCompleteBox box);
}
}
diff --git a/mitchcapper/FSClient/MainWindow.xaml b/mitchcapper/FSClient/MainWindow.xaml
index cf42a50..5e1eb04 100644
--- a/mitchcapper/FSClient/MainWindow.xaml
+++ b/mitchcapper/FSClient/MainWindow.xaml
@@ -1,9 +1,7 @@
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:ours="clr-namespace:FSClient.Controls"
-
- xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:local="clr-namespace:FSClient" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="FSClient.MainWindow"
+ xmlns:ours="clr-namespace:FSClient.Controls" xmlns:local="clr-namespace:FSClient" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit" mc:Ignorable="d" x:Class="FSClient.MainWindow"
Title="FSClient" Height="319" Width="666" WindowStyle="SingleBorderWindow" ResizeMode="CanMinimize" Closing="Window_Closing" Icon="phone.ico">
<Window.Resources>
<local:DurationTimeConverter x:Key="DurationTimeConverter"/>
@@ -174,15 +172,27 @@
</StackPanel>
</Border>
- <Button Content="Options" HorizontalAlignment="Left" x:Name="btnOptions" Width="75" Click="btnOptions_Click" Style="{DynamicResource GlassButtonStyle}" Height="20" Canvas.Left="349" Canvas.Top="266" d:LayoutOverrides="VerticalAlignment" />
+ <Button Content="Options" HorizontalAlignment="Left" x:Name="btnOptions" Width="50" Click="btnOptions_Click" Style="{DynamicResource GlassButtonStyle}" Height="20" Canvas.Left="374" Canvas.Top="266" d:LayoutOverrides="VerticalAlignment" />
</Canvas>
<Button Canvas.Left="283" Canvas.Top="21" Content="Send To Voicemail" FontWeight="Bold" Foreground="#FFF5E200" Height="20" Name="btnSendVoicemail" Style="{DynamicResource GlassButtonStyle}" Width="120" Visibility="Hidden" Click="btnSendVoicemail_Click" />
+
+ <ours:OurAutoCompleteBox Canvas.Left="435" Text="Contact Search" Canvas.Top="265" Height="22" Width="164.553" Opacity="0.8" x:Name="txtSearchBox" FilterMode="Contains" GotKeyboardFocus="txtSearchBox_GotKeyboardFocus" LostKeyboardFocus="txtSearchBox_LostKeyboardFocus" DropDownClosing="txtSearchBox_DropDownClosing">
+ <ours:OurAutoCompleteBox.ItemTemplate>
+ <DataTemplate>
+
+ <TextBlock Text="{Binding}">
+ <TextBlock.ContextMenu>
+ <ContextMenu x:Name="contactSearchConextMenu" ItemsSource="{Binding Path=(local:ContactPluginManager.ContactMenuItems)}" IsEnabled="true" Closed="contactSearchConextMenu_Closed" Loaded="contactSearchConextMenu_Loaded" />
+ </TextBlock.ContextMenu>
+ </TextBlock>
+ </DataTemplate>
+ </ours:OurAutoCompleteBox.ItemTemplate>
+ </ours:OurAutoCompleteBox>
<Control
x:Name="busyAnimation"
Style="{StaticResource BusyAnimationStyle}"
Width="{Binding Path=ActualWidth, ElementName=mainControl}"
- Height="{Binding Path=ActualHeight, ElementName=mainControl}"
+ Height="{Binding Path=ActualHeight, ElementName=mainControl}" d:IsHidden="True"
/>
-
</Canvas>
</Window>
diff --git a/mitchcapper/FSClient/MainWindow.xaml.cs b/mitchcapper/FSClient/MainWindow.xaml.cs
index bd80d6b..2dd780b 100644
--- a/mitchcapper/FSClient/MainWindow.xaml.cs
+++ b/mitchcapper/FSClient/MainWindow.xaml.cs
@@ -1,396 +1,458 @@
-using System;
-using System.ComponentModel;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Input;
-using System.Windows.Media;
-namespace FSClient {
- public partial class MainWindow : Window {
- private Broker broker;
- public MainWindow() {
- _instance = this;
-
- InitializeComponent();
-
- gridCalls.DataContext = Call.calls;
-
-
- gridCalls.LoadingRow += gridCalls_LoadingRow;
- gridAccounts.DataContext = Account.accounts;
-
- this.Loaded += MainWindow_Loaded;
-
-
- }
-
- private void ActiveCallChanged(object sender, Call.ActiveCallChangedArgs e) {
- Dispatcher.BeginInvoke((Action)(() => {
- CurrentCallInfo.DataContext = Call.active_call;
- if (Call.active_call == null)
- CurrentCallInfo.Visibility = Visibility.Hidden;
- else
- CurrentCallInfo.Visibility = Visibility.Visible;
- }));
- }
- private void CallStateChanged(object sender, Call.CallPropertyEventArgs e) {
- gridCalls.Items.SortDescriptions.Clear();
- gridCalls.Items.SortDescriptions.Add(new SortDescription("sort_order", ListSortDirection.Descending));
- }
- void accounts_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) {
- if (e.NewItems == null)
- return;
- foreach (Account acct in e.NewItems) {
- acct.PropertyChanged += acct_PropertyChanged;
- }
- }
-
- void acct_PropertyChanged(object sender, PropertyChangedEventArgs e) {
- if (e.PropertyName == "gateway_id") {
- gridAccounts.Items.SortDescriptions.Clear();
- gridAccounts.Items.SortDescriptions.Add(new SortDescription("gateway_id", ListSortDirection.Ascending));
- }
- }
-
-
-
-
- void gridCalls_LoadingRow(object sender, DataGridRowEventArgs e) {
- e.Row.SetResourceReference(ToolTipProperty, "mainCallTooltip");
- last_tip = e.Row.ToolTip as ToolTip;
+using System;
+using System.ComponentModel;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Media;
+using FSClient.Controls;
+
+namespace FSClient {
+ public partial class MainWindow : Window {
+ private Broker broker;
+ public MainWindow() {
+ _instance = this;
+
+ InitializeComponent();
+
+ gridCalls.DataContext = Call.calls;
+
+
+ gridCalls.LoadingRow += gridCalls_LoadingRow;
+ gridAccounts.DataContext = Account.accounts;
+
+ this.Loaded += MainWindow_Loaded;
+
+
+ }
+
+ private void ActiveCallChanged(object sender, Call.ActiveCallChangedArgs e) {
+ Dispatcher.BeginInvoke((Action)(() => {
+ CurrentCallInfo.DataContext = Call.active_call;
+ if (Call.active_call == null)
+ CurrentCallInfo.Visibility = Visibility.Hidden;
+ else
+ CurrentCallInfo.Visibility = Visibility.Visible;
+ }));
+ }
+ private void CallStateChanged(object sender, Call.CallPropertyEventArgs e) {
+ gridCalls.Items.SortDescriptions.Clear();
+ gridCalls.Items.SortDescriptions.Add(new SortDescription("sort_order", ListSortDirection.Descending));
+ }
+ void accounts_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) {
+ if (e.NewItems == null)
+ return;
+ foreach (Account acct in e.NewItems) {
+ acct.PropertyChanged += acct_PropertyChanged;
+ }
+ }
+
+ void acct_PropertyChanged(object sender, PropertyChangedEventArgs e) {
+ if (e.PropertyName == "gateway_id") {
+ gridAccounts.Items.SortDescriptions.Clear();
+ gridAccounts.Items.SortDescriptions.Add(new SortDescription("gateway_id", ListSortDirection.Ascending));
+ }
+ }
+
+
+
+
+ void gridCalls_LoadingRow(object sender, DataGridRowEventArgs e) {
+ e.Row.SetResourceReference(ToolTipProperty, "mainCallTooltip");
Call c = e.Row.DataContext as Call;
- last_row = e.Row;
if (c == null)
- return;
- e.Row.ContextMenu = c.CallRightClickMenu();
-
- }
- private ToolTip last_tip;
- private DataGridRow last_row;
- public void SetDialStr(string str) {
- Dispatcher.BeginInvoke((Action)(() => {
- txtNumber.Text = str;
- }));
- }
-
- private void CanEndChanged(object sender, bool data) {
- Dispatcher.BeginInvoke((Action)(() => {
- btnHangup.IsEnabled = broker.CanEnd;
- }));
- }
- private void SpeakerActiveChanged(object sender, bool data) {
- Dispatcher.BeginInvoke((Action)(() => {
- btnSpeaker.Foreground = data ? enabled_brush : disabled_brush;
- }));
- }
- private void MuteChanged(object sender, bool data) {
- Dispatcher.BeginInvoke((Action)(() => {
- btnMute.Foreground = data ? enabled_brush : disabled_brush;
- }));
- }
- private void DNDChanged(object sender, bool data) {
- Dispatcher.BeginInvoke((Action)(() => {
- btnDND.Foreground = data ? enabled_brush : disabled_brush;
- Title = "FSClient " + (data ? " - DND" : "");
- }));
- }
- private void CallActiveChanged(object sender, bool data) {
- Dispatcher.BeginInvoke((Action)(() => {
- btnHold.IsEnabled = broker.call_active;
- btnTransfer.IsEnabled = broker.call_active;
- }));
-
- }
-
-
-
- #region TextInput
-
- private enum TEXT_INPUT_MODE { NUMBERS_ONLY, FULL };
-
- private TEXT_INPUT_MODE text_mode = TEXT_INPUT_MODE.NUMBERS_ONLY;
- private void simple_text_mode_char_convert(char c) {
- if (c == '*' || c == '#' || (c >= '0' && c <= '9')){
- broker.handle_key_action(c);
- return;
- }
- switch (Char.ToUpper(c)) {
- case 'A':
- case 'B':
- case 'C':
- broker.handle_key_action('2');
- break;
- case 'D':
- case 'E':
- case 'F':
- broker.handle_key_action('3');
- break;
- case 'G':
- case 'H':
- case 'I':
- broker.handle_key_action('4');
- break;
- case 'J':
- case 'K':
- case 'L':
- broker.handle_key_action('5');
- break;
- case 'M':
- case 'N':
- case 'O':
- broker.handle_key_action('6');
- break;
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- broker.handle_key_action('7');
- break;
- case 'T':
- case 'U':
- case 'V':
- broker.handle_key_action('8');
- break;
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- broker.handle_key_action('9');
- break;
- }
- }
- void MainWindow_PreviewTextInput(object sender, TextCompositionEventArgs e) {
- if (!broker.fully_loaded)
- return;
- char[] chars = e.Text.ToCharArray();
- char[] sys_chars = e.ControlText.ToCharArray();
- foreach (Char c in sys_chars) {
- if (c == 22) //paste
- {
- String clipboard = Clipboard.GetText();
- char[] tmp = new char[chars.Length + clipboard.Length];
- chars.CopyTo(tmp, 0);
- clipboard.ToCharArray().CopyTo(tmp, chars.Length);
- chars = tmp;
- }
- }
-
- e.Handled = false;
- foreach (Char c in chars) {
- bool handled = true;
- if (c > 32 && c < 127) {
- if (text_mode == TEXT_INPUT_MODE.NUMBERS_ONLY || (Call.active_call != null && Call.active_call.state == Call.CALL_STATE.Answered) )
- simple_text_mode_char_convert(c);
- else
- broker.handle_key_action(c);
-
- }
- else if (c == '\b')
- broker.handle_special_action(Broker.KEYBOARD_ACTION.Backspace);
- else if (c == '\r')
- broker.handle_special_action(Broker.KEYBOARD_ACTION.Enter);
- else if (c == 27)
- broker.handle_special_action(Broker.KEYBOARD_ACTION.Escape);
- else
- handled = false;
- if (handled)
- e.Handled = true;
- }
- }
- void MainWindow_PreviewKeyDown(object sender, KeyEventArgs e) {
- if (!broker.fully_loaded)
- return;
-
- if (e.Key == Key.Return){
- broker.handle_special_action(Broker.KEYBOARD_ACTION.Enter);
- e.Handled = true;
- }
- }
- #endregion
- private static MainWindow _instance;
- public static MainWindow get_instance() {
- return _instance;
- }
-
- private void DialStrChanged(object sender, string data) {
- SetDialStr(broker.cur_dial_str);
- }
- private void CallRingingChanged(object sender, bool data) {
- Dispatcher.Invoke((Action)(() => {
- if (data && Call.active_call != null && Call.active_call.CanSendToVoicemail())
- btnSendVoicemail.Visibility = Visibility.Visible;
- else
- btnSendVoicemail.Visibility = Visibility.Hidden;
- }));
- }
- void MainWindow_Loaded(object sender, RoutedEventArgs e) {
- PreviewTextInput += MainWindow_PreviewTextInput;
- PreviewKeyDown += MainWindow_PreviewKeyDown; //return must be handled seperately as buttons are triggered on down it seems
- Call.CallStateChanged += CallStateChanged;
- Call.ActiveCallChanged += ActiveCallChanged;
- Account.accounts.CollectionChanged += accounts_CollectionChanged;
- Broker.FreeswitchLoaded += new EventHandler<EventArgs>(FreeswitchLoaded);
- broker = Broker.get_instance();
-
- broker.cur_dial_strChanged += DialStrChanged;
- broker.call_activeChanged += CallActiveChanged;
- broker.active_call_ringingChanged += CallRingingChanged;
- broker.MutedChanged += MuteChanged;
- broker.DNDChanged += DNDChanged;
- broker.CanEndChanged += CanEndChanged;
- broker.UseNumberOnlyInputChanged += UseNumberOnlyInputChanged;
- UseNumberOnlyInputChanged(null, false);//trigger an update
- broker.SpeakerphoneActiveChanged += SpeakerActiveChanged;
- CurrentCallInfo.Visibility = Visibility.Hidden;
- Windows.systray_icon_setup();
- }
-
- private void FreeswitchLoaded(object sender, EventArgs e){
- Dispatcher.BeginInvoke((Action)(() =>
- {
- busyAnimation.Visibility = Visibility.Hidden;
- }));
- }
-
-
-
- private void UseNumberOnlyInputChanged(object sender, bool data){
- text_mode = broker.UseNumberOnlyInput ? TEXT_INPUT_MODE.NUMBERS_ONLY : TEXT_INPUT_MODE.FULL;
- }
-
- public void BringToFront() {
- Show();
- BringIntoView();
- WindowState = WindowState.Normal;
- Topmost = true;
- Topmost = false;
- }
- private void btnCall_Click(object sender, RoutedEventArgs e) {
- broker.TalkPressed();
-
- }
-
- private void btnOptions_Click(object sender, RoutedEventArgs e) {
- Options opt = new Options();
- opt.ShowDialog();
- }
-
- private void btnHangup_Click(object sender, RoutedEventArgs e) {
- broker.HangupPressed();
- }
-
- private void gridCalls_MouseDoubleClick(object sender, MouseButtonEventArgs e) {
- FrameworkElement elem = e.OriginalSource as FrameworkElement;
- if (elem == null)
- return;
- Call call = elem.DataContext as Call;
- if (call == null)
- return;
- call.DefaultAction();
- }
-
- SolidColorBrush enabled_brush = new SolidColorBrush(Colors.Yellow);
- SolidColorBrush disabled_brush = new SolidColorBrush(Colors.White);
- private void btnMute_Click(object sender, RoutedEventArgs e) {
- broker.Muted = !broker.Muted;
- }
-
- private void btnDND_Click(object sender, RoutedEventArgs e) {
- broker.DND = !broker.DND;
- }
- private void gridAccounts_MouseUp(object sender, MouseButtonEventArgs e) {
- FrameworkElement elem = e.OriginalSource as FrameworkElement;
- if (elem == null)
- return;
- Account account = elem.DataContext as Account;
- if (account == null)
- return;
- DependencyObject dep = elem;
- while (dep != null && !(dep is DataGridCell)) {
- dep = VisualTreeHelper.GetParent(dep);
- }
- DataGridCell cell = dep as DataGridCell;
- if (cell == null)
- return;
-
- if (cell.Column.SortMemberPath == "enabled") {
- account.enabled = !account.enabled;
- account.ReloadAccount();
- }
- }
-
- private void Window_Closing(object sender, CancelEventArgs e) {
- try{
- Windows.systray_icon_remove();
- broker.Dispose();
- }
- catch { }
- }
-
- private void btnSpeaker_Click(object sender, RoutedEventArgs e) {
- broker.SpeakerphoneActive = !broker.SpeakerphoneActive;
- }
-
-
- private void AccountNew_Click(object sender, RoutedEventArgs e) {
- Account acct = new Account();
- Account.AddAccount(acct);
- acct.edit();
-
- }
-
- private void AccountEdit_Click(object sender, RoutedEventArgs e) {
- Account acct = gridAccounts.SelectedItem as Account;
- if (acct == null)
- return;
- acct.edit();
- }
-
- private void AccountSetDefault_Click(object sender, RoutedEventArgs e) {
- Account acct = gridAccounts.SelectedItem as Account;
- if (acct == null)
- return;
- acct.is_default_account = true;
- }
-
- private void AccountDelete_Click(object sender, RoutedEventArgs e) {
- Account acct = gridAccounts.SelectedItem as Account;
- if (acct == null)
- return;
- Account.accounts.Remove(acct);
- }
-
-
- private void gridAccounts_ContextMenuOpening(object sender, ContextMenuEventArgs e) {
- menuAccountDelete.IsEnabled = menuAccountEdit.IsEnabled = menuAccountSetDefault.IsEnabled = gridAccounts.SelectedItem != null;
- }
-
- private void btnDialpad_Click(object sender, RoutedEventArgs e) {
- Button btn = sender as Button;
- if (btn != null)
- broker.handle_key_action(btn.Content.ToString()[0]);
- Controls.PhonePadButton btn2 = sender as Controls.PhonePadButton;
- if (btn2 != null)
- broker.handle_key_action(btn2.Number[0]);
-
- }
-
- private void btnHold_Click(object sender, RoutedEventArgs e) {
- if (Call.active_call != null)
- Call.active_call.hold();
- }
-
- private void btnSendVoicemail_Click(object sender, RoutedEventArgs e) {
- if (Call.active_call != null)
- Call.active_call.SendToVoicemail();
- }
-
- private void btnTransfer_Click(object sender, RoutedEventArgs e) {
- if (Call.active_call != null)
- Call.active_call.TransferPrompt();
-
-
- }
-
-
- }
-}
+ return;
+ e.Row.ContextMenu = c.CallRightClickMenu();
+
+ }
+ public void SetDialStr(string str) {
+ Dispatcher.BeginInvoke((Action)(() => {
+ txtNumber.Text = str;
+ }));
+ }
+
+ private void CanEndChanged(object sender, bool data) {
+ Dispatcher.BeginInvoke((Action)(() => {
+ btnHangup.IsEnabled = broker.CanEnd;
+ }));
+ }
+ private void SpeakerActiveChanged(object sender, bool data) {
+ Dispatcher.BeginInvoke((Action)(() => {
+ btnSpeaker.Foreground = data ? enabled_brush : disabled_brush;
+ }));
+ }
+ private void MuteChanged(object sender, bool data) {
+ Dispatcher.BeginInvoke((Action)(() => {
+ btnMute.Foreground = data ? enabled_brush : disabled_brush;
+ }));
+ }
+ private void DNDChanged(object sender, bool data) {
+ Dispatcher.BeginInvoke((Action)(() => {
+ btnDND.Foreground = data ? enabled_brush : disabled_brush;
+ Title = "FSClient " + (data ? " - DND" : "");
+ }));
+ }
+ private void CallActiveChanged(object sender, bool data) {
+ Dispatcher.BeginInvoke((Action)(() => {
+ btnHold.IsEnabled = broker.call_active;
+ btnTransfer.IsEnabled = broker.call_active;
+ }));
+
+ }
+
+
+
+ #region TextInput
+
+ private enum TEXT_INPUT_MODE { NUMBERS_ONLY, FULL };
+
+ private TEXT_INPUT_MODE text_mode = TEXT_INPUT_MODE.NUMBERS_ONLY;
+ private void simple_text_mode_char_convert(char c) {
+ if (c == '*' || c == '#' || (c >= '0' && c <= '9')) {
+ broker.handle_key_action(c);
+ return;
+ }
+ switch (Char.ToUpper(c)) {
+ case 'A':
+ case 'B':
+ case 'C':
+ broker.handle_key_action('2');
+ break;
+ case 'D':
+ case 'E':
+ case 'F':
+ broker.handle_key_action('3');
+ break;
+ case 'G':
+ case 'H':
+ case 'I':
+ broker.handle_key_action('4');
+ break;
+ case 'J':
+ case 'K':
+ case 'L':
+ broker.handle_key_action('5');
+ break;
+ case 'M':
+ case 'N':
+ case 'O':
+ broker.handle_key_action('6');
+ break;
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ broker.handle_key_action('7');
+ break;
+ case 'T':
+ case 'U':
+ case 'V':
+ broker.handle_key_action('8');
+ break;
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ broker.handle_key_action('9');
+ break;
+ }
+ }
+
+ private bool text_interception_enabled = true;
+ void MainWindow_PreviewTextInput(object sender, TextCompositionEventArgs e) {
+ if (!broker.fully_loaded)
+ return;
+ if (!text_interception_enabled) {
+ e.Handled = false;
+ return;
+ }
+ char[] chars = e.Text.ToCharArray();
+ char[] sys_chars = e.ControlText.ToCharArray();
+ foreach (Char c in sys_chars) {
+ if (c == 22) //paste / control + v
+ {
+ String clipboard = Clipboard.GetText();
+ char[] tmp = new char[chars.Length + clipboard.Length];
+ chars.CopyTo(tmp, 0);
+ clipboard.ToCharArray().CopyTo(tmp, chars.Length);
+ chars = tmp;
+ }
+ else if (c == 6){ // control + f
+ txtSearchBox.TextBoxFocus();
+ }
+ }
+
+ e.Handled = false;
+ foreach (Char c in chars) {
+ bool handled = true;
+ if (c > 32 && c < 127) {
+ if (text_mode == TEXT_INPUT_MODE.NUMBERS_ONLY || (Call.active_call != null && Call.active_call.state == Call.CALL_STATE.Answered))
+ simple_text_mode_char_convert(c);
+ else
+ broker.handle_key_action(c);
+
+ }
+ else if (c == '\b')
+ broker.handle_special_action(Broker.KEYBOARD_ACTION.Backspace);
+ else if (c == '\r')
+ broker.handle_special_action(Broker.KEYBOARD_ACTION.Enter);
+ else if (c == 27)
+ broker.handle_special_action(Broker.KEYBOARD_ACTION.Escape);
+ else
+ handled = false;
+ if (handled)
+ e.Handled = true;
+ }
+ }
+ void MainWindow_PreviewKeyDown(object sender, KeyEventArgs e) {
+ if (!broker.fully_loaded)
+ return;
+ if (!text_interception_enabled) {
+ e.Handled = false;
+ return;
+ }
+
+ if (e.Key == Key.Return) {
+ broker.handle_special_action(Broker.KEYBOARD_ACTION.Enter);
+ e.Handled = true;
+ }
+ }
+ #endregion
+ private static MainWindow _instance;
+ public static MainWindow get_instance() {
+ return _instance;
+ }
+
+ private void DialStrChanged(object sender, string data) {
+ SetDialStr(broker.cur_dial_str);
+ }
+ private void CallRingingChanged(object sender, bool data) {
+ Dispatcher.Invoke((Action)(() => {
+ if (data && Call.active_call != null && Call.active_call.CanSendToVoicemail())
+ btnSendVoicemail.Visibility = Visibility.Visible;
+ else
+ btnSendVoicemail.Visibility = Visibility.Hidden;
+ }));
+ }
+ void MainWindow_Loaded(object sender, RoutedEventArgs e) {
+ PreviewTextInput += MainWindow_PreviewTextInput;
+ PreviewKeyDown += MainWindow_PreviewKeyDown; //return must be handled seperately as buttons are triggered on down it seems
+ MouseUp += MainWindow_MouseUp;
+
+ Call.CallStateChanged += CallStateChanged;
+ Call.ActiveCallChanged += ActiveCallChanged;
+ Account.accounts.CollectionChanged += accounts_CollectionChanged;
+ Broker.FreeswitchLoaded += FreeswitchLoaded;
+ broker = Broker.get_instance();
+
+ broker.cur_dial_strChanged += DialStrChanged;
+ broker.call_activeChanged += CallActiveChanged;
+ broker.active_call_ringingChanged += CallRingingChanged;
+ broker.MutedChanged += MuteChanged;
+ broker.DNDChanged += DNDChanged;
+ broker.CanEndChanged += CanEndChanged;
+ broker.UseNumberOnlyInputChanged += UseNumberOnlyInputChanged;
+ UseNumberOnlyInputChanged(null, false);//trigger an update
+ broker.SpeakerphoneActiveChanged += SpeakerActiveChanged;
+ CurrentCallInfo.Visibility = Visibility.Hidden;
+ Windows.systray_icon_setup();
+ }
+
+ void MainWindow_MouseUp(object sender, MouseButtonEventArgs e) {
+ if (txtSearchBox.TextBoxHasFocus()){
+ DependencyObject parent = e.OriginalSource as UIElement;
+ while (parent != null && !(parent is OurAutoCompleteBox))
+ parent = VisualTreeHelper.GetParent(parent);
+ if (parent == null)
+ RemoveFocus();
+ }
+
+ }
+
+ public void RemoveFocus(){
+ btnMute.Focus(); //should really divert focus a better way
+ }
+
+
+
+ private void FreeswitchLoaded(object sender, EventArgs e) {
+ Dispatcher.BeginInvoke((Action)(() => {
+ busyAnimation.Visibility = Visibility.Hidden;
+ }));
+ }
+
+
+
+ private void UseNumberOnlyInputChanged(object sender, bool data) {
+ text_mode = broker.UseNumberOnlyInput ? TEXT_INPUT_MODE.NUMBERS_ONLY : TEXT_INPUT_MODE.FULL;
+ }
+
+ public void BringToFront() {
+ Show();
+ BringIntoView();
+ WindowState = WindowState.Normal;
+ Topmost = true;
+ Topmost = false;
+ }
+ private void btnCall_Click(object sender, RoutedEventArgs e) {
+ broker.TalkPressed();
+
+ }
+
+ private void btnOptions_Click(object sender, RoutedEventArgs e) {
+ Options opt = new Options();
+ opt.ShowDialog();
+ }
+
+ private void btnHangup_Click(object sender, RoutedEventArgs e) {
+ broker.HangupPressed();
+ }
+
+ private void gridCalls_MouseDoubleClick(object sender, MouseButtonEventArgs e) {
+ FrameworkElement elem = e.OriginalSource as FrameworkElement;
+ if (elem == null)
+ return;
+ Call call = elem.DataContext as Call;
+ if (call == null)
+ return;
+ call.DefaultAction();
+ }
+
+ SolidColorBrush enabled_brush = new SolidColorBrush(Colors.Yellow);
+ SolidColorBrush disabled_brush = new SolidColorBrush(Colors.White);
+ private void btnMute_Click(object sender, RoutedEventArgs e) {
+ broker.Muted = !broker.Muted;
+ }
+
+ private void btnDND_Click(object sender, RoutedEventArgs e) {
+ broker.DND = !broker.DND;
+ }
+ private void gridAccounts_MouseUp(object sender, MouseButtonEventArgs e) {
+ FrameworkElement elem = e.OriginalSource as FrameworkElement;
+ if (elem == null)
+ return;
+ Account account = elem.DataContext as Account;
+ if (account == null)
+ return;
+ DependencyObject dep = elem;
+ while (dep != null && !(dep is DataGridCell)) {
+ dep = VisualTreeHelper.GetParent(dep);
+ }
+ DataGridCell cell = dep as DataGridCell;
+ if (cell == null)
+ return;
+
+ if (cell.Column.SortMemberPath == "enabled") {
+ account.enabled = !account.enabled;
+ account.ReloadAccount();
+ }
+ }
+
+ private void Window_Closing(object sender, CancelEventArgs e) {
+ try {
+ Windows.systray_icon_remove();
+ broker.Dispose();
+ }
+ catch{ }
+ }
+
+ private void btnSpeaker_Click(object sender, RoutedEventArgs e) {
+ broker.SpeakerphoneActive = !broker.SpeakerphoneActive;
+ }
+
+
+ private void AccountNew_Click(object sender, RoutedEventArgs e) {
+ Account acct = new Account();
+ Account.AddAccount(acct);
+ acct.edit();
+
+ }
+
+ private void AccountEdit_Click(object sender, RoutedEventArgs e) {
+ Account acct = gridAccounts.SelectedItem as Account;
+ if (acct == null)
+ return;
+ acct.edit();
+ }
+
+ private void AccountSetDefault_Click(object sender, RoutedEventArgs e) {
+ Account acct = gridAccounts.SelectedItem as Account;
+ if (acct == null)
+ return;
+ acct.is_default_account = true;
+ }
+
+ private void AccountDelete_Click(object sender, RoutedEventArgs e) {
+ Account acct = gridAccounts.SelectedItem as Account;
+ if (acct == null)
+ return;
+ Account.accounts.Remove(acct);
+ }
+
+
+ private void gridAccounts_ContextMenuOpening(object sender, ContextMenuEventArgs e) {
+ menuAccountDelete.IsEnabled = menuAccountEdit.IsEnabled = menuAccountSetDefault.IsEnabled = gridAccounts.SelectedItem != null;
+ }
+
+ private void btnDialpad_Click(object sender, RoutedEventArgs e) {
+ Button btn = sender as Button;
+ if (btn != null)
+ broker.handle_key_action(btn.Content.ToString()[0]);
+ PhonePadButton btn2 = sender as PhonePadButton;
+ if (btn2 != null)
+ broker.handle_key_action(btn2.Number[0]);
+
+ }
+
+ private void btnHold_Click(object sender, RoutedEventArgs e) {
+ if (Call.active_call != null)
+ Call.active_call.hold();
+ }
+
+ private void btnSendVoicemail_Click(object sender, RoutedEventArgs e) {
+ if (Call.active_call != null)
+ Call.active_call.SendToVoicemail();
+ }
+
+ private void btnTransfer_Click(object sender, RoutedEventArgs e) {
+ if (Call.active_call != null)
+ Call.active_call.TransferPrompt();
+
+
+ }
+ #region ContactSearchBox
+ public OurAutoCompleteBox GetContactSearchBox() {
+ return txtSearchBox;
+ }
+
+ private void txtSearchBox_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) {
+ text_interception_enabled = false;
+ txtSearchBox.Opacity = 1;
+ if (txtSearchBox.Text == "Contact Search")
+ txtSearchBox.Text = "";
+ }
+
+ private void txtSearchBox_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) {
+ text_interception_enabled = true;
+ txtSearchBox.Opacity = 0.8;
+
+ if (String.IsNullOrWhiteSpace(txtSearchBox.Text))
+ txtSearchBox.Text = "Contact Search";
+ }
+
+ private bool ContactMenuOpen;
+ private void contactSearchConextMenu_Closed(object sender, RoutedEventArgs e) {
+ ContactMenuOpen = false;
+ txtSearchBox.IsDropDownOpen = false;
+ }
+
+ private void contactSearchConextMenu_Loaded(object sender, RoutedEventArgs e) {
+ ContactMenuOpen = true;
+ }
+
+ private void txtSearchBox_DropDownClosing(object sender, RoutedPropertyChangingEventArgs<bool> e) {
+ if (ContactMenuOpen)
+ e.Cancel = true;
+ }
+ #endregion
+ }
+}
diff --git a/mitchcapper/FSClient/SimpleContactPluginBase.cs b/mitchcapper/FSClient/SimpleContactPluginBase.cs
index 6a92a79..bcf73d1 100644
--- a/mitchcapper/FSClient/SimpleContactPluginBase.cs
+++ b/mitchcapper/FSClient/SimpleContactPluginBase.cs
@@ -1,6 +1,10 @@
using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows;
using System.Windows.Controls;
+using System.Windows.Input;
+using FSClient.Controls;
namespace FSClient
{
@@ -8,9 +12,9 @@ namespace FSClient
{
protected abstract void _TryResolveNewNumber(string number, NumberResolved on_resolved);
protected abstract void LoadDatabase(ref Dictionary<string, string> number_to_alias_db);
- protected abstract void UpdateDatabase(string number, string alias);
-
-
+ protected abstract void UpdateDatabase(string number, string alias);
+
+
protected virtual void ModifyRightClickMenu(Call call, ContextMenu menu)
{
return;
@@ -30,26 +34,65 @@ namespace FSClient
return "";
}
- protected Dictionary<string, string> number_to_alias = new Dictionary<string, string>();
-
+ protected Dictionary<string, string> number_to_alias = new Dictionary<string, string>();
+
public override void CallRightClickMenu(Call call, ContextMenu menu) {
MenuItem item = new MenuItem();
item.Click += item_Click;
item.Header = "Edit Contact";
- menu.Items.Add(item);
+ menu.Items.Add(item);
ModifyRightClickMenu(call, menu);
}
- protected void item_Click(object sender, System.Windows.RoutedEventArgs e)
+ public override IEnumerable<MenuItem> ContactRightClickMenu(){
+ List<MenuItem> items = new List<MenuItem>();
+ MenuItem item = new MenuItem();
+ item.Click += item_Click;
+ item.Header = "Edit Contact";
+ items.Add(item);
+ item = new MenuItem();
+ item.Click +=contact_call_click;
+ item.Header = "Call";
+ items.Add(item);
+ return items;
+ }
+
+ private void contact_call_click(object sender, RoutedEventArgs e){
+ MenuItem item = sender as MenuItem;
+ if (item == null)
+ return;
+
+ SearchAutoCompleteEntry entry = item.DataContext as SearchAutoCompleteEntry ?? search_box.SelectedItem as SearchAutoCompleteEntry;
+ if (entry == null)
+ return;
+ Broker.get_instance().DialString(entry.number);
+ }
+
+ protected void item_Click(object sender, RoutedEventArgs e)
{
MenuItem item = sender as MenuItem;
if (item == null)
return;
+ String number;
+ String default_edit_value;
+
Call c = item.DataContext as Call;
- if (c == null)
- return;
- String number = NormalizeNumber(c.other_party_number);
- String alias = InputBox.GetInput("Editing Contact", "Edit alias for number: " + number, DefaultEditValue(c));
+ if (c != null){
+ number = c.other_party_number;
+ default_edit_value = DefaultEditValue(c);
+ }
+ else{
+ SearchAutoCompleteEntry entry = item.DataContext as SearchAutoCompleteEntry ?? search_box.SelectedItem as SearchAutoCompleteEntry;
+
+ if (entry == null)
+ return;
+ number = entry.number;
+ default_edit_value = entry.alias;
+ }
+
+ String orig_number = number;
+ number = NormalizeNumber(number);
+ String alias = InputBox.GetInput("Editing Contact", "Edit alias for number: " + number, default_edit_value);
alias = IsValidAlias(alias);
if (alias == null)
return;
@@ -58,11 +101,12 @@ namespace FSClient
foreach (Call call in Call.calls)
{
- if (c.other_party_number == call.other_party_number)
- c.other_party_name = alias;
+ if (orig_number == call.other_party_number || number == call.other_party_number)
+ call.other_party_name = alias;
}
UpdateDatabase(number, alias);
+ refresh_search_box();
}
public override void ResolveNumber(string number, NumberResolved on_resolved)
{
@@ -78,8 +122,69 @@ namespace FSClient
public override void Initialize()
{
LoadDatabase(ref number_to_alias);
+
+ refresh_search_box();
+ }
+ protected void refresh_search_box(){
+ if (search_box == null)
+ return;
+ search_box.ItemsSource = from c in number_to_alias select new SearchAutoCompleteEntry(c.Key,c.Value);
+ }
+ protected class SearchAutoCompleteEntry{
+ public string number;
+ public string alias;
+ public string display_name;
+ public SearchAutoCompleteEntry(String number, String alias){
+ this.number = number;
+ this.alias = alias;
+ if (String.IsNullOrWhiteSpace(alias) || number == alias)
+ display_name = number;
+ else
+ display_name = alias + " - " + number;
+ }
+ public override string ToString(){
+ return display_name;
+ }
+ }
+ protected void search_box_PreviewKeyUp(object sender, KeyEventArgs e){
+ if (e.Key == Key.Enter){
+ call_current_contact();
+ }
+ }
+ protected OurAutoCompleteBox search_box;
+ private TextBox real_search_box;
+ public override bool HandleSearchBox(OurAutoCompleteBox box) {
+ search_box = box;
+
+ real_search_box = search_box.GetActualTextbox();
+ real_search_box.ContextMenu = new ContextMenu();
+ real_search_box.ContextMenuOpening += search_box_ContextMenuOpening;
+
+ foreach (MenuItem item in ContactRightClickMenu()){
+ real_search_box.ContextMenu.Items.Add(item);
+ }
+
+ search_box.PreviewKeyUp += search_box_PreviewKeyUp;
+ search_box.MouseDoubleClick += search_box_MouseDoubleClick;
+ if (number_to_alias.Count > 0)
+ refresh_search_box();
+ return true;
+ }
+ protected void call_current_contact(){
+ SearchAutoCompleteEntry entry = search_box.SelectedItem as SearchAutoCompleteEntry;
+ if (entry != null)
+ Broker.get_instance().DialString(entry.number);
+ }
+ void search_box_MouseDoubleClick(object sender, MouseButtonEventArgs e){
+ call_current_contact();
}
+ void search_box_ContextMenuOpening(object sender, ContextMenuEventArgs e){
+ if (search_box.SelectedItem == null)
+ real_search_box.ContextMenu.Visibility = Visibility.Hidden;
+ else
+ real_search_box.ContextMenu.Visibility = Visibility.Visible;
+ }
}
}
commit 007d9a09df8e52d540e46eb009b44f69121fc275
Author: Jeff Lenk <jeff(a)jefflenk.com>
Date: Tue Feb 1 19:46:14 2011 -0600
remove passthrough codecs and align files with setup
diff --git a/mitchcapper/FSClient/External Items/conf/freeswitch.xml b/mitchcapper/FSClient/External Items/conf/freeswitch.xml
index e2afea6..a297f69 100644
--- a/mitchcapper/FSClient/External Items/conf/freeswitch.xml
+++ b/mitchcapper/FSClient/External Items/conf/freeswitch.xml
@@ -55,8 +55,6 @@
<load module="mod_dptools"/>
<load module="mod_dialplan_xml"/>
<load module="mod_spandsp"/>
- <load module="mod_g723_1"/>
- <load module="mod_amr"/>
<load module="mod_ilbc"/>
<load module="mod_speex"/>
<load module="mod_siren"/>
diff --git a/mitchcapper/FSClient/FSClient.csproj b/mitchcapper/FSClient/FSClient.csproj
index a29cb51..f4e250c 100644
--- a/mitchcapper/FSClient/FSClient.csproj
+++ b/mitchcapper/FSClient/FSClient.csproj
@@ -240,7 +240,6 @@ if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Wi
if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_sofia.dll .\mod
if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_speex.dll .\mod
if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_tone_stream.dll .\mod
-if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_h26x.dll .\mod
if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_silk.dll .\mod
if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_bv.dll .\mod
diff --git a/mitchcapper/FSClient/Setup/FSCore.wxs b/mitchcapper/FSClient/Setup/FSCore.wxs
index 7e1b42b..ac22889 100644
--- a/mitchcapper/FSClient/Setup/FSCore.wxs
+++ b/mitchcapper/FSClient/Setup/FSCore.wxs
@@ -62,7 +62,6 @@
<ComponentRef Id="cmp7F1E9A4820D7ABC50BB56176F1C5C203"/>
<ComponentRef Id="cmpB1F423B56230E52C4F261BB0A2D31A50"/>
<ComponentRef Id="cmpED6FDBCCBE7E25A518A406A7EEBF19E7"/>
- <ComponentRef Id="cmpC32E981DE1987696848505946E7E40C7"/>
<ComponentRef Id="cmpBEC9C50CA6BEA1BDAA538AC014270ACA"/>
<ComponentRef Id="cmp484B206DD9362CCE151AE281DC2B9653"/>
<ComponentRef Id="cmp57A16823D68C54AF4DD1BEF68206C2E6"/>
@@ -98,9 +97,6 @@
<Component Id="cmpED6FDBCCBE7E25A518A406A7EEBF19E7" Guid="*">
<File Id="fil2D28C6A5674AFCA7F9F1E06EEB33E823" KeyPath="yes" Source="$(var.FSClient.TargetDir)\mod\mod_event_socket.dll" />
</Component>
- <Component Id="cmpC32E981DE1987696848505946E7E40C7" Guid="*">
- <File Id="filD5487CAC6CE60107178EA7AD41CDDA31" KeyPath="yes" Source="$(var.FSClient.TargetDir)\mod\mod_h26x.dll" />
- </Component>
<Component Id="cmpBEC9C50CA6BEA1BDAA538AC014270ACA" Guid="*">
<File Id="fil623B81F2BE4376CCA8C66EDB2EA2EBA8" KeyPath="yes" Source="$(var.FSClient.TargetDir)\mod\mod_ilbc.dll" />
</Component>
commit f3c9f291d9c4854ff8c17e81552d9ed2a4c3b1e5
Author: Jeff Lenk <jeff(a)jefflenk.com>
Date: Tue Feb 1 19:14:59 2011 -0600
change project output paths
add buildevents to copy fs depends if FREESWITCH_SRC_LOCATION environment variable is set
diff --git a/mitchcapper/FSClient/FSClient.csproj b/mitchcapper/FSClient/FSClient.csproj
index 8681ee7..a29cb51 100644
--- a/mitchcapper/FSClient/FSClient.csproj
+++ b/mitchcapper/FSClient/FSClient.csproj
@@ -21,13 +21,28 @@
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>working\</OutputPath>
+ <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -172,7 +187,69 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\FreeSwitch.dll .
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\libapr.dll .
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\libaprutil.dll .
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\libbroadvoice.dll .
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\libspandsp.dll .
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\libteletone.dll .
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\libeay32.dll .
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\ssleay32.dll .
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\pthread.dll .
+
+if not exist ".\mod" md mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_managed.dll .
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_spandsp.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_celt.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_commands.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_console.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_dialplan_xml.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_dptools.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_event_socket.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_ilbc.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_logfile.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_local_stream.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_loopback.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_PortAudio.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_siren.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_sndfile.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_sofia.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_speex.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_tone_stream.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_h26x.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_silk.dll .\mod
+if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Win32\$(ConfigurationName)\mod\mod_bv.dll .\mod
+
+if not exist ".\conf" md conf
+copy ..\..\"external items"\conf\freeswitch.xml .\conf</PostBuildEvent>
+ </PropertyGroup>
+ <PropertyGroup>
+ <PreBuildEvent>if exist "%25FREESWITCH_SRC_LOCATION%25" copy %25FREESWITCH_SRC_LOCATION%25\Win32\$(ConfigurationName)\mod\FreeSWITCH.Managed.dll ..\..\"external items"</PreBuildEvent>
+ </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/mitchcapper/FSClient/JabraHeadset/JabraHeadset.csproj b/mitchcapper/FSClient/JabraHeadset/JabraHeadset.csproj
index 4908229..103d468 100644
--- a/mitchcapper/FSClient/JabraHeadset/JabraHeadset.csproj
+++ b/mitchcapper/FSClient/JabraHeadset/JabraHeadset.csproj
@@ -22,7 +22,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>..\working\plugins\</OutputPath>
+ <OutputPath>..\bin\Debug\plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -31,7 +31,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\bin\Release\plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
diff --git a/mitchcapper/FSClient/PlantronicsHeadset/PlantronicsHeadset.csproj b/mitchcapper/FSClient/PlantronicsHeadset/PlantronicsHeadset.csproj
index 9a434b5..36099a7 100644
--- a/mitchcapper/FSClient/PlantronicsHeadset/PlantronicsHeadset.csproj
+++ b/mitchcapper/FSClient/PlantronicsHeadset/PlantronicsHeadset.csproj
@@ -23,7 +23,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>..\working\plugins\</OutputPath>
+ <OutputPath>..\bin\Debug\plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -32,7 +32,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\bin\Release\plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
diff --git a/mitchcapper/FSClient/SimpleXmlContactPlugin/SimpleXmlContactPlugin.csproj b/mitchcapper/FSClient/SimpleXmlContactPlugin/SimpleXmlContactPlugin.csproj
index a05acb1..1d3756f 100644
--- a/mitchcapper/FSClient/SimpleXmlContactPlugin/SimpleXmlContactPlugin.csproj
+++ b/mitchcapper/FSClient/SimpleXmlContactPlugin/SimpleXmlContactPlugin.csproj
@@ -21,7 +21,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>..\working\plugins\</OutputPath>
+ <OutputPath>..\bin\Debug\plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -29,7 +29,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
+ <OutputPath>..\bin\Release\plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
-----------------------------------------------------------------------
Summary of changes:
mitchcapper/FSClient/Broker.cs | 58 +-
.../FSClient/Controls/OurAutoCompleteBox.cs | 32 +
.../FSClient/External Items/conf/freeswitch.xml | 2 -
mitchcapper/FSClient/FSClient.csproj | 83 ++-
mitchcapper/FSClient/IContactPlugin.cs | 55 +-
.../FSClient/JabraHeadset/JabraHeadset.csproj | 4 +-
mitchcapper/FSClient/MainWindow.xaml | 22 +-
mitchcapper/FSClient/MainWindow.xaml.cs | 856 +++++++++++---------
.../PlantronicsHeadset/PlantronicsHeadset.csproj | 4 +-
mitchcapper/FSClient/README.txt | 2 +-
mitchcapper/FSClient/Setup/FSClient.wxs | 4 +
mitchcapper/FSClient/Setup/FSCore.wxs | 6 +-
mitchcapper/FSClient/Setup/Setup.wixproj | 4 +
mitchcapper/FSClient/SimpleContactPluginBase.cs | 132 +++-
.../SimpleXmlContactPlugin.csproj | 4 +-
mitchcapper/FSClient/Sofia.cs | 2 +-
mitchcapper/FSClient/TODO.txt | 2 -
17 files changed, 806 insertions(+), 466 deletions(-)
create mode 100644 mitchcapper/FSClient/Controls/OurAutoCompleteBox.cs
hooks/post-receive
--
FreeSWITCH user-contributed scripts, etc
1
0
[freeswitch-contrib] FreeSWITCH user-contributed scripts, etc branch master updated. java-esl-client-0.9.2-379-gcfaca25
by git@svn.freeswitch.org 02 Feb '11
by git@svn.freeswitch.org 02 Feb '11
02 Feb '11
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FreeSWITCH user-contributed scripts, etc".
The branch, master has been updated
discards b6c998685330b7c689cd08726438271ac68f0361 (commit)
discards 75bbd885eb1eef0bcfea9b5371557823ca584522 (commit)
discards 274a7dd627ab98012ebf26c68c0ed5f440fa9033 (commit)
discards 2bd0da508187e942e4c906275e286cefedb3a62e (commit)
discards 48590eca54e7c93ef987768a24a844dfd72986d1 (commit)
discards 594536af195a45e9515ff1c40979a3f036934e49 (commit)
discards 4a414482ddc08fe77a42daab560a1bd860235154 (commit)
discards 3f2c531df509383cd93d9ae4379bfb656a969c7e (commit)
discards fc1ff4f95853eb0a66db9b3658f596c19f8e66c4 (commit)
discards 4277bdbadddb4bd6bd034812a4f59db60bd6e2aa (commit)
discards 5247b0c1000e9aa6e642cdd238396d679d7c6bb3 (commit)
discards 09778f943674b470c51a636aa8e3e3b22589708e (commit)
discards 007d9a09df8e52d540e46eb009b44f69121fc275 (commit)
discards f3c9f291d9c4854ff8c17e81552d9ed2a4c3b1e5 (commit)
via cfaca250a7c49387abd98ef3fbd7124efb02d422 (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 (b6c998685330b7c689cd08726438271ac68f0361)
\
N -- N -- N (cfaca250a7c49387abd98ef3fbd7124efb02d422)
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.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cfaca250a7c49387abd98ef3fbd7124efb02d422
Author: Raymond Chandler <intralanman(a)freeswitch.org>
Date: Wed Feb 2 18:40:00 2011 -0500
testing
diff --git a/intralanman/PHP/fs_curl/README b/intralanman/PHP/fs_curl/README
index 0fe8567..ec4930b 100644
--- a/intralanman/PHP/fs_curl/README
+++ b/intralanman/PHP/fs_curl/README
@@ -197,4 +197,4 @@ try calling
5000 - demo IVR (requires sounds and music files to be installed)
9995 - five second delay echo test
9996 - standard echo test
-9999 - music on hold (requires music files to be installed)
\ No newline at end of file
+9999 - music on hold (requires music files to be installed)
-----------------------------------------------------------------------
Summary of changes:
intralanman/PHP/fs_curl/README | 2 +-
mitchcapper/FSClient/Broker.cs | 58 +-
.../FSClient/Controls/OurAutoCompleteBox.cs | 32 -
.../FSClient/External Items/conf/freeswitch.xml | 2 +
mitchcapper/FSClient/FSClient.csproj | 83 +--
mitchcapper/FSClient/IContactPlugin.cs | 55 +-
.../FSClient/JabraHeadset/JabraHeadset.csproj | 4 +-
mitchcapper/FSClient/MainWindow.xaml | 22 +-
mitchcapper/FSClient/MainWindow.xaml.cs | 856 +++++++++-----------
.../PlantronicsHeadset/PlantronicsHeadset.csproj | 4 +-
mitchcapper/FSClient/README.txt | 2 +-
mitchcapper/FSClient/Setup/FSClient.wxs | 4 -
mitchcapper/FSClient/Setup/FSCore.wxs | 6 +-
mitchcapper/FSClient/Setup/Setup.wixproj | 4 -
mitchcapper/FSClient/SimpleContactPluginBase.cs | 132 +---
.../SimpleXmlContactPlugin.csproj | 4 +-
mitchcapper/FSClient/Sofia.cs | 2 +-
mitchcapper/FSClient/TODO.txt | 2 +
18 files changed, 467 insertions(+), 807 deletions(-)
delete mode 100644 mitchcapper/FSClient/Controls/OurAutoCompleteBox.cs
hooks/post-receive
--
FreeSWITCH user-contributed scripts, etc
1
0
[freeswitch] FreeSWITCH Source branch master updated. git2svn-syncpoint-master-1690-gf60fdf6
by git@svn.freeswitch.org 02 Feb '11
by git@svn.freeswitch.org 02 Feb '11
02 Feb '11
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FreeSWITCH Source".
The branch, master has been updated
via f60fdf653dd2d7f8d3eaa6a9086e1f68bd993c59 (commit)
from 85913b70b43483d4d3d840d128549ddba75b56a6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f60fdf653dd2d7f8d3eaa6a9086e1f68bd993c59
Author: Anthony Minessale <anthm(a)freeswitch.org>
Date: Wed Feb 2 16:22:43 2011 -0600
fix possible bad pointer in global vars (please test)
diff --git a/fscomm/widgets/codecwidget.cpp b/fscomm/widgets/codecwidget.cpp
index 42b10fe..2f82e1a 100644
--- a/fscomm/widgets/codecwidget.cpp
+++ b/fscomm/widgets/codecwidget.cpp
@@ -131,6 +131,8 @@ void CodecWidget::setCodecString(QString codecList)
QStringList parsed = codecList.split("{");
QString var = parsed.at(1);
var = var.split("}").at(0);
+ // warning switch_core_get_Variable may return an unsafe pointer in some cases.
+ // revise to use switch_core_get_variable_dup, and then free it after you are done.
var = switch_core_get_variable(var.toAscii().data());
if ( ! var.isEmpty() ) {
codecList = var;
-----------------------------------------------------------------------
Summary of changes:
fscomm/widgets/codecwidget.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
hooks/post-receive
--
FreeSWITCH Source
1
0
[freeswitch] FreeSWITCH Source branch master updated. git2svn-syncpoint-master-1689-g85913b7
by git@svn.freeswitch.org 02 Feb '11
by git@svn.freeswitch.org 02 Feb '11
02 Feb '11
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FreeSWITCH Source".
The branch, master has been updated
via 85913b70b43483d4d3d840d128549ddba75b56a6 (commit)
from 257bf9a46c44f76d8b38c90f288f364bcf1c6398 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 85913b70b43483d4d3d840d128549ddba75b56a6
Author: Anthony Minessale <anthm(a)freeswitch.org>
Date: Wed Feb 2 16:05:57 2011 -0600
only pass publish on when you have a subscription
diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c
index 19125c6..a38a61e 100644
--- a/src/mod/endpoints/mod_sofia/sofia_presence.c
+++ b/src/mod/endpoints/mod_sofia/sofia_presence.c
@@ -2570,6 +2570,19 @@ static int sofia_counterpath_crutch(void *pArg, int argc, char **argv, char **co
return 0;
}
+
+uint32_t sofia_presence_contact_count(sofia_profile_t *profile, const char *contact_str)
+{
+ char buf[32] = "";
+ char *sql;
+
+ sql = switch_mprintf("select count(*) from sip_subscriptions where profile_name='%q' and contact_str='%q'", profile->name, contact_str);
+
+ sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, buf, sizeof(buf));
+ switch_safe_free(sql);
+ return atoi(buf);
+}
+
void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip,
tagi_t tags[])
{
@@ -2584,7 +2597,7 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
char expstr[30] = "";
long exp = 0, exp_delta = 3600;
char *pd_dup = NULL;
- int count = 1;
+ int count = 1, sub_count = 0;
char *contact_str;
int open = 1;
@@ -2667,24 +2680,25 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
count = sofia_reg_reg_count(profile, from_user, from_host);
}
+ sub_count = sofia_presence_contact_count(profile, contact_str);
/* if (count > 1) let's not and say we did or all the clients who subscribe to their own presence will think they selves is offline */
event_type = sip_header_as_string(profile->home, (void *) sip->sip_event);
if (count < 2) {
- if ((sql =
- switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' "
- " and profile_name='%q' and hostname='%q'", from_user, from_host, profile->name, mod_sofia_globals.hostname))) {
+ if ((sql = switch_mprintf("delete from sip_presence where sip_user='%q' and sip_host='%q' "
+ " and profile_name='%q' and hostname='%q'",
+ from_user, from_host, profile->name, mod_sofia_globals.hostname))) {
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
- if ((sql =
- switch_mprintf("insert into sip_presence (sip_user, sip_host, status, rpid, expires, user_agent,"
- " profile_name, hostname, open_closed) "
- "values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')",
- from_user, from_host, note_txt, rpid, exp, full_agent, profile->name, mod_sofia_globals.hostname, open_closed))) {
-
+ if (sub_count > 0 && (sql = switch_mprintf("insert into sip_presence (sip_user, sip_host, status, rpid, expires, user_agent,"
+ " profile_name, hostname, open_closed) "
+ "values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')",
+ from_user, from_host, note_txt, rpid, exp, full_agent, profile->name,
+ mod_sofia_globals.hostname, open_closed))) {
+
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
@@ -2696,16 +2710,17 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
switch_safe_free(sql);
}
-
- if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent", full_agent);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", note_txt);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);
- switch_event_fire(&event);
+ if (sub_count > 0) {
+ if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent", full_agent);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", note_txt);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);
+ switch_event_fire(&event);
+ }
}
if (event_type) {
@@ -2728,7 +2743,12 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
switch_snprintf(expstr, sizeof(expstr), "%d", exp_delta);
switch_stun_random_string(etag, 8, NULL);
- nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), SIPTAG_ETAG_STR(etag), SIPTAG_EXPIRES_STR(expstr), TAG_END());
+
+ if (sub_count > 0) {
+ nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), SIPTAG_ETAG_STR(etag), SIPTAG_EXPIRES_STR(expstr), TAG_END());
+ } else {
+ nua_respond(nh, SIP_404_NOT_FOUND, NUTAG_WITH_THIS(nua), TAG_END());
+ }
switch_safe_free(contact_str);
}
-----------------------------------------------------------------------
Summary of changes:
src/mod/endpoints/mod_sofia/sofia_presence.c | 62 +++++++++++++++++---------
1 files changed, 41 insertions(+), 21 deletions(-)
hooks/post-receive
--
FreeSWITCH Source
1
0
[freeswitch] FreeSWITCH Source branch master updated. git2svn-syncpoint-master-1688-g257bf9a
by git@svn.freeswitch.org 02 Feb '11
by git@svn.freeswitch.org 02 Feb '11
02 Feb '11
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FreeSWITCH Source".
The branch, master has been updated
via 257bf9a46c44f76d8b38c90f288f364bcf1c6398 (commit)
from 4ae8282e6c6df0e296113e9b4b4a1383e1af8ad7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 257bf9a46c44f76d8b38c90f288f364bcf1c6398
Author: Anthony Minessale <anthm(a)freeswitch.org>
Date: Wed Feb 2 16:05:51 2011 -0600
fix possible bad pointer in global vars (please test)
diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c
index 970cb5b..2ef21cc 100755
--- a/libs/freetdm/mod_freetdm/mod_freetdm.c
+++ b/libs/freetdm/mod_freetdm/mod_freetdm.c
@@ -1067,9 +1067,16 @@ static const char* channel_get_variable(switch_core_session_t *session, switch_e
return variable;
}
}
+
+
+ // This is unsafe, I don't see anywhere in the whole code where this is called with NULL session anyway.
+ // There is a new switch_core_get_variable_dup that will strdup it for you and then you must free it.
+ // That messes up the abstraction completely so I am just commenting it out for you.....
+ /*
if ((variable = switch_core_get_variable(variable_name))) {
return variable;
}
+ */
return NULL;
}
diff --git a/libs/openzap/mod_openzap/mod_openzap.c b/libs/openzap/mod_openzap/mod_openzap.c
index d52149c..ef346b8 100644
--- a/libs/openzap/mod_openzap/mod_openzap.c
+++ b/libs/openzap/mod_openzap/mod_openzap.c
@@ -1234,19 +1234,19 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
zap_set_string(caller_data.ani.digits, dest);
}
- if ((var = switch_event_get_header(var_event, "openzap_outbound_ton")) || (var = switch_core_get_variable("openzap_outbound_ton"))) {
+ if ((var = switch_event_get_header(var_event, "openzap_outbound_ton"))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting TON to: %s\n", var);
zap_set_ton(var, &caller_data.ani.type);
} else {
caller_data.ani.type = outbound_profile->destination_number_ton;
}
- if ((var = switch_event_get_header(var_event, "openzap_custom_call_data")) || (var = switch_core_get_variable("openzap_custom_call_data"))) {
+ if ((var = switch_event_get_header(var_event, "openzap_custom_call_data"))) {
zap_set_string((char *)caller_data.raw_data, var);
caller_data.raw_data_len = strlen(var);
}
- if ((var = switch_event_get_header(var_event, "openzap_outbound_npi")) || (var = switch_core_get_variable("openzap_outbound_npi"))) {
+ if ((var = switch_event_get_header(var_event, "openzap_outbound_npi"))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting NPI to: %s\n", var);
zap_set_npi(var, &caller_data.ani.plan);
} else {
-----------------------------------------------------------------------
Summary of changes:
libs/freetdm/mod_freetdm/mod_freetdm.c | 7 +++++++
libs/openzap/mod_openzap/mod_openzap.c | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
hooks/post-receive
--
FreeSWITCH Source
1
0
[freeswitch] FreeSWITCH Source branch master updated. git2svn-syncpoint-master-1687-g4ae8282
by git@svn.freeswitch.org 02 Feb '11
by git@svn.freeswitch.org 02 Feb '11
02 Feb '11
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FreeSWITCH Source".
The branch, master has been updated
via 4ae8282e6c6df0e296113e9b4b4a1383e1af8ad7 (commit)
from 89c5f3bf8226bf605336b66e7761fd9f753d935a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4ae8282e6c6df0e296113e9b4b4a1383e1af8ad7
Author: Anthony Minessale <anthm(a)freeswitch.org>
Date: Wed Feb 2 15:43:26 2011 -0600
fix possible bad pointer in global vars (please test)
diff --git a/src/include/private/switch_core_pvt.h b/src/include/private/switch_core_pvt.h
index 30690b1..05cd24d 100644
--- a/src/include/private/switch_core_pvt.h
+++ b/src/include/private/switch_core_pvt.h
@@ -246,6 +246,7 @@ struct switch_runtime {
int sql_buffer_len;
int max_sql_buffer_len;
switch_dbtype_t odbc_dbtype;
+ char hostname[256];
};
extern struct switch_runtime runtime;
diff --git a/src/include/switch_core.h b/src/include/switch_core.h
index 109a169..69b0642 100644
--- a/src/include/switch_core.h
+++ b/src/include/switch_core.h
@@ -759,6 +759,9 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_force_locate(_In_z_
\return the value of the desired variable
*/
SWITCH_DECLARE(char *) switch_core_get_variable(_In_z_ const char *varname);
+SWITCH_DECLARE(char *) switch_core_get_variable_dup(_In_z_ const char *varname);
+SWITCH_DECLARE(char *) switch_core_get_variable_pdup(_In_z_ const char *varname, switch_memory_pool_t *pool);
+SWITCH_DECLARE(const char *) switch_core_get_hostname(void);
/*!
\brief Add a global variable to the core
diff --git a/src/include/switch_nat.h b/src/include/switch_nat.h
index bdbd51b..9e40546 100644
--- a/src/include/switch_nat.h
+++ b/src/include/switch_nat.h
@@ -49,7 +49,7 @@ typedef enum {
SWITCH_NAT_TCP
} switch_nat_ip_proto_t;
-
+SWITCH_DECLARE(const char *) switch_nat_get_type(void);
/*!
\brief Initilize the NAT Traversal System
diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c
index 7771b09..807770a 100644
--- a/src/mod/applications/mod_commands/mod_commands.c
+++ b/src/mod/applications/mod_commands/mod_commands.c
@@ -349,7 +349,7 @@ SWITCH_STANDARD_API(timer_test_function)
SWITCH_STANDARD_API(group_call_function)
{
- char *domain;
+ char *domain, *dup_domain = NULL;
char *group_name = NULL;
char *flags;
int ok = 0;
@@ -392,7 +392,9 @@ SWITCH_STANDARD_API(group_call_function)
if (domain) {
*domain++ = '\0';
} else {
- domain = switch_core_get_variable("domain");
+ if ((dup_domain = switch_core_get_variable_dup("domain"))) {
+ domain = dup_domain;
+ }
}
if (!zstr(domain)) {
@@ -544,13 +546,14 @@ SWITCH_STANDARD_API(group_call_function)
}
end:
-
+
switch_safe_free(group_name);
+ switch_safe_free(dup_domain);
if (!ok) {
stream->write_function(stream, "error/NO_ROUTE_DESTINATION");
}
-
+
return SWITCH_STATUS_SUCCESS;
}
@@ -559,7 +562,7 @@ SWITCH_STANDARD_API(in_group_function)
{
switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group;
int argc;
- char *mydata = NULL, *argv[2], *user, *domain;
+ char *mydata = NULL, *argv[2], *user, *domain, *dup_domain = NULL;
char delim = ',';
switch_event_t *params = NULL;
const char *rval = "false";
@@ -579,7 +582,9 @@ SWITCH_STANDARD_API(in_group_function)
if ((domain = strchr(user, '@'))) {
*domain++ = '\0';
} else {
- domain = switch_core_get_variable("domain");
+ if ((dup_domain = switch_core_get_variable_dup("domain"))) {
+ domain = dup_domain;
+ }
}
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
@@ -601,6 +606,7 @@ SWITCH_STANDARD_API(in_group_function)
switch_xml_free(xml);
switch_safe_free(mydata);
+ switch_safe_free(dup_domain);
switch_event_destroy(¶ms);
return SWITCH_STATUS_SUCCESS;
@@ -610,7 +616,7 @@ SWITCH_STANDARD_API(user_data_function)
{
switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params;
int argc;
- char *mydata = NULL, *argv[3], *key = NULL, *type = NULL, *user, *domain;
+ char *mydata = NULL, *argv[3], *key = NULL, *type = NULL, *user, *domain, *dup_domain = NULL;
char delim = ' ';
const char *container = "params", *elem = "param";
const char *result = NULL;
@@ -631,7 +637,9 @@ SWITCH_STANDARD_API(user_data_function)
if ((domain = strchr(user, '@'))) {
*domain++ = '\0';
} else {
- if (!(domain = switch_core_get_variable("domain"))) {
+ if ((dup_domain = switch_core_get_variable("domain"))) {
+ domain = dup_domain;
+ } else {
domain = "cluecon.com";
}
}
@@ -694,6 +702,7 @@ SWITCH_STANDARD_API(user_data_function)
}
switch_xml_free(xml);
switch_safe_free(mydata);
+ switch_safe_free(dup_domain);
switch_event_destroy(¶ms);
return SWITCH_STATUS_SUCCESS;
@@ -4375,7 +4384,9 @@ SWITCH_STANDARD_API(global_getvar_function)
if (zstr(cmd)) {
switch_core_dump_variables(stream);
} else {
- stream->write_function(stream, "%s", switch_str_nil(switch_core_get_variable(cmd)));
+ char *var = switch_core_get_variable_dup(cmd);
+ stream->write_function(stream, "%s", switch_str_nil(var));
+ switch_safe_free(var);
}
return SWITCH_STATUS_SUCCESS;
}
diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c
index 928a9b8..4be2a64 100755
--- a/src/mod/applications/mod_dptools/mod_dptools.c
+++ b/src/mod/applications/mod_dptools/mod_dptools.c
@@ -2787,7 +2787,7 @@ static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session
if ((domain = strchr(group, '@'))) {
*domain++ = '\0';
} else {
- domain = switch_core_get_variable("domain");
+ domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));
}
if (!domain) {
@@ -2908,7 +2908,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
if ((domain = strchr(user, '@'))) {
*domain++ = '\0';
} else {
- domain = switch_core_get_variable("domain");
+ domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));
}
if (!domain) {
@@ -3193,10 +3193,11 @@ static switch_status_t event_chat_send(const char *proto, const char *from, cons
if (body)
switch_event_add_body(event, "%s", body);
if (to) {
- const char *v;
+ char *v;
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "To", to);
- if ((v = switch_core_get_variable(to))) {
+ if ((v = switch_core_get_variable_dup(to))) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Command", v);
+ free(v);
}
}
@@ -3214,15 +3215,15 @@ static switch_status_t api_chat_send(const char *proto, const char *from, const
const char *body, const char *type, const char *hint)
{
if (to) {
- const char *v;
+ char *v = NULL;
switch_stream_handle_t stream = { 0 };
char *cmd = NULL, *arg;
- if (!(v = switch_core_get_variable(to))) {
- v = to;
+ if (!(v = switch_core_get_variable_dup(to))) {
+ v = strdup(to);
}
- cmd = strdup(v);
+ cmd = v;
switch_assert(cmd);
switch_url_decode(cmd);
diff --git a/src/mod/applications/mod_redis/mod_redis.c b/src/mod/applications/mod_redis/mod_redis.c
index 1e99967..ebf2a9e 100755
--- a/src/mod/applications/mod_redis/mod_redis.c
+++ b/src/mod/applications/mod_redis/mod_redis.c
@@ -89,7 +89,7 @@ SWITCH_LIMIT_INCR(limit_incr_redis)
}
/* Get the keys for redis server */
- uuid_rediskey = switch_core_session_sprintf(session,"%s_%s_%s", switch_core_get_variable("hostname"), realm, resource);
+ uuid_rediskey = switch_core_session_sprintf(session,"%s_%s_%s", switch_core_get_hostname(), realm, resource);
rediskey = switch_core_session_sprintf(session, "%s_%s", realm, resource);
if ((pvt = switch_channel_get_private(channel, "limit_redis"))) {
@@ -179,7 +179,7 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Couldn't decrement value corresponding to %s\n", (char *)p_key);
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
- p_uuid_key = switch_core_session_sprintf(session, "%s_%s", switch_core_get_variable("hostname"), (char *)p_key);
+ p_uuid_key = switch_core_session_sprintf(session, "%s_%s", switch_core_get_hostname(), (char *)p_key);
if (credis_decr(redis,p_uuid_key,&uuid_val) != 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Couldn't decrement value corresponding to %s\n", p_uuid_key);
switch_goto_status(SWITCH_STATUS_FALSE, end);
@@ -193,7 +193,7 @@ SWITCH_LIMIT_RELEASE(limit_release_redis)
} else {
rediskey = switch_core_session_sprintf(session, "%s_%s", realm, resource);
- uuid_rediskey = switch_core_session_sprintf(session, "%s_%s_%s", switch_core_get_variable("hostname"), realm, resource);
+ uuid_rediskey = switch_core_session_sprintf(session, "%s_%s_%s", switch_core_get_hostname(), realm, resource);
switch_core_hash_delete(pvt->hash, (const char *) rediskey);
if (credis_decr(redis, rediskey, &val) != 0) {
@@ -249,13 +249,13 @@ SWITCH_LIMIT_RESET(limit_reset_redis)
{
REDIS redis;
if (redis_factory(&redis) == SWITCH_STATUS_SUCCESS) {
- char *rediskey = switch_mprintf("%s_*", switch_core_get_variable("hostname"));
+ char *rediskey = switch_mprintf("%s_*", switch_core_get_hostname());
int dec = 0, val = 0, keyc;
char *uuids[2000];
if ((keyc = credis_keys(redis, rediskey, uuids, switch_arraylen(uuids))) > 0) {
int i = 0;
- int hostnamelen = strlen(switch_core_get_variable("hostname"))+1;
+ int hostnamelen = strlen(switch_core_get_hostname())+1;
for (i = 0; i < keyc && uuids[i]; i++){
const char *key = uuids[i] + hostnamelen;
diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c
index 76870f7..80b011e 100644
--- a/src/mod/applications/mod_voicemail/mod_voicemail.c
+++ b/src/mod/applications/mod_voicemail/mod_voicemail.c
@@ -2734,6 +2734,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
switch_memory_pool_t *pool = NULL;
char *forwarded_by = NULL;
char *read_flags = NORMAL_FLAG_STRING;
+ char *dup_domain = NULL;
if (zstr(data)) {
status = SWITCH_STATUS_FALSE;
@@ -2781,7 +2782,9 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
}
if (zstr(domain)) {
- domain = switch_core_get_variable("domain");
+ if ((dup_domain = switch_core_get_variable_dup("domain"))) {
+ domain = dup_domain;
+ }
profile_name = domain;
}
@@ -2915,6 +2918,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
end:
switch_safe_free(dup);
+ switch_safe_free(dup_domain);
return status;
}
diff --git a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c
index 5869d14..43534da 100644
--- a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c
+++ b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c
@@ -313,7 +313,7 @@ static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session,
if (session) {
profile = switch_channel_get_variable(switch_core_session_get_channel(session), "sip_profile");
} else {
- profile = switch_core_get_variable("sip_profile");
+ profile = switch_core_get_variable_pdup("sip_profile", switch_core_session_get_pool(session));
}
if (zstr(profile)) {
profile = "default";
diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c
index 66f62b2..9fb1f39 100644
--- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c
+++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c
@@ -2049,7 +2049,7 @@ static void set_profile_val(mdl_profile_t *profile, char *var, char *val)
} else if (!strcasecmp(var, "ext-rtp-ip")) {
char *ip = globals.guess_ip;
if (val && !strcasecmp(val, "auto-nat")) {
- ip = globals.auto_nat ? switch_core_get_variable("nat_public_addr") : globals.guess_ip;
+ ip = globals.auto_nat ? switch_core_get_variable_pdup("nat_public_addr", module_pool) : globals.guess_ip;
} else if (val && !strcasecmp(val, "auto")) {
globals.auto_nat = 0;
ip = globals.guess_ip;
@@ -2523,7 +2523,7 @@ static switch_status_t load_config(void)
memset(&globals, 0, sizeof(globals));
globals.running = 1;
- globals.auto_nat = (switch_core_get_variable("nat_type") ? 1 : 0);
+ globals.auto_nat = (switch_nat_get_type() ? 1 : 0);
switch_find_local_ip(globals.guess_ip, sizeof(globals.guess_ip), NULL, AF_INET);
diff --git a/src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp b/src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp
index 1b126eb..15009f2 100644
--- a/src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp
+++ b/src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp
@@ -1625,9 +1625,10 @@ bool Board::KhompPvt::setCollectCall()
DBG(FUNC, PVT_FMT(_target, "option drop collect call is '%s'") % (Opt::_options._drop_collect_call() ? "yes" : "no"));
// get global filter configuration value
- tmp_var = switch_core_get_variable("KDropCollectCall");
+ tmp_var = switch_core_get_variable_dup("KDropCollectCall");
confvalues.push_back(getTriStateValue(tmp_var));
DBG(FUNC, PVT_FMT(_target, "global KDropCollectCall was '%s'") % (tmp_var ? tmp_var : "(empty)"));
+ switch_safe_free(tmp_var);
try
{
diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c
index 8bceb3b..c78aac7 100644
--- a/src/mod/endpoints/mod_sofia/mod_sofia.c
+++ b/src/mod/endpoints/mod_sofia/mod_sofia.c
@@ -3501,7 +3501,7 @@ SWITCH_STANDARD_API(sofia_contact_function)
}
if (zstr(domain)) {
- domain = switch_core_get_variable("domain");
+ domain = switch_core_get_variable_pdup("domain", switch_core_session_get_pool(session));
}
if (!user) goto end;
@@ -4776,7 +4776,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
mod_sofia_globals.running = 1;
switch_mutex_unlock(mod_sofia_globals.mutex);
- mod_sofia_globals.auto_nat = (switch_core_get_variable("nat_type") ? 1 : 0);
+ mod_sofia_globals.auto_nat = (switch_nat_get_type() ? 1 : 0);
switch_queue_create(&mod_sofia_globals.presence_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool);
switch_queue_create(&mod_sofia_globals.mwi_queue, SOFIA_QUEUE_SIZE, mod_sofia_globals.pool);
diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c
index 47f94b1..825d1bf 100644
--- a/src/mod/endpoints/mod_sofia/sofia.c
+++ b/src/mod/endpoints/mod_sofia/sofia.c
@@ -1459,7 +1459,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
supported = switch_core_sprintf(profile->pool, "%s%sprecondition, path, replaces", use_100rel ? "100rel, " : "", use_timer ? "timer, " : "");
- if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_core_get_variable("nat_type")) {
+ if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_nat_get_type()) {
if (switch_nat_add_mapping(profile->sip_port, SWITCH_NAT_UDP, NULL, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
}
@@ -1676,7 +1676,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
switch_event_fire(&s_event);
}
- if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_core_get_variable("nat_type")) {
+ if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_nat_get_type()) {
if (switch_nat_del_mapping(profile->sip_port, SWITCH_NAT_UDP) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleted UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
}
@@ -3741,9 +3741,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
if (!profile->rtpip[0]) {
profile->rtpip[profile->rtpip_index++] = switch_core_strdup(profile->pool, mod_sofia_globals.guess_ip);
}
-
- if (switch_core_get_variable("nat_type")) {
- const char *ip = switch_core_get_variable("nat_public_addr");
+
+ if (switch_nat_get_type()) {
+ char *ip = switch_core_get_variable_dup("nat_public_addr");
if (ip && !strchr(profile->sipip, ':')) {
if (!profile->extrtpip) {
profile->extrtpip = switch_core_strdup(profile->pool, ip);
@@ -3754,6 +3754,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
sofia_set_pflag(profile, PFLAG_AUTO_NAT);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "NAT detected setting external ip to %s\n", ip);
}
+ switch_safe_free(ip);
}
if (profile->nonce_ttl < 60) {
diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
index f3a2c92..1462e4e 100644
--- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
+++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
@@ -2642,7 +2642,7 @@ static int config(void)
} else if (!strcmp(var, "debug")) {
globals.debug = atoi(val);
} else if (!strcmp(var, "nat-map")) {
- if (switch_true(val) && switch_core_get_variable("nat_type")) {
+ if (switch_true(val) && switch_nat_get_type()) {
prefs.nat_map = 1;
}
} else if (!strcmp(var, "listen-port")) {
@@ -2795,7 +2795,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
close_socket(&listen_list.sock);
- if (prefs.nat_map && switch_core_get_variable("nat_type")) {
+ if (prefs.nat_map && switch_nat_get_type()) {
switch_nat_del_mapping(prefs.port, SWITCH_NAT_TCP);
}
diff --git a/src/mod/formats/mod_file_string/mod_file_string.c b/src/mod/formats/mod_file_string/mod_file_string.c
index ca86cbd..7e36c72 100644
--- a/src/mod/formats/mod_file_string/mod_file_string.c
+++ b/src/mod/formats/mod_file_string/mod_file_string.c
@@ -77,7 +77,7 @@ static int next_file(switch_file_handle_t *handle)
if (!prefix) {
- if (!(prefix = switch_core_get_variable("sound_prefix"))) {
+ if (!(prefix = switch_core_get_variable_pdup("sound_prefix", handle->memory_pool))) {
prefix = SWITCH_GLOBAL_dirs.sounds_dir;
}
}
diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
index 9eb2636..1d6ee8d 100644
--- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
+++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
@@ -3378,8 +3378,9 @@ static JSBool js_global_get(JSContext * cx, JSObject * obj, uintN argc, jsval *
if (argc > 0) {
var_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
- val = switch_core_get_variable(var_name);
+ val = switch_core_get_variable_dup(var_name);
*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, val));
+ free(val);
return JS_TRUE;
}
diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
index 468190d..9e61312 100644
--- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
+++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
@@ -322,6 +322,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
int at = 0;
char *dp;
abyss_bool rval = FALSE;
+ char *dup_domain = NULL;
p = RequestHeaderValue(r, "authorization");
@@ -354,7 +355,9 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
if (globals.default_domain) {
domain_name = globals.default_domain;
} else {
- domain_name = switch_core_get_variable("domain");
+ if ((dup_domain = switch_core_get_variable_dup("domain"))) {
+ domain_name = dup_domain;
+ }
}
}
}
@@ -465,6 +468,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
switch_safe_free(mypass1);
switch_safe_free(mypass2);
switch_safe_free(box);
+ switch_safe_free(dup_domain);
return rval;
}
diff --git a/src/switch_channel.c b/src/switch_channel.c
index 70b1879..f750496 100644
--- a/src/switch_channel.c
+++ b/src/switch_channel.c
@@ -672,7 +672,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_hold_music_partner(switch_channe
SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *channel, const char *varname, switch_bool_t dup)
{
- const char *v = NULL, *r = NULL;
+ const char *v = NULL, *r = NULL, *vdup = NULL;
switch_assert(channel != NULL);
switch_mutex_lock(channel->profile_mutex);
@@ -690,13 +690,16 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_dup(switch_channel_t *c
}
if (!cp || !(v = switch_caller_get_field_by_name(cp, varname))) {
- v = switch_core_get_variable(varname);
+ if ((vdup = switch_core_get_variable_pdup(varname, switch_core_session_get_pool(channel->session)))) {
+ v = vdup;
+ }
}
}
- if (dup) {
- if (v)
+ if (dup && v != vdup) {
+ if (v) {
r = switch_core_session_strdup(channel->session, v);
+ }
} else {
r = v;
}
diff --git a/src/switch_console.c b/src/switch_console.c
index 41bbb91..c5d601b 100644
--- a/src/switch_console.c
+++ b/src/switch_console.c
@@ -643,9 +643,9 @@ SWITCH_DECLARE_NONSTD(switch_status_t) switch_console_list_uuid(const char *line
if (!zstr(cursor)) {
sql = switch_mprintf("select distinct uuid from channels where uuid like '%q%%' and hostname='%q' order by uuid",
- cursor, switch_core_get_variable("hostname"));
+ cursor, switch_core_get_hostname());
} else {
- sql = switch_mprintf("select distinct uuid from channels where hostname='%q' order by uuid", switch_core_get_variable("hostname"));
+ sql = switch_mprintf("select distinct uuid from channels where hostname='%q' order by uuid", switch_core_get_hostname());
}
switch_cache_db_execute_sql_callback(db, sql, uuid_callback, &h, &errmsg);
@@ -764,7 +764,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
if (h.words == 0) {
sql = switch_mprintf("select distinct name from interfaces where type='api' and name like '%q%%' and hostname='%q' order by name",
- buf, switch_core_get_variable("hostname"));
+ buf, switch_core_get_hostname());
}
if (sql) {
@@ -792,7 +792,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
if (h.words == 0) {
stream.write_function(&stream, "select distinct a1 from complete where " "a1 not in (select name from interfaces where hostname='%s') %s ",
- switch_core_get_variable("hostname"), argc ? "and" : "");
+ switch_core_get_hostname(), argc ? "and" : "");
} else {
if (db->type == SCDB_TYPE_CORE_DB) {
stream.write_function(&stream, "select distinct a%d,'%q','%q' from complete where ", h.words + 1, switch_str_nil(dup), switch_str_nil(lp));
@@ -821,7 +821,7 @@ SWITCH_DECLARE(unsigned char) switch_console_complete(const char *line, const ch
}
}
- stream.write_function(&stream, " and hostname='%s' order by a%d", switch_core_get_variable("hostname"), h.words + 1);
+ stream.write_function(&stream, " and hostname='%s' order by a%d", switch_core_get_hostname(), h.words + 1);
switch_cache_db_execute_sql_callback(db, stream.data, comp_callback, &h, &errmsg);
@@ -1794,7 +1794,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
}
}
}
- mystream.write_function(&mystream, " '%s')", switch_core_get_variable("hostname"));
+ mystream.write_function(&mystream, " '%s')", switch_core_get_hostname());
switch_cache_db_persistant_execute(db, mystream.data, 5);
status = SWITCH_STATUS_SUCCESS;
} else if (!strcasecmp(argv[0], "add")) {
@@ -1810,7 +1810,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
}
}
}
- mystream.write_function(&mystream, " '%s')", switch_core_get_variable("hostname"));
+ mystream.write_function(&mystream, " '%s')", switch_core_get_hostname());
switch_cache_db_persistant_execute(db, mystream.data, 5);
status = SWITCH_STATUS_SUCCESS;
@@ -1827,7 +1827,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
mystream.write_function(&mystream, "a%d = '%w'%w", x + 1, switch_str_nil(argv[x + 1]), x == argc - 2 ? "" : " and ");
}
}
- mystream.write_function(&mystream, " and hostname='%s'", switch_core_get_variable("hostname"));
+ mystream.write_function(&mystream, " and hostname='%s'", switch_core_get_hostname());
switch_cache_db_persistant_execute(db, mystream.data, 1);
}
status = SWITCH_STATUS_SUCCESS;
@@ -1863,38 +1863,38 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_alias(const char *string)
}
if (!strcasecmp(argv[0], "stickyadd") && argc == 3) {
- sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_variable("hostname"));
+ sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_hostname());
switch_cache_db_persistant_execute(db, sql, 5);
switch_safe_free(sql);
if (db->type == SCDB_TYPE_CORE_DB) {
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (1, '%q','%q','%q')",
- argv[1], argv[2], switch_core_get_variable("hostname"));
+ argv[1], argv[2], switch_core_get_hostname());
} else {
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (1, '%w','%w','%w')",
- argv[1], argv[2], switch_core_get_variable("hostname"));
+ argv[1], argv[2], switch_core_get_hostname());
}
switch_cache_db_persistant_execute(db, sql, 5);
status = SWITCH_STATUS_SUCCESS;
} else if (!strcasecmp(argv[0], "add") && argc == 3) {
- sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_variable("hostname"));
+ sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_hostname());
switch_cache_db_persistant_execute(db, sql, 5);
switch_safe_free(sql);
if (db->type == SCDB_TYPE_CORE_DB) {
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (0, '%q','%q','%q')",
- argv[1], argv[2], switch_core_get_variable("hostname"));
+ argv[1], argv[2], switch_core_get_hostname());
} else {
sql = switch_mprintf("insert into aliases (sticky, alias, command, hostname) values (0, '%w','%w','%w')",
- argv[1], argv[2], switch_core_get_variable("hostname"));
+ argv[1], argv[2], switch_core_get_hostname());
}
switch_cache_db_persistant_execute(db, sql, 5);
status = SWITCH_STATUS_SUCCESS;
} else if (!strcasecmp(argv[0], "del") && argc == 2) {
char *what = argv[1];
if (!strcasecmp(what, "*")) {
- sql = switch_mprintf("delete from aliases where hostname='%q'", switch_core_get_variable("hostname"));
+ sql = switch_mprintf("delete from aliases where hostname='%q'", switch_core_get_hostname());
switch_cache_db_persistant_execute(db, sql, 1);
} else {
- sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_variable("hostname"));
+ sql = switch_mprintf("delete from aliases where alias='%q' and hostname='%q'", argv[1], switch_core_get_hostname());
switch_cache_db_persistant_execute(db, sql, 5);
}
status = SWITCH_STATUS_SUCCESS;
diff --git a/src/switch_core.c b/src/switch_core.c
index 43fb36d..8754305 100644
--- a/src/switch_core.c
+++ b/src/switch_core.c
@@ -261,6 +261,11 @@ SWITCH_DECLARE(void) switch_core_dump_variables(switch_stream_handle_t *stream)
switch_mutex_unlock(runtime.global_mutex);
}
+SWITCH_DECLARE(const char *) switch_core_get_hostname(void)
+{
+ return runtime.hostname;
+}
+
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
{
char *val;
@@ -270,6 +275,32 @@ SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
return val;
}
+SWITCH_DECLARE(char *) switch_core_get_variable_dup(const char *varname)
+{
+ char *val = NULL, *v;
+
+ switch_mutex_lock(runtime.global_var_mutex);
+ if ((v = (char *) switch_event_get_header(runtime.global_vars, varname))) {
+ val = strdup(v);
+ }
+ switch_mutex_unlock(runtime.global_var_mutex);
+
+ return val;
+}
+
+SWITCH_DECLARE(char *) switch_core_get_variable_pdup(const char *varname, switch_memory_pool_t *pool)
+{
+ char *val = NULL, *v;
+
+ switch_mutex_lock(runtime.global_var_mutex);
+ if ((v = (char *) switch_event_get_header(runtime.global_vars, varname))) {
+ val = switch_core_strdup(pool, v);
+ }
+ switch_mutex_unlock(runtime.global_var_mutex);
+
+ return val;
+}
+
static void switch_core_unset_variables(void)
{
switch_mutex_lock(runtime.global_var_mutex);
@@ -1202,12 +1233,18 @@ static void switch_core_set_serial(void)
if ((fd = open(path, O_RDONLY, 0)) < 0) {
- char *ip = switch_core_get_variable("local_ip_v4");
+ char *ip = switch_core_get_variable_dup("local_ip_v4");
uint32_t ipi = 0;
switch_byte_t *byte;
int i = 0;
- switch_inet_pton(AF_INET, ip, &ipi);
+ if (ip) {
+ switch_inet_pton(AF_INET, ip, &ipi);
+ free(ip);
+ ip = NULL;
+ }
+
+
byte = (switch_byte_t *) & ipi;
for (i = 0; i < 8; i += 2) {
@@ -1237,7 +1274,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
char guess_ip[256];
int mask = 0;
struct in_addr in;
- char hostname[256] = "";
+
if (runtime.runlevel > 0) {
/* one per customer */
@@ -1310,8 +1347,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
runtime.console = stdout;
}
- gethostname(hostname, sizeof(hostname));
- switch_core_set_variable("hostname", hostname);
+ gethostname(runtime.hostname, sizeof(runtime.hostname));
+ switch_core_set_variable("hostname", runtime.hostname);
switch_find_local_ip(guess_ip, sizeof(guess_ip), &mask, AF_INET);
switch_core_set_variable("local_ip_v4", guess_ip);
diff --git a/src/switch_core_file.c b/src/switch_core_file.c
index 19f2354..fc7d223 100644
--- a/src/switch_core_file.c
+++ b/src/switch_core_file.c
@@ -102,7 +102,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
}
if (!spool_path) {
- spool_path = switch_core_get_variable(SWITCH_AUDIO_SPOOL_PATH_VARIABLE);
+ spool_path = switch_core_get_variable_pdup(SWITCH_AUDIO_SPOOL_PATH_VARIABLE, fh->memory_pool);
}
file_path = fh->file_path;
diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c
index 2db2a0d..73890a1 100644
--- a/src/switch_core_sqldb.c
+++ b/src/switch_core_sqldb.c
@@ -1134,7 +1134,7 @@ static void core_event_handler(switch_event_t *event)
new_sql() = switch_mprintf("insert into tasks values(%q,'%q','%q',%q, '%q')",
id,
switch_event_get_header_nil(event, "task-desc"),
- switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", switch_core_get_variable("hostname")
+ switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", switch_core_get_hostname()
);
}
}
@@ -1142,7 +1142,7 @@ static void core_event_handler(switch_event_t *event)
case SWITCH_EVENT_DEL_SCHEDULE:
case SWITCH_EVENT_EXE_SCHEDULE:
new_sql() = switch_mprintf("delete from tasks where task_id=%q and hostname='%q'",
- switch_event_get_header_nil(event, "task-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "task-id"), switch_core_get_hostname());
break;
case SWITCH_EVENT_RE_SCHEDULE:
{
@@ -1153,7 +1153,7 @@ static void core_event_handler(switch_event_t *event)
new_sql() = switch_mprintf("update tasks set task_desc='%q',task_group='%q', task_sql_manager=%q where task_id=%q and hostname='%q'",
switch_event_get_header_nil(event, "task-desc"),
switch_event_get_header_nil(event, "task-group"), manager ? manager : "0", id,
- switch_core_get_variable("hostname"));
+ switch_core_get_hostname());
}
}
break;
@@ -1163,10 +1163,10 @@ static void core_event_handler(switch_event_t *event)
if (uuid) {
new_sql() = switch_mprintf("delete from channels where uuid='%q' and hostname='%q'",
- uuid, switch_core_get_variable("hostname"));
+ uuid, switch_core_get_hostname());
new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",
- uuid, uuid, switch_core_get_variable("hostname"));
+ uuid, uuid, switch_core_get_hostname());
}
}
@@ -1178,12 +1178,12 @@ static void core_event_handler(switch_event_t *event)
"update calls set callee_uuid='%q' where callee_uuid='%q' and hostname='%q'",
switch_event_get_header_nil(event, "unique-id"),
switch_event_get_header_nil(event, "old-unique-id"),
- switch_core_get_variable("hostname"),
+ switch_core_get_hostname(),
switch_event_get_header_nil(event, "unique-id"),
switch_event_get_header_nil(event, "old-unique-id"),
- switch_core_get_variable("hostname"),
+ switch_core_get_hostname(),
switch_event_get_header_nil(event, "unique-id"),
- switch_event_get_header_nil(event, "old-unique-id"), switch_core_get_variable("hostname")
+ switch_event_get_header_nil(event, "old-unique-id"), switch_core_get_hostname()
);
break;
}
@@ -1198,7 +1198,7 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil(event, "channel-state"),
switch_event_get_header_nil(event, "channel-call-state"),
switch_event_get_header_nil(event, "caller-dialplan"),
- switch_event_get_header_nil(event, "caller-context"), switch_core_get_variable("hostname")
+ switch_event_get_header_nil(event, "caller-context"), switch_core_get_hostname()
);
break;
case SWITCH_EVENT_CODEC:
@@ -1211,7 +1211,7 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil(event, "channel-write-codec-name"),
switch_event_get_header_nil(event, "channel-write-codec-rate"),
switch_event_get_header_nil(event, "channel-write-codec-bit-rate"),
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
break;
case SWITCH_EVENT_CHANNEL_HOLD:
case SWITCH_EVENT_CHANNEL_UNHOLD:
@@ -1223,7 +1223,7 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil(event, "application-data"),
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname")
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname()
);
}
@@ -1238,7 +1238,7 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil(event, "channel-presence-data"),
switch_event_get_header_nil(event, "channel-call-uuid"),
extra_cols,
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
free(extra_cols);
} else {
new_sql() = switch_mprintf("update channels set "
@@ -1246,7 +1246,7 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
switch_event_get_header_nil(event, "channel-call-uuid"),
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
}
}
@@ -1281,7 +1281,7 @@ static void core_event_handler(switch_event_t *event)
switch_str_nil(name),
switch_str_nil(number),
switch_event_get_header_nil(event, "direction"),
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
name = switch_event_get_header(event, "callee-name");
number = switch_event_get_header(event, "callee-number");
@@ -1298,7 +1298,7 @@ static void core_event_handler(switch_event_t *event)
{
new_sql() = switch_mprintf("update channels set callstate='%q' where uuid='%q' and hostname='%q'",
switch_event_get_header_nil(event, "channel-call-state"),
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
}
break;
@@ -1330,7 +1330,7 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
extra_cols,
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
free(extra_cols);
} else {
new_sql() = switch_mprintf("update channels set state='%s',cid_name='%q',cid_num='%q',"
@@ -1345,13 +1345,13 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil(event, "caller-context"),
switch_event_get_header_nil(event, "channel-presence-id"),
switch_event_get_header_nil(event, "channel-presence-data"),
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
}
break;
default:
new_sql() = switch_mprintf("update channels set state='%s' where uuid='%s' and hostname='%q'",
switch_event_get_header_nil(event, "channel-state"),
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
break;
}
@@ -1377,7 +1377,7 @@ static void core_event_handler(switch_event_t *event)
new_sql() = switch_mprintf("update channels set call_uuid='%q' where uuid='%s' and hostname='%q'",
switch_event_get_header_nil(event, "channel-call-uuid"),
- switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "unique-id"), switch_core_get_hostname());
if (runtime.odbc_dbtype == DBTYPE_DEFAULT) {
func_name = "function";
@@ -1404,7 +1404,7 @@ static void core_event_handler(switch_event_t *event)
callee_cid_num,
switch_event_get_header_nil(event, "Other-Leg-destination-number"),
switch_event_get_header_nil(event, "Other-Leg-channel-name"),
- switch_event_get_header_nil(event, "Other-Leg-unique-id"), switch_core_get_variable("hostname")
+ switch_event_get_header_nil(event, "Other-Leg-unique-id"), switch_core_get_hostname()
);
}
break;
@@ -1413,14 +1413,14 @@ static void core_event_handler(switch_event_t *event)
char *uuid = switch_event_get_header_nil(event, "caller-unique-id");
new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",
- uuid, uuid, switch_core_get_variable("hostname"));
+ uuid, uuid, switch_core_get_hostname());
break;
}
case SWITCH_EVENT_SHUTDOWN:
new_sql() = switch_mprintf("delete from channels where hostname='%q';"
"delete from interfaces where hostname='%q';"
"delete from calls where hostname='%q'",
- switch_core_get_variable("hostname"), switch_core_get_variable("hostname"), switch_core_get_variable("hostname")
+ switch_core_get_hostname(), switch_core_get_hostname(), switch_core_get_hostname()
);
break;
case SWITCH_EVENT_LOG:
@@ -1438,7 +1438,7 @@ static void core_event_handler(switch_event_t *event)
switch_mprintf
("insert into interfaces (type,name,description,syntax,ikey,filename,hostname) values('%q','%q','%q','%q','%q','%q','%q')", type, name,
switch_str_nil(description), switch_str_nil(syntax), switch_str_nil(key), switch_str_nil(filename),
- switch_core_get_variable("hostname")
+ switch_core_get_hostname()
);
}
break;
@@ -1449,7 +1449,7 @@ static void core_event_handler(switch_event_t *event)
const char *name = switch_event_get_header_nil(event, "name");
if (!zstr(type) && !zstr(name)) {
new_sql() = switch_mprintf("delete from interfaces where type='%q' and name='%q' and hostname='%q'", type, name,
- switch_core_get_variable("hostname"));
+ switch_core_get_hostname());
}
break;
}
@@ -1461,7 +1461,7 @@ static void core_event_handler(switch_event_t *event)
break;
}
new_sql() = switch_mprintf("update channels set secure='%s' where uuid='%s' and hostname='%q'",
- type, switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_variable("hostname")
+ type, switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_hostname()
);
break;
}
@@ -1472,12 +1472,12 @@ static void core_event_handler(switch_event_t *event)
if (!strcmp("add", op)) {
new_sql() = switch_mprintf("insert into nat (port, proto, sticky, hostname) values (%s, %s, %d,'%q')",
switch_event_get_header_nil(event, "port"),
- switch_event_get_header_nil(event, "proto"), sticky, switch_core_get_variable("hostname")
+ switch_event_get_header_nil(event, "proto"), sticky, switch_core_get_hostname()
);
} else if (!strcmp("del", op)) {
new_sql() = switch_mprintf("delete from nat where port=%s and proto=%s and hostname='%q'",
switch_event_get_header_nil(event, "port"),
- switch_event_get_header_nil(event, "proto"), switch_core_get_variable("hostname"));
+ switch_event_get_header_nil(event, "proto"), switch_core_get_hostname());
} else if (!strcmp("status", op)) {
/* call show nat api */
} else if (!strcmp("status_response", op)) {
@@ -1664,7 +1664,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
char sql[512] = "";
char *tables[] = { "channels", "calls", "interfaces", "tasks", NULL };
int i;
- const char *hostname = switch_core_get_variable("hostname");
+ const char *hostname = switch_core_get_hostname();
for (i = 0; tables[i]; i++) {
switch_snprintf(sql, sizeof(sql), "delete from %s where hostname='%s'", tables[i], hostname);
diff --git a/src/switch_event.c b/src/switch_event.c
index 003fc82..3e12ea1 100644
--- a/src/switch_event.c
+++ b/src/switch_event.c
@@ -1673,6 +1673,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
int offset = 0;
int ooffset = 0;
char *ptr;
+ char *gvar = NULL;
if ((expanded = switch_event_expand_headers(event, (char *) vname)) == vname) {
expanded = NULL;
@@ -1689,7 +1690,9 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
}
if (!(sub_val = switch_event_get_header(event, vname))) {
- sub_val = switch_core_get_variable(vname);
+ if ((gvar = switch_core_get_variable_dup(vname))) {
+ sub_val = gvar;
+ }
}
if (offset || ooffset) {
@@ -1710,6 +1713,7 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const
}
}
+ switch_safe_free(gvar);
switch_safe_free(expanded);
} else {
switch_stream_handle_t stream = { 0 };
diff --git a/src/switch_nat.c b/src/switch_nat.c
index 536baee..85b0247 100644
--- a/src/switch_nat.c
+++ b/src/switch_nat.c
@@ -45,6 +45,7 @@
typedef struct {
switch_nat_type_t nat_type;
+ char nat_type_str[5];
struct UPNPUrls urls;
struct IGDdatas data;
char *descURL;
@@ -420,6 +421,7 @@ SWITCH_DECLARE(void) switch_nat_init(switch_memory_pool_t *pool)
switch_core_set_variable("nat_public_addr", nat_globals.pub_addr);
switch_core_set_variable("nat_private_addr", nat_globals.pvt_addr);
switch_core_set_variable("nat_type", nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp");
+ strncpy(nat_globals.nat_type_str, nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", sizeof(nat_globals.nat_type_str) - 1);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "NAT detected type: %s, ExtIP: '%s'\n",
nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", nat_globals.pub_addr);
@@ -564,6 +566,11 @@ static switch_status_t switch_nat_del_mapping_upnp(switch_port_t port, switch_na
return status;
}
+SWITCH_DECLARE(const char *) switch_nat_get_type(void)
+{
+ return nat_globals.nat_type_str;
+}
+
SWITCH_DECLARE(switch_status_t) switch_nat_add_mapping_internal(switch_port_t port, switch_nat_ip_proto_t proto, switch_port_t * external_port,
switch_bool_t sticky, switch_bool_t publish)
{
diff --git a/src/switch_rtp.c b/src/switch_rtp.c
index 4acadfe..e8d7558 100644
--- a/src/switch_rtp.c
+++ b/src/switch_rtp.c
@@ -791,8 +791,8 @@ static void zrtp_logger(int level, const char *data, int len, int offset)
SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool)
{
#ifdef ENABLE_ZRTP
- const char *zid_string = switch_core_get_variable("switch_serial");
- const char *zrtp_enabled = switch_core_get_variable("zrtp_enabled");
+ const char *zid_string = switch_core_get_variable_pdup("switch_serial", pool);
+ const char *zrtp_enabled = switch_core_get_variable_pdup("zrtp_enabled", pool);
zrtp_config_t zrtp_config;
char zrtp_cache_path[256] = "";
zrtp_on = zrtp_enabled ? switch_true(zrtp_enabled) : 0;
diff --git a/src/switch_utils.c b/src/switch_utils.c
index 850b07f..eb5ed7f 100644
--- a/src/switch_utils.c
+++ b/src/switch_utils.c
@@ -1154,8 +1154,8 @@ SWITCH_DECLARE(switch_status_t) switch_find_local_ip(char *buf, int len, int *ma
{
switch_status_t status = SWITCH_STATUS_FALSE;
char *base;
- const char *force_local_ip_v4 = switch_core_get_variable("force_local_ip_v4");
- const char *force_local_ip_v6 = switch_core_get_variable("force_local_ip_v6");
+ char *force_local_ip_v4 = switch_core_get_variable_dup("force_local_ip_v4");
+ char *force_local_ip_v6 = switch_core_get_variable_dup("force_local_ip_v6");
#ifdef WIN32
SOCKET tmp_socket;
@@ -1176,14 +1176,20 @@ SWITCH_DECLARE(switch_status_t) switch_find_local_ip(char *buf, int len, int *ma
case AF_INET:
if (force_local_ip_v4) {
switch_copy_string(buf, force_local_ip_v4, len);
+ switch_safe_free(force_local_ip_v4);
+ switch_safe_free(force_local_ip_v6);
return SWITCH_STATUS_SUCCESS;
}
case AF_INET6:
if (force_local_ip_v6) {
switch_copy_string(buf, force_local_ip_v6, len);
+ switch_safe_free(force_local_ip_v4);
+ switch_safe_free(force_local_ip_v6);
return SWITCH_STATUS_SUCCESS;
}
default:
+ switch_safe_free(force_local_ip_v4);
+ switch_safe_free(force_local_ip_v6);
break;
}
diff --git a/src/switch_xml.c b/src/switch_xml.c
index 964a769..4c30d98 100644
--- a/src/switch_xml.c
+++ b/src/switch_xml.c
@@ -1208,11 +1208,12 @@ static char *expand_vars(char *buf, char *ebuf, switch_size_t elen, switch_size_
var = rp;
*e++ = '\0';
rp = e;
- if ((val = switch_core_get_variable(var))) {
+ if ((val = switch_core_get_variable_dup(var))) {
char *p;
for (p = val; p && *p && wp <= ep; p++) {
*wp++ = *p;
}
+ free(val);
}
continue;
} else if (err) {
-----------------------------------------------------------------------
Summary of changes:
src/include/private/switch_core_pvt.h | 1 +
src/include/switch_core.h | 3 +
src/include/switch_nat.h | 2 +-
src/mod/applications/mod_commands/mod_commands.c | 29 +++++++---
src/mod/applications/mod_dptools/mod_dptools.c | 17 +++---
src/mod/applications/mod_redis/mod_redis.c | 10 ++--
src/mod/applications/mod_voicemail/mod_voicemail.c | 6 ++-
.../mod_dialplan_asterisk/mod_dialplan_asterisk.c | 2 +-
src/mod/endpoints/mod_dingaling/mod_dingaling.c | 4 +-
src/mod/endpoints/mod_khomp/src/khomp_pvt.cpp | 3 +-
src/mod/endpoints/mod_sofia/mod_sofia.c | 4 +-
src/mod/endpoints/mod_sofia/sofia.c | 11 ++--
.../mod_event_socket/mod_event_socket.c | 4 +-
src/mod/formats/mod_file_string/mod_file_string.c | 2 +-
.../languages/mod_spidermonkey/mod_spidermonkey.c | 3 +-
src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c | 6 ++-
src/switch_channel.c | 11 +++--
src/switch_console.c | 32 ++++++------
src/switch_core.c | 47 +++++++++++++++--
src/switch_core_file.c | 2 +-
src/switch_core_sqldb.c | 56 ++++++++++----------
src/switch_event.c | 6 ++-
src/switch_nat.c | 7 +++
src/switch_rtp.c | 4 +-
src/switch_utils.c | 10 +++-
src/switch_xml.c | 3 +-
26 files changed, 185 insertions(+), 100 deletions(-)
hooks/post-receive
--
FreeSWITCH Source
1
0