% include('/elements/init_overlib.html') %>
% if ( length($number) ) {
<% $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!!,
)
%>
% }
%
% } else {
% }
<%init>
my( $number, %opt ) = @_;
( my $snumber = $number ) =~ s/\D//g;
my $curuser = $FS::CurrentUser::CurrentUser;
( my $vonage_number = $curuser->option('vonage-fromnumber') ) =~ s/\D//g;
$vonage_number =~ /^1/ or $vonage_number = "1$vonage_number";
%init>