提交 975e42fa authored 作者: Chad Phillips's avatar Chad Phillips
...@@ -258,7 +258,7 @@ namespace FSClient { ...@@ -258,7 +258,7 @@ namespace FSClient {
} }
private void StopRecordCall(){ private void StopRecordCall(){
Utils.bgapi_exec("uuid_record", leg_b_uuid + " stop \"" + am_recording_file + "\""); Utils.bgapi_exec("uuid_record", leg_b_uuid + " stop '" + am_recording_file + "'");
am_recording_file = null; am_recording_file = null;
} }
...@@ -276,7 +276,7 @@ namespace FSClient { ...@@ -276,7 +276,7 @@ namespace FSClient {
full_path = full_path.Replace('\\', '/'); //seems freeswitch will selectively escape what it cant otherwise full_path = full_path.Replace('\\', '/'); //seems freeswitch will selectively escape what it cant otherwise
am_recording_file = full_path + ".wav"; am_recording_file = full_path + ".wav";
Utils.bgapi_exec("uuid_setvar", leg_b_uuid + " record_stereo true"); Utils.bgapi_exec("uuid_setvar", leg_b_uuid + " record_stereo true");
Utils.bgapi_exec("uuid_record", leg_b_uuid + " start \"" + am_recording_file +"\""); Utils.bgapi_exec("uuid_record", leg_b_uuid + " start '" + am_recording_file +"'");
} }
private void Call_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { private void Call_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) {
......
...@@ -6,11 +6,12 @@ my $WORKING_DIR = "FSClient\\bin\Debug"; ...@@ -6,11 +6,12 @@ my $WORKING_DIR = "FSClient\\bin\Debug";
my $USE_LN = 0; #THIS SHOULD BE SET TO 0 (unless you have an ln equiv for windows) my $USE_LN = 0; #THIS SHOULD BE SET TO 0 (unless you have an ln equiv for windows)
my $COPY_CONF = 1; my $COPY_CONF = 1;
my $VERBOSE = 1; my $VERBOSE = 1;
my $try_pdb = 1;
my $VERBOSE_SYS_RES = 0; my $VERBOSE_SYS_RES = 0;
die "Build directory does not exist: $FS_BUILD_PATH" if (! -e $FS_BUILD_PATH); die "Build directory does not exist: $FS_BUILD_PATH" if (! -e $FS_BUILD_PATH);
die "Working directory does not exist: $WORKING_DIR" if (! -e $WORKING_DIR); die "Working directory does not exist: $WORKING_DIR" if (! -e $WORKING_DIR);
my @MAIN_FILES = qw/FreeSwitch.dll libapr.dll libaprutil.dll libbroadvoice.dll libspandsp.dll libteletone.dll mod_managed.dll pthread.dll libeay32.dll ssleay32.dll/; my @MAIN_FILES = qw/FreeSwitch.dll libapr.dll libaprutil.dll libbroadvoice.dll libspandsp.dll libteletone.dll mod_managed.dll pthread.dll libeay32.dll ssleay32.dll FreeSWITCH.Managed.dll/;
my @modules = qw/mod_celt mod_commands mod_console mod_dialplan_xml mod_dptools mod_event_socket mod_ilbc mod_local_stream mod_logfile mod_loopback mod_PortAudio mod_siren mod_sndfile mod_sofia mod_speex mod_tone_stream mod_h26x mod_silk mod_spandsp mod_bv/; my @modules = qw/mod_celt mod_commands mod_console mod_dialplan_xml mod_dptools mod_event_socket mod_ilbc mod_local_stream mod_logfile mod_loopback mod_PortAudio mod_siren mod_sndfile mod_sofia mod_speex mod_tone_stream mod_h26x mod_silk mod_spandsp mod_bv/;
my $link_cmd = $USE_LN ? "ln -s -a" : "copy"; my $link_cmd = $USE_LN ? "ln -s -a" : "copy";
...@@ -26,23 +27,42 @@ sub exec_cmd($){ ...@@ -26,23 +27,42 @@ sub exec_cmd($){
exec_cmd("mkdir " . $WORKING_DIR . "\\mod") if (-e $WORKING_DIR . "\\mod" == 0); exec_cmd("mkdir " . $WORKING_DIR . "\\mod") if (-e $WORKING_DIR . "\\mod" == 0);
foreach my $module (@modules){ foreach my $module (@modules){
my $rel_path = "mod\\" . $module . ".dll"; my $rel_path = "mod\\" . $module . ".dll";
next if (-e "$WORKING_DIR\\" . $rel_path && $USE_LN);
my $src_path = $FS_BUILD_PATH . "\\" . $rel_path; my $src_path = $FS_BUILD_PATH . "\\" . $rel_path;
if (-e $src_path == 0){ if (-e $src_path == 0){
print "Warning: $src_path does not exist\n"; print "Warning: $src_path does not exist\n";
next; next;
} }
if ($try_pdb){
my $pdb_file = $src_path;
$pdb_file =~ s/\.dll$/.pdb/si;
my $pdb_dest = "$WORKING_DIR\\$rel_path";
$pdb_dest =~ s/\.dll$/.pdb/si;
if (-e $pdb_file && (! $USE_LN || ! -e $pdb_dest) ){
exec_cmd($link_cmd . qq~ "$pdb_file" "$pdb_dest"~);
}
}
next if (-e "$WORKING_DIR\\" . $rel_path && $USE_LN);
exec_cmd($link_cmd . qq~ "$src_path" "$WORKING_DIR\\$rel_path"~); exec_cmd($link_cmd . qq~ "$src_path" "$WORKING_DIR\\$rel_path"~);
} }
foreach my $file (@MAIN_FILES){ foreach my $file (@MAIN_FILES){
next if (-e "$WORKING_DIR\\" . $file && $USE_LN);
my $src_path = $FS_BUILD_PATH . "\\" . $file; my $src_path = $FS_BUILD_PATH . "\\" . $file;
$src_path = $FS_BUILD_PATH . "\\mod\\" . $file if (-e $FS_BUILD_PATH . "\\mod\\" . $file); #mainly for putting mod_managed.dll into the root $src_path = $FS_BUILD_PATH . "\\mod\\" . $file if (-e $FS_BUILD_PATH . "\\mod\\" . $file); #mainly for putting mod_managed.dll into the root
if (-e $src_path == 0){ if (-e $src_path == 0){
print "Warning: $src_path does not exist\n"; print "Warning: $src_path does not exist\n";
next; next;
} }
if ($try_pdb){
my $pdb_file = $src_path;
$pdb_file =~ s/\.dll$/.pdb/si;
my $pdb_dest = "$WORKING_DIR\\$file";
$pdb_dest =~ s/\.dll$/.pdb/si;
if (-e $pdb_file && (! $USE_LN || ! -e $pdb_dest) ){
exec_cmd($link_cmd . qq~ "$pdb_file" "$pdb_dest"~);
}
}
next if (-e "$WORKING_DIR\\" . $file && $USE_LN);
exec_cmd($link_cmd . qq~ "$src_path" "$WORKING_DIR\\$file"~); exec_cmd($link_cmd . qq~ "$src_path" "$WORKING_DIR\\$file"~);
} }
......
...@@ -263,7 +263,8 @@ if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25\"Wi ...@@ -263,7 +263,8 @@ 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_bv.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 if not exist ".\conf" md conf
copy ..\..\"external items"\conf\freeswitch.xml .\conf</PostBuildEvent> copy ..\..\"external items"\conf\freeswitch.xml .\conf
copy ..\..\"external items"\fs_cli.exe .</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25"\Win32\$(ConfigurationName)\mod\FreeSWITCH.Managed.dll ..\..\"external items\release\"</PreBuildEvent> <PreBuildEvent>if exist "%25FREESWITCH_SRC_LOCATION%25" copy "%25FREESWITCH_SRC_LOCATION%25"\Win32\$(ConfigurationName)\mod\FreeSWITCH.Managed.dll ..\..\"external items\release\"</PreBuildEvent>
......
...@@ -10,7 +10,12 @@ namespace FSClient { ...@@ -10,7 +10,12 @@ namespace FSClient {
this.evt = evt; this.evt = evt;
} }
public string get_header(string name) { public string get_header(string name) {
return freeswitch.switch_event_get_header(evt, name); //return freeswitch.switch_event_get_header(evt, name); //removed as for some reason its not swigging right for now...
for (var x = evt.headers; x != null; x = x.next){
if (name.ToLower() == x.name.ToLower())
return x.value;
}
return null;
} }
public string body { get { return evt.body; } } public string body { get { return evt.body; } }
public int flags { get { return evt.flags; } } public int flags { get { return evt.flags; } }
......
...@@ -158,6 +158,20 @@ namespace FSClient { ...@@ -158,6 +158,20 @@ namespace FSClient {
} }
private bool text_interception_enabled = true; private bool text_interception_enabled = true;
private bool HandleTextInput(String text){
char[] chars = text.ToCharArray();
bool handled = false;
foreach (Char c in chars) {
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);
handled = true;
}
}
return handled;
}
void MainWindow_PreviewTextInput(object sender, TextCompositionEventArgs e) { void MainWindow_PreviewTextInput(object sender, TextCompositionEventArgs e) {
if (!broker.fully_loaded) if (!broker.fully_loaded)
return; return;
...@@ -165,43 +179,8 @@ namespace FSClient { ...@@ -165,43 +179,8 @@ namespace FSClient {
e.Handled = false; e.Handled = false;
return; return;
} }
char[] chars = e.Text.ToCharArray(); e.Handled = HandleTextInput(e.Text);
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) { void MainWindow_PreviewKeyDown(object sender, KeyEventArgs e) {
if (!broker.fully_loaded) if (!broker.fully_loaded)
...@@ -210,11 +189,20 @@ namespace FSClient { ...@@ -210,11 +189,20 @@ namespace FSClient {
e.Handled = false; e.Handled = false;
return; return;
} }
bool cntrl_pressed = (System.Windows.Forms.Control.ModifierKeys & System.Windows.Forms.Keys.Control) == System.Windows.Forms.Keys.Control;
if (e.Key == Key.Return) { if (e.Key == Key.Return)
broker.handle_special_action(Broker.KEYBOARD_ACTION.Enter); broker.handle_special_action(Broker.KEYBOARD_ACTION.Enter);
e.Handled = true; else if (e.Key == Key.Back)
} broker.handle_special_action(Broker.KEYBOARD_ACTION.Backspace);
else if (e.Key == Key.Escape)
broker.handle_special_action(Broker.KEYBOARD_ACTION.Escape);
else if (e.Key == Key.V && cntrl_pressed)
HandleTextInput(Clipboard.GetText());
else if (e.Key == Key.F && cntrl_pressed)
txtSearchBox.TextBoxFocus();
else
return;
e.Handled = true;
} }
#endregion #endregion
private static MainWindow _instance; private static MainWindow _instance;
...@@ -235,6 +223,7 @@ namespace FSClient { ...@@ -235,6 +223,7 @@ namespace FSClient {
} }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { void MainWindow_Loaded(object sender, RoutedEventArgs e) {
PreviewTextInput += MainWindow_PreviewTextInput; PreviewTextInput += MainWindow_PreviewTextInput;
txtNumber.PreviewTextInput += MainWindow_PreviewTextInput;
PreviewKeyDown += MainWindow_PreviewKeyDown; //return must be handled seperately as buttons are triggered on down it seems PreviewKeyDown += MainWindow_PreviewKeyDown; //return must be handled seperately as buttons are triggered on down it seems
MouseUp += MainWindow_MouseUp; MouseUp += MainWindow_MouseUp;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
<RowDefinition Height="80" /> <RowDefinition Height="90" />
<RowDefinition Height="30" /> <RowDefinition Height="30" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid Grid.ColumnSpan="2"> <Grid Grid.ColumnSpan="2">
...@@ -63,11 +63,12 @@ ...@@ -63,11 +63,12 @@
<Button Name="btnPathBrowse" Content="Browse" Height="25" Click="btnPathBrowse_Click" /> <Button Name="btnPathBrowse" Content="Browse" Height="25" Click="btnPathBrowse_Click" />
</StackPanel> </StackPanel>
</Grid> </Grid>
<StackPanel Grid.Row="1" Grid.Column="1" Grid.RowSpan="3"> <StackPanel Grid.Row="1" Grid.Column="1">
<CheckBox x:Name="chkIncomingFront" Content="Bring To Front On Incoming Calls" VerticalAlignment="Center" FontWeight="Bold" FontSize="13.333" /> <CheckBox x:Name="chkIncomingFront" Content="Bring To Front On Incoming Calls" VerticalAlignment="Center" FontWeight="Bold" FontSize="13.333" />
<CheckBox x:Name="chkIncomingBalloons" Content="Show Incoming Call Notification Balloons" VerticalAlignment="Center" FontWeight="Bold" FontSize="13.333" /> <CheckBox x:Name="chkIncomingBalloons" Content="Show Incoming Call Notification Balloons" VerticalAlignment="Center" FontWeight="Bold" FontSize="13.333" />
<CheckBox x:Name="chkClearDTMFS" Content="Clear Key Presses In Call Stats On Disconnect" VerticalAlignment="Center" FontWeight="Bold" FontSize="13.333" /> <CheckBox x:Name="chkClearDTMFS" Content="Clear Key Presses In Call Stats On Disconnect" VerticalAlignment="Center" FontWeight="Bold" FontSize="13.333" />
<CheckBox x:Name="chkUseNumbers" Content="Only Allow Numerical Input While Dialing" VerticalAlignment="Center" FontWeight="Bold" FontSize="13.333" /> <CheckBox x:Name="chkUseNumbers" Content="Only Allow Numerical Input While Dialing" VerticalAlignment="Center" FontWeight="Bold" FontSize="13.333" />
<CheckBox x:Name="chkUpdatesOnStart" Content="Check for Updates on Startup" VerticalAlignment="Center" FontWeight="Bold" FontSize="13.333" />
</StackPanel> </StackPanel>
<Button Content="Save" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="101,0,0,0" Name="btnSave" VerticalAlignment="Center" Width="75" Grid.ColumnSpan="2" Click="btnSave_Click" /> <Button Content="Save" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="101,0,0,0" Name="btnSave" VerticalAlignment="Center" Width="75" Grid.ColumnSpan="2" Click="btnSave_Click" />
<Button Content="Cancel" Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="172,0,0,0" Name="btnCancel" VerticalAlignment="Center" Width="75" Click="btnCancel_Click" /> <Button Content="Cancel" Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="172,0,0,0" Name="btnCancel" VerticalAlignment="Center" Width="75" Click="btnCancel_Click" />
......
...@@ -37,6 +37,7 @@ namespace FSClient { ...@@ -37,6 +37,7 @@ namespace FSClient {
chkIncomingFront.IsChecked = broker.IncomingTopMost; chkIncomingFront.IsChecked = broker.IncomingTopMost;
chkClearDTMFS.IsChecked = broker.ClearDTMFS; chkClearDTMFS.IsChecked = broker.ClearDTMFS;
chkUseNumbers.IsChecked = broker.UseNumberOnlyInput; chkUseNumbers.IsChecked = broker.UseNumberOnlyInput;
chkUpdatesOnStart.IsChecked = broker.CheckForUpdates != "Never";
txtRecordingPath.Text = broker.recordings_folder; txtRecordingPath.Text = broker.recordings_folder;
comboHeadsetDevice.SelectedItem = broker.ActiveHeadset(); comboHeadsetDevice.SelectedItem = broker.ActiveHeadset();
...@@ -58,7 +59,8 @@ namespace FSClient { ...@@ -58,7 +59,8 @@ namespace FSClient {
broker.IncomingTopMost = chkIncomingFront.IsChecked == true; broker.IncomingTopMost = chkIncomingFront.IsChecked == true;
broker.ClearDTMFS = chkClearDTMFS.IsChecked == true; broker.ClearDTMFS = chkClearDTMFS.IsChecked == true;
broker.UseNumberOnlyInput = chkUseNumbers.IsChecked == true; broker.UseNumberOnlyInput = chkUseNumbers.IsChecked == true;
broker.recordings_folder = txtRecordingPath.Text; broker.recordings_folder = txtRecordingPath.Text;
broker.CheckForUpdates = chkUpdatesOnStart.IsChecked == true ? "OnStart" : "Never";
broker.SetActiveHeadset(comboHeadsetDevice.SelectedItem as string); broker.SetActiveHeadset(comboHeadsetDevice.SelectedItem as string);
broker.SaveSettings(); broker.SaveSettings();
......
...@@ -51,5 +51,5 @@ using System.Windows; ...@@ -51,5 +51,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.0")] [assembly: AssemblyVersion("1.0.1.1")]
[assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyFileVersion("1.0.1.1")]
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.1 // Runtime Version:4.0.30319.235
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
...@@ -221,5 +221,29 @@ namespace FSClient.Properties { ...@@ -221,5 +221,29 @@ namespace FSClient.Properties {
this["RecordingPath"] = value; this["RecordingPath"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("OnStart")]
public string CheckForUpdates {
get {
return ((string)(this["CheckForUpdates"]));
}
set {
this["CheckForUpdates"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("https://fsclient.fluky.biz/version")]
public string UpdateURL {
get {
return ((string)(this["UpdateURL"]));
}
set {
this["UpdateURL"] = value;
}
}
} }
} }
...@@ -53,5 +53,11 @@ ...@@ -53,5 +53,11 @@
<Setting Name="RecordingPath" Type="System.String" Scope="User"> <Setting Name="RecordingPath" Type="System.String" Scope="User">
<Value Profile="(Default)">recordings</Value> <Value Profile="(Default)">recordings</Value>
</Setting> </Setting>
<Setting Name="CheckForUpdates" Type="System.String" Scope="User">
<Value Profile="(Default)">OnStart</Value>
</Setting>
<Setting Name="UpdateURL" Type="System.String" Scope="User">
<Value Profile="(Default)">https://fsclient.fluky.biz/version</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>
\ No newline at end of file
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
<ComponentRef Id="cmpA55C2541EC04E8B75AD76101C9804EBB"/> <ComponentRef Id="cmpA55C2541EC04E8B75AD76101C9804EBB"/>
<ComponentRef Id="cmpE91707685ACB2C88135F5471F2366258"/> <ComponentRef Id="cmpE91707685ACB2C88135F5471F2366258"/>
<ComponentRef Id="cmp064A31C0D0158D484EBB856753AC6878"/> <ComponentRef Id="cmp064A31C0D0158D484EBB856753AC6878"/>
</ComponentGroup> <ComponentRef Id="cmp0936352374F44B63BEBD8A5A83D0D1E3"/>
</ComponentGroup>
<DirectoryRef Id="INSTALLLOCATION"> <DirectoryRef Id="INSTALLLOCATION">
<Component Id="cmp3900B358BC2FB69DF2C42DDE35C5BBB2" Guid="*"> <Component Id="cmp3900B358BC2FB69DF2C42DDE35C5BBB2" Guid="*">
<File Id="fil322A57E96A97A8179B75065ABF94F809" KeyPath="yes" Source="$(var.FSClient.TargetDir)\FreeSwitch.dll" /> <File Id="fil322A57E96A97A8179B75065ABF94F809" KeyPath="yes" Source="$(var.FSClient.TargetDir)\FreeSwitch.dll" />
...@@ -51,7 +52,11 @@ ...@@ -51,7 +52,11 @@
<Component Id="cmp064A31C0D0158D484EBB856753AC6878" Guid="*"> <Component Id="cmp064A31C0D0158D484EBB856753AC6878" Guid="*">
<File Id="fil446D50CD91F7AAF5B4F0CCF070B2C140" KeyPath="yes" Source="$(var.FSClient.TargetDir)\ssleay32.dll" /> <File Id="fil446D50CD91F7AAF5B4F0CCF070B2C140" KeyPath="yes" Source="$(var.FSClient.TargetDir)\ssleay32.dll" />
</Component> </Component>
</DirectoryRef> <Component Id="cmp0936352374F44B63BEBD8A5A83D0D1E3" Guid="*">
<File Id="fil2B20FA74F4734346894CD085F4A0829E" KeyPath="yes" Source="$(var.FSClient.TargetDir)\fs_cli.exe" />
</Component>
</DirectoryRef>
</Fragment> </Fragment>
<Fragment> <Fragment>
<ComponentGroup Id="FSCoreModComp"> <ComponentGroup Id="FSCoreModComp">
......
...@@ -48,7 +48,7 @@ namespace FSClient { ...@@ -48,7 +48,7 @@ namespace FSClient {
/*Security*/ /*Security*/
new Field(Field.FIELD_TYPE.Bool,"TLS","tls","tls","false","Security"), new Field(Field.FIELD_TYPE.Bool,"TLS","tls","tls","false","Security"),
new Field(Field.FIELD_TYPE.Bool,"TLS Only","tls-only","tls-only","false","Security"), new Field(Field.FIELD_TYPE.Bool,"TLS Only","tls-only","tls-only","false","Security"),
new Field(Field.FIELD_TYPE.Combo,"TLS Verify Policy","tls-verify-policy","tls-verify-policy","subjects_out|in","Security",new Field.FieldOption{display_value="None", value=""},new Field.FieldOption{display_value="Outbound Certs", value="out"},new Field.FieldOption{display_value="Outbound Certs & Hostnames", value="subjects_out"},new Field.FieldOption{display_value="All Certs", value="all"},new Field.FieldOption{display_value="All Certs & Outbound Hostnames", value="subjects_out|in"}), new Field(Field.FIELD_TYPE.Combo,"TLS Verify Policy","tls-verify-policy","tls-verify-policy","subjects_out|in","Security",new Field.FieldOption{display_value="None", value=""},new Field.FieldOption{display_value="Certs", value="all"},new Field.FieldOption{display_value="Certs & Hostnames", value="subjects_out|in"}),
new Field(Field.FIELD_TYPE.Combo,"TLS Version","tls-version","tls-version","sslv23","Security","sslv23","tlsv1"), new Field(Field.FIELD_TYPE.Combo,"TLS Version","tls-version","tls-version","sslv23","Security","sslv23","tlsv1"),
new Field(Field.FIELD_TYPE.String,"TLS Bind Params","tls-bind-params","tls-bind-params","transport=tls","Security"), new Field(Field.FIELD_TYPE.String,"TLS Bind Params","tls-bind-params","tls-bind-params","transport=tls","Security"),
new Field(Field.FIELD_TYPE.Int,"TLS SIP Port","tls-sip-port","tls-sip-port","12347","Security"), new Field(Field.FIELD_TYPE.Int,"TLS SIP Port","tls-sip-port","tls-sip-port","12347","Security"),
......
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
<setting name="RecordingPath" serializeAs="String"> <setting name="RecordingPath" serializeAs="String">
<value>recordings</value> <value>recordings</value>
</setting> </setting>
<setting name="CheckForUpdates" serializeAs="String">
<value>OnStart</value>
</setting>
<setting name="UpdateURL" serializeAs="String">
<value>https://fsclient.fluky.biz/version</value>
</setting>
</FSClient.Properties.Settings> </FSClient.Properties.Settings>
</userSettings> </userSettings>
</configuration> </configuration>
#!/usr/bin/perl #!/usr/bin/perl
##### NOTE: You need: http://jira.freeswitch.org/browse/FS-3188 ##### NOTE: You need an fs_cli patched with: http://jira.freeswitch.org/browse/FS-3188 or FSClient for windows comes bundled with the patched fs_cli
use strict; use strict;
$| = 1; $| = 1;
my $THREADS_SUPPORTED; #required for polling support on STDIN in windows... my $THREADS_SUPPORTED; #required for polling support on STDIN in windows...
...@@ -46,6 +46,7 @@ sub usage(){ ...@@ -46,6 +46,7 @@ sub usage(){
-X, --quit-execute=command Execute Command when quitting -X, --quit-execute=command Execute Command when quitting
-l, --loglevel=command Log Level -l, --loglevel=command Log Level
-d, --debug=level fs_cli Debug Level (0 - 7) -d, --debug=level fs_cli Debug Level (0 - 7)
-t, --timeout Timeout for API commands (in miliseconds)
-q, --quiet Disable logging -q, --quiet Disable logging
-r, --retry Retry connection on failure -r, --retry Retry connection on failure
-R, --reconnect Reconnect if disconnected -R, --reconnect Reconnect if disconnected
...@@ -391,6 +392,7 @@ sub puke($$){ ...@@ -391,6 +392,7 @@ sub puke($$){
next if (parse_args_through("-q","--quiet","",1)); next if (parse_args_through("-q","--quiet","",1));
next if (parse_args_through("-r","--retry","",1)); next if (parse_args_through("-r","--retry","",1));
next if (parse_args_through("-R","--reconnect","",1)); next if (parse_args_through("-R","--reconnect","",1));
next if (parse_args_through("-t","--timeout"));
($matches,$value) = arg_test("-A","--auto",0,0); ($matches,$value) = arg_test("-A","--auto",0,0);
$do_auto = 1 and next if ($matches); $do_auto = 1 and next if ($matches);
($matches,$value) = arg_test("-x","--execute",1,1); ($matches,$value) = arg_test("-x","--execute",1,1);
......
--[[
cid_name_prefix.lua: Adds the specified prefix to the effective_caller_id of inbound calls.
I call this script this way:
<action application="lua" data="cid_name_prefix.lua XX"/>
This will pick up any already set caller_id_name and prepend "XX " (x, x, space).
Useful when multiple DIDs or departments ring to your phone.
]]
require "split" -- I'm using the python-like example from http://lua-users.org/wiki/SplitJoin
require "trim" -- I'm using trim9 example from http://lua-users.org/wiki/StringTrim
local log = freeswitch.consoleLog
local caller_id_name = session:getVariable("caller_id_number_name")
local effective_caller_id_name = session:getVariable("effective_caller_id_name")
local CIDNAME
if effective_caller_id_name then
log("debug", "cid_name_prefix.lua: effective_caller_id_name: " .. effective_caller_id_name .. "\n");
CIDNAME = effective_caller_id_name
else
CIDNAME = caller_id_name
end
if CIDNAME == nil then
CIDNAME = session:getVariable("effective_caller_id_number")
end
if CIDNAME == nil then
CIDNAME = session:getVariable("caller_id_number")
end
if CIDNAME == nil then
CIDNAME = ''
end
--log("debug", "cid_name_prefix.lua: caller_id_name: " .. caller_id_name .. "\n");
log("debug", "cid_name_prefix.lua: CIDNAME: " .. CIDNAME .. "\n");
if argv[1] then
prefix = argv[1] .. ' '
else
prefix = nil
end
if prefix then
log("debug", "set_cid_name.lua: prefix: " .. prefix .. "\n");
session:setVariable("effective_caller_id_name", prefix .. CIDNAME);
log("info", "set_cid_name.lua: effective_caller_id_name: " .. prefix .. CIDNAME .."\n");
end
log("debug", "cid_name_prefix.lua: script ended" .. "\n");
--[[
DISA (Direct Inward System Access)
I call this script this way:
<action application="lua" data="disa.lua"/>
<action application="set_user" data="1000@my.local.profile"/>
<action application="transfer" data="${disa_dtn} XML default"/>
<action application="hangup"/>
Change the default password!!!
This can be abused to grant anyone the ability to dial through your box. YOU HAVE BEEN WARNED.
You're going to need some sounds. Poke around the wiki, I think that's where I found the ones I use.
]]
session:answer()
session:setAutoHangup(false)
failcount = 0
pin = false
function getAUTH()
local p
p = session:playAndGetDigits(5, 10, 2, 7000, "#", "/opt/customsounds/8000/pin.wav", "", "\\d+")
if p == '' then p = false end
if (p == '24680' or p == '13579') then
return p
else
session:streamFile("/opt/customsounds/8000/pin_incorrect.wav")
return false
end
end
function getDialToNumber()
local d
d = session:playAndGetDigits(4, 19, 2, 7000, "#", "/opt/customsounds/8000/please_enter_the_phone_number.wav", "", "\\d+")
if d == '' then d = false end
if d then
return d
else
return false
end
end
while failcount < 4 do repeat
if (session:ready() == false) then
failcount = 99
break
end
session:sleep(700)
if not pin then
pin = getAUTH()
if not pin then break end
end
if not dtn then
dtn = getDialToNumber()
if not dtn then break end
end
session:setVariable("disa_dtn", dtn)
failcount = 9
break
until true
freeswitch.consoleLog("info","failcount " .. failcount .. "\n");
failcount = failcount + 1
end
-- the python-like example from http://lua-users.org/wiki/SplitJoin
function string:split(sSeparator, nMax, bRegexp)
assert(sSeparator ~= '')
assert(nMax == nil or nMax >= 1)
local aRecord = {}
if self:len() > 0 then
local bPlain = not bRegexp
nMax = nMax or -1
local nField=1 nStart=1
local nFirst,nLast = self:find(sSeparator, nStart, bPlain)
while nFirst and nMax ~= 0 do
aRecord[nField] = self:sub(nStart, nFirst-1)
nField = nField+1
nStart = nLast+1
nFirst,nLast = self:find(sSeparator, nStart, bPlain)
nMax = nMax-1
end
aRecord[nField] = self:sub(nStart)
end
return aRecord
end
-- trim9 from http://lua-users.org/wiki/StringTrim
local _util_lib_find = string.find
local _util_lib_sub = string.sub
function trim(s)
local _,i1 = _util_lib_find(s,'^%s*')
local i2 = _util_lib_find(s,'%s*$')
return _util_lib_sub(s,i1+1,i2-1)
end
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论