From 6d43279ab6b571ad33d2d89d7403b72fdf5bc772 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 4 Feb 2010 06:53:14 +0000 Subject: [PATCH] snom autodial integration --- httemplate/elements/phonenumber.html | 75 ++++++++++++++++++++++++++++-------- httemplate/pref/pref-process.html | 4 +- httemplate/pref/pref.html | 26 +++++++++++++ 3 files changed, 87 insertions(+), 18 deletions(-) diff --git a/httemplate/elements/phonenumber.html b/httemplate/elements/phonenumber.html index 60414a644..854f5846d 100644 --- a/httemplate/elements/phonenumber.html +++ b/httemplate/elements/phonenumber.html @@ -4,22 +4,64 @@ <% $number %> -% if ( $opt{'callable'} && $curuser->option('vonage-username') ) { - - <% include('/elements/popup_link.html', - 'action' => - 'https://secure.click2callu.com/tpcc/makecall'. - '?username='. uri_escape($curuser->option('vonage-username')). - '&password='. uri_escape($curuser->option('vonage-password')). - "&fromnumber=$vonage_number". - "&tonumber=$snumber", - 'width' => 240, - 'height' => 64, - 'actionlabel' => 'Initiating call', - 'label' => qq!Call this number!, - ) - %> +% if ( $opt{'callable'} ) { +% +% if ( $curuser->option('vonage-username') ) { +% +% (my $vonage_number = $curuser->option('vonage-fromnumber')) =~ s/\D//g; +% $vonage_number =~ /^1/ or $vonage_number = "1$vonage_number"; + + <% include('/elements/popup_link.html', + 'action' => + 'https://secure.click2callu.com/tpcc/makecall'. + '?username='. uri_escape($curuser->option('vonage-username')). + '&password='. uri_escape($curuser->option('vonage-password')). + "&fromnumber=$vonage_number". + "&tonumber=$snumber", + 'width' => 240, + 'height' => 64, + 'actionlabel' => 'Initiating call', + 'label' => "<$img>", + ) + %> + +% } elsif ( $curuser->option('snom-ip') ) { +% +% my $host = $curuser->option('snom-ip'); +% if ( $curuser->option('snom-username') ) { +% my $userpass = uri_escape($curuser->option('snom-username')); +% $userpass .= ':'. uri_escape($curuser->option('snom-password')) +% if $curuser->option('snom-password'); +% $host = $userpass.'@'.$host; +% } +% +% $snumber = "1$snumber" unless $snumber =~ /~1/; #NANPA-centric + +%# <% include('/elements/popup_link.html', +%# 'action' => "http://$host/command.htm?number=$snumber", +%# %link_common, +%# ) +%# %> + + <<% $img %>> + + + +% } +% % } % % } else { @@ -34,7 +76,6 @@ my( $number, %opt ) = @_; my $curuser = $FS::CurrentUser::CurrentUser; -( my $vonage_number = $curuser->option('vonage-fromnumber') ) =~ s/\D//g; -$vonage_number =~ /^1/ or $vonage_number = "1$vonage_number"; +my $img = qq(IMG SRC="${fsurl}images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this number"); diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html index 378164e7b..2b6c969f8 100644 --- a/httemplate/pref/pref-process.html +++ b/httemplate/pref/pref-process.html @@ -45,8 +45,10 @@ unless ( $error ) { # if ($access_user) { #XXX autogen my @paramlist = qw( menu_position default_customer_view email_address + snom-ip snom-username snom-password vonage-fromnumber vonage-username vonage-password - show_pkgnum show_db_profile save_db_profile + show_pkgnum show_confitem_counts + show_db_profile save_db_profile height width availHeight availWidth colorDepth ); diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html index 562ef2980..5cd75e26c 100644 --- a/httemplate/pref/pref.html +++ b/httemplate/pref/pref.html @@ -80,6 +80,10 @@ Development option('show_pkgnum') ? 'CHECKED' : '' %>> + Show config item counts: + option('show_confitem_counts') ? 'CHECKED' : '' %>> + + Show database profiling (when available): option('show_db_profile') ? 'CHECKED' : '' %>> @@ -91,6 +95,28 @@ Development
+SNOM integration +<% ntable("#cccccc",2) %> + + + SNOM IP address + + + + + SNOM HTTP username (if necessary) + + + + + SNOM HTTP password (if necessary) + + + + +
+ +OR

Vonage integration (see Click2Call) <% ntable("#cccccc",2) %> -- 2.11.0