提交 7cfe2d4d authored 作者: Mitch Capper's avatar Mitch Capper

Add right click option for contact lookups to call from a specific account.

codec isac support.
上级 ee7fb354
......@@ -284,20 +284,23 @@ namespace FSClient {
return;
MainWindowRemoveFocus(true);
Account call_acct = Account.default_account;
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);
call_acct = (from a in Account.accounts where a.guid == acct_num select a).SingleOrDefault();
if (call_acct == null)
return;
}
}
if (Account.default_account == null) {
if (call_acct == null && 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);
DialString(call_acct, str);
}
public void DialString(Account account, String str){
account.CreateCall(str);
}
public void TalkPressed() {
if (Call.active_call != null) {
......
......@@ -47,6 +47,7 @@
<load module="mod_dialplan_xml"/>
<load module="mod_spandsp"/>
<load module="mod_ilbc"/>
<load module="mod_isac"/>
<load module="mod_speex"/>
<load module="mod_siren"/>
<load module="mod_bv"/>
......
......@@ -11,7 +11,7 @@ my $VERBOSE_SYS_RES = 0;
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);
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 mod_iSAC/;
my $link_cmd = $USE_LN ? "ln -s -a" : "copy";
......
......@@ -65,10 +65,38 @@ namespace FSClient
item = new MenuItem();
item.Click +=contact_call_click;
item.Header = "Call";
items.Add(item);
item = new MenuItem();
item.Header = "Call On Account";
item.SubmenuOpened += call_on_account_item_SubmenuOpened;
MenuItem item2 = new MenuItem { Header = "Call On Default Account",IsEnabled = false};
item2.Click += contact_call_click;
item.Items.Add(item2);
items.Add(item);
return items;
}
void call_on_account_item_SubmenuOpened(object sender, RoutedEventArgs e) {
MenuItem item = sender as MenuItem;
if (item == null || item.Items.Count == 0)
return;
MenuItem first = item.Items[0] as MenuItem;
if (first == null)
return;
item.Items.Clear();
item.Items.Add(first);
foreach (var acct in Account.accounts){
MenuItem new_item = new MenuItem();
new_item.Header = acct.ToString();
new_item.Click += contact_call_click;
item.Items.Add(new_item);
}
first.Visibility = item.Items.Count > 1 ? Visibility.Collapsed : Visibility.Visible;
}
private void delete_item_click(object sender, RoutedEventArgs e){
MenuItem item = sender as MenuItem;
if (item == null)
......@@ -90,8 +118,13 @@ namespace FSClient
SearchAutoCompleteEntry entry = item.DataContext as SearchAutoCompleteEntry ?? search_box.SelectedItem as SearchAutoCompleteEntry;
if (entry == null)
return;
Broker.get_instance().DialString(entry.number);
return;
Account acct = item.Tag as Account;
if (acct != null)
Broker.get_instance().DialString(acct, entry.number);
else
Broker.get_instance().DialString(entry.number);
}
protected void item_Click(object sender, RoutedEventArgs e)
......@@ -182,8 +215,7 @@ namespace FSClient
protected OurAutoCompleteBox search_box;
private TextBox real_search_box;
public override bool HandleSearchBox(OurAutoCompleteBox box) {
search_box = box;
search_box = box;
real_search_box = search_box.GetActualTextbox();
real_search_box.ContextMenu = new ContextMenu();
real_search_box.ContextMenuOpening += search_box_ContextMenuOpening;
......@@ -197,7 +229,9 @@ namespace FSClient
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)
......
......@@ -29,7 +29,7 @@ namespace FSClient {
public static Field[] fields = {
/*Default*/
new Field(Field.FIELD_TYPE.MultiItem,"Codec Preferences","codec-prefs","codec-prefs","CELT@48000h@10i,PCMU,PCMA,GSM","","CELT@32000h","CELT@48000h@10i","PCMA","PCMU","GSM","G722","G7221@16000h","G7221@32000h","AAL2-G726-16","AAL2-G726-24","AAL2-G726-32","AAL2-G726-40","BV16","BV32","DVI4@16000h@40i","DVI4@8000h@20i","G726-16","G726-24","G726-32","G726-40","L16","LPC","iLBC@30i","speex@16000h@20i","speex@32000h@20i","speex@8000h@20i","G729"),
new Field(Field.FIELD_TYPE.MultiItem,"Codec Preferences","codec-prefs","codec-prefs","CELT@48000h@10i,PCMU,PCMA,GSM","","CELT@32000h","CELT@48000h@10i","PCMA","PCMU","GSM","G722","G7221@16000h","G7221@32000h","AAL2-G726-16","AAL2-G726-24","AAL2-G726-32","AAL2-G726-40","BV16","BV32","DVI4@16000h@40i","DVI4@8000h@20i","G726-16","G726-24","G726-32","G726-40","L16","LPC","iLBC@30i","speex@16000h@20i","speex@32000h@20i","speex@8000h@20i","G729","isac"),
new Field(Field.FIELD_TYPE.Combo,"Inbound Codec Negotiation","inbound-codec-negotiation","inbound-codec-negotiation","generous","","generous","greedy","scrooge"),
new Field(Field.FIELD_TYPE.String,"External RTP IP","ext-rtp-ip","ext-rtp-ip","auto-nat",""),
new Field(Field.FIELD_TYPE.String,"External SIP IP","ext-sip-ip","ext-sip-ip","auto-nat",""),
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论