1 <% include('/elements/init_overlib.html') %>
3 % if ( length($number) ) {
7 % if ( $opt{'callable'} ) {
9 % if ( $curuser->option('vonage-username') ) {
11 % (my $vonage_number = $curuser->option('vonage-fromnumber')) =~ s/\D//g;
12 % $vonage_number =~ /^1/ or $vonage_number = "1$vonage_number";
14 <% include('/elements/popup_link.html',
16 'https://secure.click2callu.com/tpcc/makecall'.
17 '?username='. uri_escape($curuser->option('vonage-username')).
18 '&password='. uri_escape($curuser->option('vonage-password')).
19 "&fromnumber=$vonage_number".
23 'actionlabel' => 'Initiating call',
28 % } elsif ( $curuser->option('snom-ip') ) {
30 % my $host = $curuser->option('snom-ip');
31 % if ( $curuser->option('snom-username') ) {
32 % my $userpass = uri_escape($curuser->option('snom-username'));
33 % $userpass .= ':'. uri_escape($curuser->option('snom-password'))
34 % if $curuser->option('snom-password');
35 % $host = $userpass.'@'.$host;
38 % $snumber = "1$snumber" unless $snumber =~ /~1/; #NANPA-centric
40 %# <% include('/elements/popup_link.html',
41 %# 'action' => "http://$host/command.htm?number=$snumber",
46 <A HREF="javascript:snom_call(<%$snumber%>)"><<% $img %>></A>
48 <SCRIPT TYPE="text/javascript">
49 function snom_call(number) {
51 var url = '<% "http://$host/command.htm?number=" %>';
54 var xmlhttp = new XMLHttpRequest();
55 xmlhttp.open('GET', url, true);
67 % if ( $opt{'calling_list_exempt'} ) {
78 my( $number, %opt ) = @_;
79 ( my $snumber = $number ) =~ s/\D//g;
81 my $curuser = $FS::CurrentUser::CurrentUser;
83 my $img = qq(IMG SRC="${fsurl}images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this number");