[freeside-commits] freeside/httemplate/elements phonenumber.html, 1.7, 1.7.4.1
Ivan,,,
ivan at wavetail.420.am
Wed Feb 3 22:53:18 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv27150/httemplate/elements
Modified Files:
Tag: FREESIDE_1_9_BRANCH
phonenumber.html
Log Message:
snom autodial integration
Index: phonenumber.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/phonenumber.html,v
retrieving revision 1.7
retrieving revision 1.7.4.1
diff -u -d -r1.7 -r1.7.4.1
--- phonenumber.html 1 Apr 2008 03:49:17 -0000 1.7
+++ phonenumber.html 4 Feb 2010 06:53:15 -0000 1.7.4.1
@@ -4,22 +4,64 @@
<% $number %>
-% if ( $opt{'callable'} && $curuser->option('vonage-username') ) {
+% 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' => qq!<IMG SRC="${fsurl}images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this 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,
+%# )
+%# %>
+
+ <A HREF="javascript:snom_call(<%$snumber%>)"><<% $img %>></A>
+
+ <SCRIPT TYPE="text/javascript">
+ function snom_call(number) {
+
+ var url = '<% "http://$host/command.htm?number=" %>';
+ url = url + number;
+
+ var xmlhttp = new XMLHttpRequest();
+ xmlhttp.open('GET', url, true);
+ xmlhttp.send(null);
+
+ }
+
+ </SCRIPT>
+
+
+% }
+%
% }
%
% } else {
@@ -34,7 +76,6 @@
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");
</%init>
More information about the freeside-commits
mailing list