diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/active_list_refresh.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/active_list_refresh.php deleted file mode 100644 index 301e5ed7..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/active_list_refresh.php +++ /dev/null @@ -1,446 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "List Display: "; -if ($ADD==1) {echo "Live Extensions";} -if ($ADD==2) {echo "Busy Extensions";} -if ($ADD==3) {echo "Outside Lines";} -if ($ADD==4) {echo "Local Extensions";} -if ($ADD==5) {echo "Conferences";} -if ($ADD==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/astguiclient.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/astguiclient.php deleted file mode 100644 index 5b1da59d..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/astguiclient.php +++ /dev/null @@ -1,2874 +0,0 @@ - 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.9'; -$build = '60112-1622'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: Login\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
User Login:
User Password:
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Phone Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Phone Login
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
Main PanelActive Lines PanelConferences PanelCheck VoicemailLive Call
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Hangup Trunk   |   - Hijack Trunk   |   - Listen Trunk   |   - Refresh   |   - Back to Main Window -
-
- - -
LOCAL HANGUP

- Active Local Menu
- Hangup Local   |   - Hijack Local   |   - Listen Local   |   - Refresh   |   - Back to Main Window -
-
- - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- Refresh


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - - -
LOCAL Extensions Dial
Phone calling from: Channel
Extensions:
Extensions Menu
-
- Call selected extension

- Call selected vmail box

- Refresh


- Back to Main Window

-
-
- - -
PARKED CALLS:
- Back to Main Window

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NEW:     OLD:             MANUAL DIAL       DIAL
PARKED CALLS: 0                LOCAL DIAL EXTENSIONS
OUTBOUND CALLS:
INBOUND CALLS:
astGUIclient web-client VERSION: BUILD:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITES       edit
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITES

 
SUBMIT FAVORITES CHANGES - requires logout
BACK TO MAIN WINDOW - ignore changes made
-
- -
- - - - - - - - - - - - - -
-PAUSE | START     Refresh rate: 1000 ms Faster | Slower

-
Initializing..
-
Active Extensions
-REFRESH | -ORDER | -
Outside Lines
-REFRESH | -ORDER | -
Local Extensions
-REFRESH | -ORDER | -
- Data Goes Here

-
- Data Goes Here

Trunk Action -
- Data Goes Here

Local Action -
-
- - - - -
- - -Conferences List - - - -
-Click on a conference room number on the left for info on that conference -
- - - - - - - - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/call_log_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/call_log_display.php deleted file mode 100644 index 79187564..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/call_log_display.php +++ /dev/null @@ -1,181 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Call Log Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - - echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; - } - echo "\n"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/conf_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/conf_exten_check.php deleted file mode 100644 index 671d29ba..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/conf_exten_check.php +++ /dev/null @@ -1,213 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Conf Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ChannelA[$counter] ~"; - # echo "$ChannelA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid or Exten $exten is not valid\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conference $conf_exten has been registered to $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/dbconnect.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_BLINK.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_BLINK.gif deleted file mode 100644 index 30703a78..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_BLINK.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_BLINK_e.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_BLINK_e.gif deleted file mode 100644 index 600cef89..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_BLINK_e.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_OFF.gif deleted file mode 100644 index 5b7e4c75..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_OFF_es.gif deleted file mode 100644 index ec9c1d55..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_ON.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_ON.gif deleted file mode 100644 index ad55916d..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_ON.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_ON_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_ON_es.gif deleted file mode 100644 index 442a8084..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_check_voicemail_ON_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_OFF.gif deleted file mode 100644 index 3752fb5e..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_OFF_es.gif deleted file mode 100644 index 1ff376d8..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_ON.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_ON.gif deleted file mode 100644 index ed8ba2dd..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_ON.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_ON_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_ON_es.gif deleted file mode 100644 index 041d398f..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_live_call_ON_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_active_lines.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_active_lines.gif deleted file mode 100644 index 9f8eaf67..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_active_lines.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_active_lines_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_active_lines_es.gif deleted file mode 100644 index bdefd015..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_active_lines_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_astguiclient.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_astguiclient.gif deleted file mode 100644 index 30373576..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_astguiclient.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_conferences.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_conferences.gif deleted file mode 100644 index e3c80662..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_conferences.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_conferences_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_conferences_es.gif deleted file mode 100644 index 14ab7171..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_conferences_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_main.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_main.gif deleted file mode 100644 index 6e687e44..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_main.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_main_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_main_es.gif deleted file mode 100644 index b5fc2a5e..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/agc_tab_main_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/blank.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/blank.gif deleted file mode 100644 index 3a469695..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/blank.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/de.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/de.gif deleted file mode 100644 index 4dd34f6a..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/de.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/down.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/down.gif deleted file mode 100644 index 32d0a007..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/down.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/el.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/el.gif deleted file mode 100644 index 9e79d8bf..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/el.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/en.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/en.gif deleted file mode 100644 index cb45f5f4..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/en.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/es.gif deleted file mode 100644 index 308ea3cb..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/fr.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/fr.gif deleted file mode 100644 index 21fb3d19..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/fr.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/it.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/it.gif deleted file mode 100644 index 6c7b1792..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/it.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/pt.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/pt.gif deleted file mode 100644 index 646b76ac..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/pt.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/remove.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/remove.gif deleted file mode 100644 index 89b0521c..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/remove.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/up.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/up.gif deleted file mode 100644 index 0d55544f..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/up.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber.gif deleted file mode 100644 index a5a080d6..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF.gif deleted file mode 100644 index 75bc0e8f..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF_es.gif deleted file mode 100644 index 405ff336..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber_es.gif deleted file mode 100644 index ca92716e..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_dialnextnumber_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall.gif deleted file mode 100644 index a6779255..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF.gif deleted file mode 100644 index 74b1f5a1..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF_es.gif deleted file mode 100644 index 21991dd5..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall_es.gif deleted file mode 100644 index 9acc363a..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_grabparkedcall_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer.gif deleted file mode 100644 index b4fdfae8..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF.gif deleted file mode 100644 index e5736ae0..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF_es.gif deleted file mode 100644 index 570a6e5a..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer_es.gif deleted file mode 100644 index 94d3e225..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_hangupcustomer_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall.gif deleted file mode 100644 index 88fee283..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall_OFF.gif deleted file mode 100644 index 8ad55010..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall_OFF_es.gif deleted file mode 100644 index 110ce6b0..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall_es.gif deleted file mode 100644 index 2274a27c..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_parkcall_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause.gif deleted file mode 100644 index 3486a1c1..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause_OFF.gif deleted file mode 100644 index fce03041..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause_OFF_es.gif deleted file mode 100644 index 494d68a5..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause_es.gif deleted file mode 100644 index 544a3797..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_pause_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume.gif deleted file mode 100644 index a7d75dd8..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume_OFF.gif deleted file mode 100644 index 0ae4cb9a..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume_OFF_es.gif deleted file mode 100644 index 921d5d5e..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume_es.gif deleted file mode 100644 index 1b096144..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_resume_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf.gif deleted file mode 100644 index d19888ad..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf_OFF.gif deleted file mode 100644 index 08a4b392..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf_OFF_es.gif deleted file mode 100644 index 2d32c5e9..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf_es.gif deleted file mode 100644 index 43964df4..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_senddtmf_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_spacer.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_spacer.gif deleted file mode 100644 index d0a4f6ed..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_spacer.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording.gif deleted file mode 100644 index 022103d2..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording_OFF.gif deleted file mode 100644 index 3ee4ca62..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording_OFF_es.gif deleted file mode 100644 index ff9a3447..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording_es.gif deleted file mode 100644 index 26420f78..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_startrecording_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording.gif deleted file mode 100644 index 6f3bfede..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording_OFF.gif deleted file mode 100644 index 2e1efe4a..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording_OFF_es.gif deleted file mode 100644 index 2806311f..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording_es.gif deleted file mode 100644 index 94f9de9d..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_stoprecording_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf.gif deleted file mode 100644 index c5738519..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf_OFF.gif deleted file mode 100644 index dd0a579a..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf_OFF_es.gif deleted file mode 100644 index d0a54bf6..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf_es.gif deleted file mode 100644 index 10cfa495..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_transferconf_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform.gif deleted file mode 100644 index 4d5228f3..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform_OFF.gif deleted file mode 100644 index 64316ced..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform_OFF_es.gif deleted file mode 100644 index 75a56196..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform_es.gif deleted file mode 100644 index d7590d66..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_LB_webform_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_ammessage.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_ammessage.gif deleted file mode 100644 index 484d01eb..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_ammessage.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_ammessage_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_ammessage_OFF.gif deleted file mode 100644 index 3aa94800..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_ammessage_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer.gif deleted file mode 100644 index 77c03e0b..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF.gif deleted file mode 100644 index 7fb481ee..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF_es.gif deleted file mode 100644 index 05adaac5..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer_es.gif deleted file mode 100644 index fdad633a..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_blindtransfer_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_channel.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_channel.gif deleted file mode 100644 index 9a9ce7ba..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_channel.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_channel_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_channel_es.gif deleted file mode 100644 index a4fbf1f5..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_channel_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_code.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_code.gif deleted file mode 100644 index 8fb2b8c5..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_code.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer.gif deleted file mode 100644 index 68697edc..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF.gif deleted file mode 100644 index 8bf2e44b..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif deleted file mode 100644 index 7ef98a94..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer_es.gif deleted file mode 100644 index d71bca15..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_dialwithcustomer_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines.gif deleted file mode 100644 index 4e6db07e..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF.gif deleted file mode 100644 index f1ffdc12..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF_es.gif deleted file mode 100644 index 8f12accd..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines_es.gif deleted file mode 100644 index 646c8769..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupbothlines_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline.gif deleted file mode 100644 index d25a105a..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF.gif deleted file mode 100644 index a8fb4a3d..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF_es.gif deleted file mode 100644 index 3c717d09..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline_es.gif deleted file mode 100644 index 0d92a89c..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hangupxferline_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_header.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_header.gif deleted file mode 100644 index c813b9a3..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_header.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_header_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_header_es.gif deleted file mode 100644 index a92c2df0..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_header_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive.gif deleted file mode 100644 index 8382205e..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF.gif deleted file mode 100644 index 3357ed2b..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif deleted file mode 100644 index 638ef859..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es-orig.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es.gif deleted file mode 100644 index 5c9a3122..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_es.gif deleted file mode 100644 index b064725c..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysactive_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysinactive_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysinactive_es.gif deleted file mode 100644 index d0bf982c..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_hotkeysinactive_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser.gif deleted file mode 100644 index a1adca76..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser_OFF.gif deleted file mode 100644 index 9d3489fa..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser_OFF_es.gif deleted file mode 100644 index 45bc4290..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser_es.gif deleted file mode 100644 index d5c05657..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_internalcloser_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall.gif deleted file mode 100644 index 7bca06f9..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF.gif deleted file mode 100644 index 63594d65..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF_es.gif deleted file mode 100644 index 9c41a291..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall_es.gif deleted file mode 100644 index 9aa29708..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_leave3waycall_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser.gif deleted file mode 100644 index 0e10a2ad..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser_OFF.gif deleted file mode 100644 index ed11b7ac..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser_OFF_es.gif deleted file mode 100644 index fbad052d..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser_es.gif deleted file mode 100644 index d36e1944..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_localcloser_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_number.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_number.gif deleted file mode 100644 index 33f30330..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_number.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_number_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_number_es.gif deleted file mode 100644 index 6d672acc..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_number_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial.gif deleted file mode 100644 index 195b1a90..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF.gif deleted file mode 100644 index 7c275732..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif deleted file mode 100644 index ef710c9c..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial_OFF_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial_es.gif deleted file mode 100644 index accda01c..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_parkcustomerdial_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_seconds.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_seconds.gif deleted file mode 100644 index 92fc7f2b..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_seconds.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_seconds_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_seconds_es.gif deleted file mode 100644 index f4fe2b27..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_XB_seconds_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_tab_script.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_tab_script.gif deleted file mode 100644 index 69e43b79..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_tab_script.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_tab_script_es.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_tab_script_es.gif deleted file mode 100644 index ba4320d4..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_tab_script_es.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_tab_vicidial.gif b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_tab_vicidial.gif deleted file mode 100644 index 1e862589..00000000 Binary files a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/images/vdc_tab_vicidial.gif and /dev/null differ diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/inbound_popup.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/inbound_popup.php deleted file mode 100644 index ec418bce..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/inbound_popup.php +++ /dev/null @@ -1,335 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -LIVE INBOUND CALL"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

LIVE INBOUND CALL

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid is not valid\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Channel: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Channel=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "CUSTOM - \n"; - - echo "
Number Dialed: $row[8]
Notes: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "SEND TO MY VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/live_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/live_exten_check.php deleted file mode 100644 index 7fdd5730..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/live_exten_check.php +++ /dev/null @@ -1,263 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Live Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ChannelA[$loop_count] = "$row[0]"; - $ChannelB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $ChannelA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/manager_send.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/manager_send.php deleted file mode 100644 index e6887a26..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/manager_send.php +++ /dev/null @@ -1,882 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -### - $queryCID - ('CN012345678901234567',...) -### - $format - ('text','debug') -### - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $exten - ('1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $filename - ('20050406-125623_44444',...) -### - $extenName - ('phone100',...) -### - $parkedby - ('phone100',...) -### - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $auto_dial_level - ('0','1','1.1',...) -### - $campaign - ('CLOSER','TESTCAMP',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('1234',...) -### - $seconds - ('32',...) -### - $outbound_cid - ('3125551212','0000000000',...) -### - $agent_log_id - ('123456',...) -### - $call_server_ip - ('10.10.10.15',...) -### - $CalLCID - ('VD01234567890123456',...) -### - -# changes -# 50401-1002 First build of script, Hangup function only -# 50404-1045 Redirect basic function enabled -# 50406-1522 Monitor basic function enabled -# 50407-1647 Monitor and StopMonitor full functions enabled -# 50422-1120 basic Originate function enabled -# 50428-1451 basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 basic RedirectName and RedirectNameVmail added -# 50503-1227 added session_name checking for extra security -# 50523-1341 added Conference call start/stop recording -# 50523-1421 added OriginateName and OriginateNameVmail for local calls -# 50524-1602 added RedirectToPark and RedirectFromPark -# 50531-1203 added RedirecXtra for dual channel redirection -# 50630-1100 script changed to not use HTTP login vars, user/pass instead -# 50804-1148 Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 Added outbound_cid set if present to originate call -# 51020-1556 Added agent_log_id framework for detailed agent activity logging -# 51118-1204 Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 Added ability to accept calls from other VICIDIAL servers -# 51129-1253 Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### These are variable assignments for PHP globals off -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$queryCID=$_GET["queryCID"]; if (!$queryCID) {$queryCID=$_POST["queryCID"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$filename=$_GET["filename"]; if (!$filename) {$filename=$_POST["filename"];} -$extenName=$_GET["extenName"]; if (!$extenName) {$extenName=$_POST["extenName"];} -$parkedby=$_GET["parkedby"]; if (!$parkedby) {$parkedby=$_POST["parkedby"];} -$extrachannel=$_GET["extrachannel"]; if (!$extrachannel) {$extrachannel=$_POST["extrachannel"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$secondS=$_GET["secondS"]; if (!$secondS) {$secondS=$_POST["secondS"];} -$outbound_cid=$_GET["outbound_cid"]; if (!$outbound_cid) {$outbound_cid=$_POST["outbound_cid"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$call_server_ip=$_GET["call_server_ip"]; if (!$call_server_ip) {$call_server_ip=$_POST["call_server_ip"];} -$CalLCID=$_GET["CalLCID"]; if (!$CalLCID) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!$ACTION) {$ACTION="Originate";} -if (!$format) {$format="alert";} -if (!$ext_priority) {$ext_priority="1";} - - -$version = '0.0.22'; -$build = '60310-2022'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!$query_date) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Manager Send: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten is not valid or ext_context $ext_context or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel is not live on $call_server_ip, Checking Live Channel...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup command sent for Channel $channel on $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "auto_dial_level $auto_dial_level must be set\n"; - echo "campaign $campaign must be set\n"; - echo "uniqueid $uniqueid must be set\n"; - echo "lead_id $lead_id must be set\n"; - echo "\nRedirectVD Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "parkedby $parkedby must be set\n"; - echo "\nRedirectToPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectFromPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Cannot find empty conference on $server_ip, Redirect command not inserted\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for Channel $channel on $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, $ACTION command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or exten $exten is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going on in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n RECORDING WILL LAST UP TO 60 MINUTES\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/park_calls_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/park_calls_display.php deleted file mode 100644 index ce421f53..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/park_calls_display.php +++ /dev/null @@ -1,136 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Parked Calls Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/vdc_db_query.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/vdc_db_query.php deleted file mode 100644 index 7fbc2fd5..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/vdc_db_query.php +++ /dev/null @@ -1,1289 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the meetme conference has live channels connected and which they are -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs') -### - $stage - ('start','finish') -### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -### - $conf_exten - ('8600011',...) -### - $exten - ('123test',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $campaign - ('testcamp',...) -### - $dial_timeout - ('60','26',...) -### - $dial_prefix - ('9','8',...) -### - $campaign_cid - ('3125551212','0000000000',...) -### - $MDnextCID - ('M06301413000000002',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('36524',...) -### - $list_id - ('101','123456',...) -### - $length_in_sec - ('12',...) -### - $phone_code - ('1',...) -### - $phone_number - ('3125551212',...) -### - $channel - ('Zap/12-1',...) -### - $start_epoch - ('1120236911',...) -### - $vendor_lead_code - ('1234test',...) -### - $title - ('Mr.',...) -### - $first_name - ('Bob',...) -### - $middle_initial - ('L',...) -### - $last_name - ('Wilson',...) -### - $address1 - ('1324 Main St.',...) -### - $address2 - ('Apt. 12',...) -### - $address3 - ('co Robert Wilson',...) -### - $city - ('Chicago',...) -### - $state - ('IL',...) -### - $province - ('NA',...) -### - $postal_code - ('60054',...) -### - $country_code - ('USA',...) -### - $gender - ('M',...) -### - $date_of_birth - ('1970-01-01',...) -### - $alt_phone - ('3125551213',...) -### - $email - ('bob@bob.com',...) -### - $security_phrase - ('Hello',...) -### - $comments - ('Good Customer',...) -### - $auto_dial_level - ('0','1','1.2',...) -### - $VDstop_rec_after_each_call - ('0','1') -### - $conf_silent_prefix - ('7','8','',...) -### - $extension - ('123','user123','25-1',...) -### - $protocol - ('Zap','SIP','IAX2',...) -### - $user_abb - ('1234','6666',...) -### - $preview - ('YES','NO',...) -### - $called_count - ('0','1','2',...) -### - $agent_log_id - ('123456',...) -### - $agent_log - ('NO',...) -### - $favorites_list - (",'cc160','cc100'",...) -### - -# changes -# 50629-1044 First build of script -# 50630-1422 Added manual dial action and MD channel lookup -# 50701-1451 Added dial log for start and end of vicidial calls -# 50705-1239 Added call disposition update -# 50804-1627 Fixed updateDispo to update vicidial_log entry -# 50816-1605 Added VDADpause/ready for auto dialing -# 50816-1811 Added basic autodial call pickup functions -# 50817-1005 Altered logging functions to accomodate auto_dialing -# 50818-1305 Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 Added hangup of agent phone after Logout -# 50901-1315 Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 Fixed CLOSER log length_in_sec bug -# 50902-1730 Added functions for manual preview dialing and revert -# 50913-1214 Added agent random update to leadupdate -# 51020-1421 Added agent_log_id framework for detailed agent activity logging -# 51021-1717 Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 Altered echo statements for several small PHP speed optimizations -# 51122-1328 Fixed UserLogout issue not removing conference reservation -# 51129-1012 Added ability to accept calls from other VICIDIAL servers -# 51129-1729 Changed manual dial to use the '/n' flag for calls -# 51221-1154 Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 Added Updating of astguiclient favorites in the DB -# 60208-1617 Added dtmf buttons output per call -# 60213-1521 Added closer_campaigns update to vicidial_users -# 60215-1036 Added Callback date-time entry into vicidial_callbacks table -# - -$version = '0.0.26'; -$build = '60215-1036'; - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$stage=$_GET["stage"]; if (!$stage) {$stage=$_POST["stage"];} -$closer_choice=$_GET["closer_choice"]; if (!$closer_choice) {$closer_choice=$_POST["closer_choice"];} -$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$dial_timeout=$_GET["dial_timeout"]; if (!$dial_timeout) {$dial_timeout=$_POST["dial_timeout"];} -$dial_prefix=$_GET["dial_prefix"]; if (!$dial_prefix) {$dial_prefix=$_POST["dial_prefix"];} -$campaign_cid=$_GET["campaign_cid"]; if (!$campaign_cid) {$campaign_cid=$_POST["campaign_cid"];} -$MDnextCID=$_GET["MDnextCID"]; if (!$MDnextCID) {$MDnextCID=$_POST["MDnextCID"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$list_id=$_GET["list_id"]; if (!$list_id) {$list_id=$_POST["list_id"];} -$length_in_sec=$_GET["length_in_sec"]; if (!$length_in_sec) {$length_in_sec=$_POST["length_in_sec"];} -$phone_code=$_GET["phone_code"]; if (!$phone_code) {$phone_code=$_POST["phone_code"];} -$phone_number=$_GET["phone_number"]; if (!$phone_number) {$phone_number=$_POST["phone_number"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$start_epoch=$_GET["start_epoch"]; if (!$start_epoch) {$start_epoch=$_POST["start_epoch"];} -$dispo_choice=$_GET["dispo_choice"]; if (!$dispo_choice) {$dispo_choice=$_POST["dispo_choice"];} -$vendor_lead_code=$_GET["vendor_lead_code"]; if (!$vendor_lead_code) {$vendor_lead_code=$_POST["vendor_lead_code"];} -$title=$_GET["title"]; if (!$title) {$title=$_POST["title"];} -$first_name=$_GET["first_name"]; if (!$first_name) {$first_name=$_POST["first_name"];} -$middle_initial=$_GET["middle_initial"]; if (!$middle_initial) {$middle_initial=$_POST["middle_initial"];} -$last_name=$_GET["last_name"]; if (!$last_name) {$last_name=$_POST["last_name"];} -$address1=$_GET["address1"]; if (!$address1) {$address1=$_POST["address1"];} -$address2=$_GET["address2"]; if (!$address2) {$address2=$_POST["address2"];} -$address3=$_GET["address3"]; if (!$address3) {$address3=$_POST["address3"];} -$city=$_GET["city"]; if (!$city) {$city=$_POST["city"];} -$state=$_GET["state"]; if (!$state) {$state=$_POST["state"];} -$province=$_GET["province"]; if (!$province) {$province=$_POST["province"];} -$postal_code=$_GET["postal_code"]; if (!$postal_code) {$postal_code=$_POST["postal_code"];} -$country_code=$_GET["country_code"]; if (!$country_code) {$country_code=$_POST["country_code"];} -$gender=$_GET["gender"]; if (!$gender) {$gender=$_POST["gender"];} -$date_of_birth=$_GET["date_of_birth"]; if (!$date_of_birth) {$date_of_birth=$_POST["date_of_birth"];} -$alt_phone=$_GET["alt_phone"]; if (!$alt_phone) {$alt_phone=$_POST["alt_phone"];} -$email=$_GET["email"]; if (!$email) {$email=$_POST["email"];} -$security_phrase=$_GET["security_phrase"]; if (!$security_phrase) {$security_phrase=$_POST["security_phrase"];} -$comments=$_GET["comments"]; if (!$comments) {$comments=$_POST["comments"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"]; if (!$VDstop_rec_after_each_call) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -$conf_silent_prefix=$_GET["conf_silent_prefix"]; if (!$conf_silent_prefix) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];} -$protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];} -$user_abb=$_GET["user_abb"]; if (!$user_abb) {$user_abb=$_POST["user_abb"];} -$preview=$_GET["preview"]; if (!$preview) {$preview=$_POST["preview"];} -$called_count=$_GET["called_count"]; if (!$called_count) {$called_count=$_POST["called_count"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log"];} -$favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];} -$CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -$recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];} - - -# default optional vars if not set -if (!$format) {$format="text";} -if ($format == 'debug') {$DB=1;} -if (!$ACTION) {$ACTION="refresh";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -if (!$query_date) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) -{ -echo "Invalid Username/Password: |$user|$pass|\n"; -exit; -} -else -{ - -if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Database Query Script"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Group Choice $closer_choice is not valid\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Group Choice $closer_choice has been registered to user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "HOPPER EMPTY\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - ##### grab the lead_id of the reserved user in vicidial_hopper - $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - } - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "HOPPER EMPTY\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CALL NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID is not valid\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign is not valid\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inserted: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "LOG NOT ENTERED\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CALL_LOG Inserted: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "LOG NOT ENTERED\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id is not valid\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "LOG NOT ENTERED\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campaign $campaign is not valid\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCALL - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user on $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten is not valid\n"; - exit; - } -else - { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation on the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CALLBACK ENTRY - if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' has been changed to ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='$vendor_lead_code', title='$title', first_name='$first_name', middle_initial='$middle_initial', last_name='$last_name', address1='$address1', address2='$address2', address3='$address3', city='$city', state='$state', province='$province', postal_code='$postal_code', country_code='$country_code', gender='$gender', date_of_birth='$date_of_birth', alt_phone='$alt_phone', email='$email', security_phrase='$security_phrase', comments='$comments' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - echo "Lead $lead_id information has been updated\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage is not valid\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' is now in status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list is not valid\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - - - -if ($format=='debug') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/vicidial.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/vicidial.php deleted file mode 100644 index afafb6e9..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/vicidial.php +++ /dev/null @@ -1,4633 +0,0 @@ - LICENSE: GPLv2 -### -### make sure you have added a user to the vicidial_users MySQL table with at least -### user_level 1 or greater to access this page. Also, you need to have the login -### and pass of a phone listed in the asterisk.phones table. The page grabs the -### server info and other details from this login and pass. -### -### This script works best with Firefox or Mozilla, but will run for a couple -### hours on Internet Explorer before the memory leaks cause a crash. -### -### Other scripts that this application depends on: -### - vdc_db_query.php: Updates information in the database -### - manager_send.php: Sends manager actions to the DB for execution -### -### CHANGES -### 50607-1426 - First Build of VICIDIAL web client basic login process finished -### 50628-1620 - Added some basic formatting and worked on process flow -### 50628-1715 - Startup variables mapped to javascript variables -### 50629-1303 - Added Login Closer in-groups selection box and vla update -### 50629-1530 - Rough layout for customer info form section and button links -### 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -### 50701-1450 - Added vicidial_log entries on dial and hangup -### 50701-1634 - Added Logout function -### 50705-1259 - Added call disposition functionality -### 50705-1432 - Added lead info DB update function -### 50705-1658 - Added web form functionality -### 50706-1043 - Added call park and pickup functions -### 50706-1234 - Added Start/Stop Recording functionality -### 50706-1614 - Added conference channels display option -### 50711-1333 - Removed call check redundancy and fixed a span bug -### 50727-1424 - Added customer channel and participant present sensing/alerts -### 50804-1057 - Added SendDTMF function and reconfigured the transfer span -### 50804-1224 - Added Local and Internal Closer transfer functions -### 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -### 50804-1808 - Added button images for left buttons -### 50815-1151 - Added 3Way calling functions to Transfer-conf frame -### 50815-1602 - Added images and buttons for xfer functions -### 50816-1813 - Added basic autodial outbound call pickup functions -### 50817-1113 - Fixes to auto_dialing call receipt -### 50817-1234 - Added inbound call receipt capability -### 50817-1541 - Added customer time display -### 50817-1541 - Added customer time display -### 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -### 50818-1703 - Added pretty login section -### 50825-1200 - Modified form field lengths, added double-click dispositions -### 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -### 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -### 50903-0904 - Added preview-lead code for manual dialing -### 50904-0016 - Added ability to hangup manual dials before pickup -### 50906-1319 - Added override for filters on xfer calls, fixed login display bug -### 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -### 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -### 50913-1212 - Added campaign_cid to 3rd party calls -### 50923-1546 - Modified to work with language translation -### 50926-1656 - Added campaign pull-down at login of active campaigns -### 50928-1633 - Added manual dial alternate number dial option -### 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -### 51004-1656 - Fixed recording filename bug and new Spanish translation -### 51020-1103 - Added campaign-specific recording control abilities -### 51020-1352 - Added Basic vicidial_agent_log framework -### 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -### 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -### 51110-1432 - Fixed non-standard http port issue -### 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -### 51118-1305 - Activate multi-line comments from $multi_line_comments var -### 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -### 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -### 51129-1010 - Added ability to accept calls from other VICIDIAL servers -### 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -### 51208-1732 - Created user-first login that looks for default phone info -### 51219-1526 - Added variable framework for campaign and in-group scripts -### 51221-1200 - Added SCRIPT tab, layout and functionality -### 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -### 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -### 51229-1028 - Added checks on web_form_address to allow for var in the DB value -### 60117-1312 - Added Transfer-conf frame toggle on button press -### 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -### 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -### 60213-1210 - Added ability to sort routing of calls by user_level -### 60214-0932 - Initial Callback calendar display framework -### 60214-1407 - Added ability to minimize the dispo screen to see info below -### 60215-1104 - Added ANYONE scheduled callbacks functionality -### - -require("dbconnect.php"); - -$DB=$_GET['DB']; if (!$DB) {$DB=$_POST["DB"];} -$phone_login=$_GET['phone_login']; if (!$phone_login) {$phone_login=$_POST["phone_login"];} - if (!$phone_login) {$phone_login=$_GET["pl"];} -$phone_pass=$_GET['phone_pass']; if (!$phone_pass) {$phone_pass=$_POST["phone_pass"];} - if (!$phone_pass) {$phone_pass=$_GET["pp"];} -$VD_login=$_GET['VD_login']; if (!$VD_login) {$VD_login=$_POST["VD_login"];} -$VD_pass=$_GET['VD_pass']; if (!$VD_pass) {$VD_pass=$_POST["VD_pass"];} -$VD_campaign=$_GET['VD_campaign']; if (!$VD_campaign) {$VD_campaign=$_POST["VD_campaign"];} - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); -$relogin=$_GET['relogin']; if (!$relogin) {$relogin=$_POST["relogin"];} - -$forever_stop=0; - -$version = '1.1.66'; -$build = '60215-1104'; - -if ($force_logout) -{ - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$manual_dial_preview = '1'; # Allow preview lead option when manual dial -$HKuser_level = '5'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_alt_phone = '1'; # allow manual dial users to call alt phone number -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIDIAL web client: Re-Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

User Login

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIDIAL web client: Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIDIAL web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Campaign not active, please try again
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Login incorrect, please try again
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIDIAL web client: Phone Login Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login Error
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIDIAL web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed on this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login on phone: $SIP_user to campaign: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "Sorry, there are no leads in the hopper for this campaign\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -LOGOUT\n"; ?> -
-
- - - - - - - - -
VICIDIALSCRIPT   LIVE     session ID: Live Call
-
- - - - -

VICIDIAL
-
- - - - -
- - Transfer - Conference
- INTERNAL CLOSER - LOCAL CLOSER - CODE - Hangup Xfer Line - Hangup Both Lines - -
- - Number to call   - seconds   - channel - - OVERRIDE   - D1 - D2 -
- - Dial With Customer - Park Customer Dial - LEAVE 3-WAY CALL - Dial Blind Transfer - Blind Transfer VMail Message -
-
-
- - - - -
Lead Dispositioned As:

- -
-
-
- - - - - - - -
Disposition Hot Keys: - When active, simply press the keyboard key for the desired disposition for this call. The call will then be hungup and dispositioned automatically:
- - - - - -
-
- - -
Noone is in your session:
- OK -
-
- - -
Customer has hung up:
- OK -
-
- - -

LOGOUT
-
- - -
-
- - -
 
-
- - -
Any changes made to the customer information below at this time will not be comitted, You must change customer information before you Hangup the call.
-
- - -
DISPOSITION CALL :       minimize
- End-of-call Disposition Selection -
- STOP CALLING
- RESET | - SUBMIT -



  -
-
- - - -
Select a CallBack Date :
- - - Select a Date Below   -     - Hour: -   - Minutes: -   - -  
- - CB Comments:

- - SUBMIT

- - -

  -
-
- - -
CLOSER INBOUND GROUP SELECTION
- Closer Inbound Group Selection -
- BLENDED CALLING(outbound activated)
- RESET | - SUBMIT -



  -
-
- - - - - - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- REFRESH


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - -
VICIDIAL SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Dial Next Number
- LEAD PREVIEW
";} -if ( ($manual_dial_alt_phone) and ($auto_dial_level==0) ) - {echo " ALT PHONE DIAL
";} - - -?> -RECORDING FILE:
-
-
-RECORD ID:
-
- -Start Recording
-
-Web Form
-
-Park Call
-Transfer - Conference
-
-Hangup Customer
-
-Send DTMF
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
seconds:   Channel:   Cust Time:
Customer Information:
Title:   First:   MI:   Last:
Address1:
Address2:   Address3:
City:   State:   PostCode:
Province:   Vendor ID:
Phone:   DialCode:   Alt. Phone:
Show:   Email:
Comments:
- -
-


  - -
- - - - -
VICIDIAL web-client version:     BUILD:               Server:              
-Show conference call channel information
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HOT KEYS INACTIVE - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/voicemail_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc/voicemail_check.php deleted file mode 100644 index eb01d84b..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc/voicemail_check.php +++ /dev/null @@ -1,130 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Voicemail Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "voicemail box $vmail_box is not valid\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/active_list_refresh.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/active_list_refresh.php deleted file mode 100644 index 27dba826..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/active_list_refresh.php +++ /dev/null @@ -1,446 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Liste Anzeige: "; -if ($ADD==1) {echo "Phasenverlängerungen";} -if ($ADD==2) {echo "Beschäftigte Verlängerungen";} -if ($ADD==3) {echo "Äußere Linien";} -if ($ADD==4) {echo "Lokale Verlängerungen";} -if ($ADD==5) {echo "Konferenzen";} -if ($ADD==99999) {echo "HILFE";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/astguiclient.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/astguiclient.php deleted file mode 100644 index 6e9b2987..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/astguiclient.php +++ /dev/null @@ -1,2874 +0,0 @@ - 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.9'; -$build = '60112-1622'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Sie haben jetzt heraus geloggt. Danke\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: LOGON\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
LOGON
 
Benutzer-LOGON:
Benutzer-Kennwort:
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIVORWAHLKNOPF|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIVORWAHLKNOPF|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Telefon-LOGON\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Telefon-LOGON
 
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Telefon-LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Telefon-LOGON
 
Traurig, Ihr Telefon-LOGON und Kennwort seien Sie nicht in diesem:
 
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
HauptverkleidungAktive Linien VerkleidungKonferenz-VerkleidungÜberprüfen Sie VoicemailLeben Anruf
-
- - -

Logout
-
- - -
TRUNK HÄNGEZUSTAND

- Active Trunks Menu
- Hängezustand-Stamm   |   - Straßenräuber-Stamm   |   - Hören Stamm   |   - ErneuernSie   |   - Zurück zu Hauptfenster -
-
- - -
LOKALER HÄNGEZUSTAND

- Aktives Lokales Menü
- Hängezustand-Einheimischer   |   - Straßenräuber-Einheimischer   |   - Hören Einheimischer   |   - ErneuernSie   |   - Zurück zu Hauptfenster -
-
- - - - - - - -
PHASENANRUF-ÜBERTRAGUNG
Gebracht zu werden Führung: Führung
Verlängerungen:
Verlängerungen Menü
-
- Senden Sie zu vorgewählter Verlängerung

- Senden Sie zu vorgewähltem vmail Kasten

- Senden Sie zu dieser Zahl:


- ErneuernSie


- Zurück zu Hauptfenster

-
Konferenzen:
(klicken Sie an eine Zahl unten, um zu einer Konferenz zu senden)
Senden Sie meine Führung auch
Konferenz-Menü
-
- - - - - -
LOKALER Verlängerungen Vorwahlknopf
Telefon, das von benennt: Führung
Verlängerungen:
Verlängerungen Menü
-
- Anruf vorgewählte Verlängerung

- Anruf vorgewählter vmail Kasten

- ErneuernSie


- Zurück zu Hauptfenster

-
-
- - -
GEPARKTE ANRUFE:
- Zurück zu Hauptfenster

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NEU:     ALT:             MANUELLER VORWAHLKNOPF       VORWAHLKNOPF
GEPARKTE ANRUFE: 0                LOKALE VORWAHLKNOPF-VERLÄNGERUNGEN
OUTBOUND ANRUFE:
INBOUND ANRUFE:
astGUIclient Netz-Klient VERSION: BAU:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
LIEBLINGE       redigieren sie
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
LIEBLINGE

 
SUBMITSie LIEBLINGE CHANGES - requires logout
ZURÜCK ZU MAIN FENSTER - ignorieren Sie die vorgenommenen Änderungen
-
- -
- - - - - - - - - - - - - -
-PAUSE | ANFANG     Erneuern Sie Rate: 1000 ms Schneller | Langsamer

-
Initialisierung..
-
Aktive Verlängerungen
-ERNEUERNSie | -AUFTRAG | -
Äußere Linien
-ERNEUERNSie | -AUFTRAG | -
Lokale Verlängerungen
-ERNEUERNSie | -AUFTRAG | -
- Daten Gehen Hier

-
- Daten Gehen Hier

Stamm-Tätigkeit -
- Daten Gehen Hier

Lokale Tätigkeit -
-
- - - - -
- - -Konferenz-Liste - - - -
-Klicken Sie an Konferenzzimmernummer auf dem links für Info auf -
- - - - - - - - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/call_log_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/call_log_display.php deleted file mode 100644 index c8103ac0..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/call_log_display.php +++ /dev/null @@ -1,181 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Anruf-Maschinenbordbuch-Anzeige"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten ist unzulässig oder Protokoll $protocol ist unzulässig\n"; - exit; - } - else - { - ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - - echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; - } - echo "\n"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/conf_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/conf_exten_check.php deleted file mode 100644 index d41cda66..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/conf_exten_check.php +++ /dev/null @@ -1,213 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Conf Verlängerung Überprüfung"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten ist unzulässig\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $FührungA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $FührungA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$FührungA[$counter] ~"; - # echo "$FührungA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten ist unzulässig or Exten $exten ist unzulässig\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Konferenz $conf_exten ist zu registriert worden $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/dbconnect.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/inbound_popup.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/inbound_popup.php deleted file mode 100644 index b6353ba2..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/inbound_popup.php +++ /dev/null @@ -1,335 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -INBOUND LEBHAFTANRUF"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

INBOUND LEBHAFTANRUF

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid ist unzulässig\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Führung: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Führung=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "GEWOHNHEIT - \n"; - - echo "
Nummer Gewählt: $row[8]
Anmerkungen: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HÄNGEZUSTAND - \n"; - echo "SENDEN SIE ZU MEINEM VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/live_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/live_exten_check.php deleted file mode 100644 index 9ec1b423..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/live_exten_check.php +++ /dev/null @@ -1,263 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Phasenverlängerung Überprüfung"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten ist unzulässig oder Protokoll $protocol ist unzulässig\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $FührungA[$loop_count] = "$row[0]"; - $FührungB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$FührungA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$FührungA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$FührungB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$FührungB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "FührungA: $FührungA[$counter] ~"; - echo "FührungB: $FührungB[$counter] ~"; - echo "FührungBtrunk: $FührungA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/manager_send.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/manager_send.php deleted file mode 100644 index 63000277..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/manager_send.php +++ /dev/null @@ -1,882 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -### - $queryCID - ('CN012345678901234567',...) -### - $format - ('text','debug') -### - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $exten - ('1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $filename - ('20050406-125623_44444',...) -### - $extenName - ('phone100',...) -### - $parkedby - ('phone100',...) -### - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $auto_dial_level - ('0','1','1.1',...) -### - $campaign - ('CLOSER','TESTCAMP',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('1234',...) -### - $seconds - ('32',...) -### - $outbound_cid - ('3125551212','0000000000',...) -### - $agent_log_id - ('123456',...) -### - $call_server_ip - ('10.10.10.15',...) -### - $CalLCID - ('VD01234567890123456',...) -### - -# changes -# 50401-1002 First build of script, Hangup function only -# 50404-1045 Redirect basic function enabled -# 50406-1522 Monitor basic function enabled -# 50407-1647 Monitor and StopMonitor full functions enabled -# 50422-1120 basic Originate function enabled -# 50428-1451 basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 basic RedirectName and RedirectNameVmail added -# 50503-1227 added session_name checking for extra security -# 50523-1341 added Conference call start/stop recording -# 50523-1421 added OriginateName and OriginateNameVmail for local calls -# 50524-1602 added RedirectToPark and RedirectFromPark -# 50531-1203 added RedirecXtra for dual channel redirection -# 50630-1100 script changed to not use HTTP login vars, user/pass instead -# 50804-1148 Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 Added outbound_cid set if present to originate call -# 51020-1556 Added agent_log_id framework for detailed agent activity logging -# 51118-1204 Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 Added ability to accept calls from other VICIDIAL servers -# 51129-1253 Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### These are variable assignments for PHP globals off -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$queryCID=$_GET["queryCID"]; if (!$queryCID) {$queryCID=$_POST["queryCID"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$filename=$_GET["filename"]; if (!$filename) {$filename=$_POST["filename"];} -$extenName=$_GET["extenName"]; if (!$extenName) {$extenName=$_POST["extenName"];} -$parkedby=$_GET["parkedby"]; if (!$parkedby) {$parkedby=$_POST["parkedby"];} -$extrachannel=$_GET["extrachannel"]; if (!$extrachannel) {$extrachannel=$_POST["extrachannel"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$secondS=$_GET["secondS"]; if (!$secondS) {$secondS=$_POST["secondS"];} -$outbound_cid=$_GET["outbound_cid"]; if (!$outbound_cid) {$outbound_cid=$_POST["outbound_cid"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$call_server_ip=$_GET["call_server_ip"]; if (!$call_server_ip) {$call_server_ip=$_POST["call_server_ip"];} -$CalLCID=$_GET["CalLCID"]; if (!$CalLCID) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!$ACTION) {$ACTION="Originate";} -if (!$format) {$format="alert";} -if (!$ext_priority) {$ext_priority="1";} - - -$version = '0.0.22'; -$build = '60310-2022'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!$query_date) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Manager Senden: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "HILFE";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht eingesetzt\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate Befehl gesendet für Exten $exten Führung $channel auf $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nOriginateName Action nicht gesendet\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nOriginateNameVmail Action nicht gesendet\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten ist unzulässig or queryCID $queryCID ist unzulässig, Originate Befehl nicht eingesetzt\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate Befehl gesendet für Exten $exten Führung $channel auf $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten ist unzulässig or ext_context $ext_context or queryCID $queryCID ist unzulässig, Hangup Befehl nicht eingesetzt\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Führung $channel ist unzulässig or queryCID $queryCID ist unzulässig, Hangup Befehl nicht eingesetzt\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel ist nicht Phasen auf $call_server_ip, Checking Live Führung...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Führung $channel ist nicht Phasen auf $call_server_ip, Hangup Befehl nicht eingesetzt $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup Befehl gesendet für Führung $channel auf $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "auto_dial_level $auto_dial_level muß eingestellt werden\n"; - echo "campaign $campaign muß eingestellt werden\n"; - echo "uniqueid $uniqueid muß eingestellt werden\n"; - echo "lead_id $lead_id muß eingestellt werden\n"; - echo "\nRedirectVD Action nicht gesendet\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "parkedby $parkedby muß eingestellt werden\n"; - echo "\nRedirectToPark Action nicht gesendet\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirectFromPark Action nicht gesendet\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirectName Action nicht gesendet\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "extenName $extenName muß eingestellt werden\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirectNameVmail Action nicht gesendet\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "ExtraFührung $extrachannel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirect Action nicht gesendet\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Kann nicht leere Konferenz finden auf $server_ip, Redirect Befehl nicht eingesetzt\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Führung $channel ist nicht Phasen auf $call_server_ip, Redirect Befehl nicht eingesetzt\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Führung $channel ist nicht Phasen auf $server_ip, Redirect Befehl nicht eingesetzt\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra Befehl gesendet für Führung $channel and \nExtraFührung $extrachannel\n to $exten auf $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra Befehl gesendet für Führung $channel auf $call_server_ip and \nExtraFührung $extrachannel\n to $exten auf $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Eine dieser Variablen ist unzulässig:\n"; - echo "Führung $channel muß als 2 Buchstaben grösser sein\n"; - echo "queryCID $queryCID muß als 14 Buchstaben grösser sein\n"; - echo "exten $exten muß eingestellt werden\n"; - echo "ext_context $ext_context muß eingestellt werden\n"; - echo "ext_priority $ext_priority muß eingestellt werden\n"; - echo "\nRedirect Action nicht gesendet\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Führung $channel ist nicht Phasen auf $server_ip, Redirect Befehl nicht eingesetzt\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect Befehl gesendet für Führung $channel auf $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Führung $channel ist unzulässig or queryCID $queryCID ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht eingesetzt\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Führung $channel ist nicht Phasen auf $server_ip, $ACTION Befehl nicht eingesetzt\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION Befehl gesendet für Führung $channel auf $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Führung $channel ist unzulässig or exten $exten ist unzulässig or filename: $filename ist unzulässig, $ACTION Befehl nicht eingesetzt\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going auf in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION Befehl gesendet für Führung $channel auf $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n AUFNAHME DAUERT BIS 60 MINUTEN\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/park_calls_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/park_calls_display.php deleted file mode 100644 index 67f868c6..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/park_calls_display.php +++ /dev/null @@ -1,136 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Geparkte Anruf-Anzeige"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten ist unzulässig oder Protokoll $protocol ist unzulässig\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/vdc_db_query.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/vdc_db_query.php deleted file mode 100644 index 5f0052eb..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/vdc_db_query.php +++ /dev/null @@ -1,1289 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the meetme conference has live channels connected and which they are -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs') -### - $stage - ('start','finish') -### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -### - $conf_exten - ('8600011',...) -### - $exten - ('123test',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $campaign - ('testcamp',...) -### - $dial_timeout - ('60','26',...) -### - $dial_prefix - ('9','8',...) -### - $campaign_cid - ('3125551212','0000000000',...) -### - $MDnextCID - ('M06301413000000002',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('36524',...) -### - $list_id - ('101','123456',...) -### - $length_in_sec - ('12',...) -### - $phone_code - ('1',...) -### - $phone_number - ('3125551212',...) -### - $channel - ('Zap/12-1',...) -### - $start_epoch - ('1120236911',...) -### - $vendor_lead_code - ('1234test',...) -### - $title - ('Mr.',...) -### - $first_name - ('Bob',...) -### - $middle_initial - ('L',...) -### - $last_name - ('Wilson',...) -### - $address1 - ('1324 Main St.',...) -### - $address2 - ('Apt. 12',...) -### - $address3 - ('co Robert Wilson',...) -### - $city - ('Chicago',...) -### - $state - ('IL',...) -### - $province - ('NA',...) -### - $postal_code - ('60054',...) -### - $country_code - ('USA',...) -### - $gender - ('M',...) -### - $date_of_birth - ('1970-01-01',...) -### - $alt_phone - ('3125551213',...) -### - $email - ('bob@bob.com',...) -### - $security_phrase - ('Hello',...) -### - $comments - ('Good Customer',...) -### - $auto_dial_level - ('0','1','1.2',...) -### - $VDstop_rec_after_each_call - ('0','1') -### - $conf_silent_prefix - ('7','8','',...) -### - $extension - ('123','user123','25-1',...) -### - $protocol - ('Zap','SIP','IAX2',...) -### - $user_abb - ('1234','6666',...) -### - $preview - ('YES','NO',...) -### - $called_count - ('0','1','2',...) -### - $agent_log_id - ('123456',...) -### - $agent_log - ('NO',...) -### - $favorites_list - (",'cc160','cc100'",...) -### - -# changes -# 50629-1044 First build of script -# 50630-1422 Added manual dial action and MD channel lookup -# 50701-1451 Added dial log for start and end of vicidial calls -# 50705-1239 Added call disposition update -# 50804-1627 Fixed updateDispo to update vicidial_log entry -# 50816-1605 Added VDADpause/ready for auto dialing -# 50816-1811 Added basic autodial call pickup functions -# 50817-1005 Altered logging functions to accomodate auto_dialing -# 50818-1305 Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 Added hangup of agent phone after Logout -# 50901-1315 Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 Fixed CLOSER log length_in_sec bug -# 50902-1730 Added functions for manual preview dialing and revert -# 50913-1214 Added agent random update to leadupdate -# 51020-1421 Added agent_log_id framework for detailed agent activity logging -# 51021-1717 Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 Altered echo statements for several small PHP speed optimizations -# 51122-1328 Fixed UserLogout issue not removing conference reservation -# 51129-1012 Added ability to accept calls from other VICIDIAL servers -# 51129-1729 Changed manual dial to use the '/n' flag for calls -# 51221-1154 Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 Added Updating of astguiclient favorites in the DB -# 60208-1617 Added dtmf buttons output per call -# 60213-1521 Added closer_campaigns update to vicidial_users -# 60215-1036 Added Callback date-time entry into vicidial_callbacks table -# - -$version = '0.0.26'; -$build = '60215-1036'; - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$stage=$_GET["stage"]; if (!$stage) {$stage=$_POST["stage"];} -$closer_choice=$_GET["closer_choice"]; if (!$closer_choice) {$closer_choice=$_POST["closer_choice"];} -$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$dial_timeout=$_GET["dial_timeout"]; if (!$dial_timeout) {$dial_timeout=$_POST["dial_timeout"];} -$dial_prefix=$_GET["dial_prefix"]; if (!$dial_prefix) {$dial_prefix=$_POST["dial_prefix"];} -$campaign_cid=$_GET["campaign_cid"]; if (!$campaign_cid) {$campaign_cid=$_POST["campaign_cid"];} -$MDnextCID=$_GET["MDnextCID"]; if (!$MDnextCID) {$MDnextCID=$_POST["MDnextCID"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$list_id=$_GET["list_id"]; if (!$list_id) {$list_id=$_POST["list_id"];} -$length_in_sec=$_GET["length_in_sec"]; if (!$length_in_sec) {$length_in_sec=$_POST["length_in_sec"];} -$phone_code=$_GET["phone_code"]; if (!$phone_code) {$phone_code=$_POST["phone_code"];} -$phone_number=$_GET["phone_number"]; if (!$phone_number) {$phone_number=$_POST["phone_number"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$start_epoch=$_GET["start_epoch"]; if (!$start_epoch) {$start_epoch=$_POST["start_epoch"];} -$dispo_choice=$_GET["dispo_choice"]; if (!$dispo_choice) {$dispo_choice=$_POST["dispo_choice"];} -$vendor_lead_code=$_GET["vendor_lead_code"]; if (!$vendor_lead_code) {$vendor_lead_code=$_POST["vendor_lead_code"];} -$title=$_GET["title"]; if (!$title) {$title=$_POST["title"];} -$first_name=$_GET["first_name"]; if (!$first_name) {$first_name=$_POST["first_name"];} -$middle_initial=$_GET["middle_initial"]; if (!$middle_initial) {$middle_initial=$_POST["middle_initial"];} -$last_name=$_GET["last_name"]; if (!$last_name) {$last_name=$_POST["last_name"];} -$address1=$_GET["address1"]; if (!$address1) {$address1=$_POST["address1"];} -$address2=$_GET["address2"]; if (!$address2) {$address2=$_POST["address2"];} -$address3=$_GET["address3"]; if (!$address3) {$address3=$_POST["address3"];} -$city=$_GET["city"]; if (!$city) {$city=$_POST["city"];} -$state=$_GET["state"]; if (!$state) {$state=$_POST["state"];} -$province=$_GET["province"]; if (!$province) {$province=$_POST["province"];} -$postal_code=$_GET["postal_code"]; if (!$postal_code) {$postal_code=$_POST["postal_code"];} -$country_code=$_GET["country_code"]; if (!$country_code) {$country_code=$_POST["country_code"];} -$gender=$_GET["gender"]; if (!$gender) {$gender=$_POST["gender"];} -$date_of_birth=$_GET["date_of_birth"]; if (!$date_of_birth) {$date_of_birth=$_POST["date_of_birth"];} -$alt_phone=$_GET["alt_phone"]; if (!$alt_phone) {$alt_phone=$_POST["alt_phone"];} -$email=$_GET["email"]; if (!$email) {$email=$_POST["email"];} -$security_phrase=$_GET["security_phrase"]; if (!$security_phrase) {$security_phrase=$_POST["security_phrase"];} -$comments=$_GET["comments"]; if (!$comments) {$comments=$_POST["comments"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"]; if (!$VDstop_rec_after_each_call) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -$conf_silent_prefix=$_GET["conf_silent_prefix"]; if (!$conf_silent_prefix) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];} -$protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];} -$user_abb=$_GET["user_abb"]; if (!$user_abb) {$user_abb=$_POST["user_abb"];} -$preview=$_GET["preview"]; if (!$preview) {$preview=$_POST["preview"];} -$called_count=$_GET["called_count"]; if (!$called_count) {$called_count=$_POST["called_count"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log"];} -$favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];} -$CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -$recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];} - - -# default optional vars if not set -if (!$format) {$format="text";} -if ($format == 'debug') {$DB=1;} -if (!$ACTION) {$ACTION="refresh";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -if (!$query_date) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) -{ -echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; -exit; -} -else -{ - -if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Datenbank-Frage Index"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Gruppe Wahl $closer_choice ist unzulässig\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Gruppe Wahl $closer_choice ist zu registriert worden user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "ZUFUHRBEHÄLTER LEER\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context ist unzulässig\n"; - exit; - } - else - { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - ##### grab the lead_id of the reserved user in vicidial_hopper - $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - } - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INANRUF - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "ZUFUHRBEHÄLTER LEER\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context ist unzulässig\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INANRUF - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "ANRUF NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context ist unzulässig\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID ist unzulässig\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "MASCHINENBORDBUCH NICHT BETRETEN\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign ist unzulässig\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Eingesetzt: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "MASCHINENBORDBUCH NICHT BETRETEN\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "ANRUF_LOG Eingesetzt: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "MASCHINENBORDBUCH NICHT BETRETEN\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "MASCHINENBORDBUCH NICHT BETRETEN\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id ist unzulässig\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "MASCHINENBORDBUCH NICHT BETRETEN\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Kampagne $campaign ist unzulässig\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INANRUF in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INANRUF - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INANRUF - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INANRUF - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send auf to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user auf $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten ist unzulässig\n"; - exit; - } -else - { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation auf the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id ist unzulässig\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### ANRUFBACK ENTRY - if ( ($dispo_choice == 'CBHALT') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' ist zu geändert worden ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id ist unzulässig\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='$vendor_lead_code', title='$title', first_name='$first_name', middle_initial='$middle_initial', last_name='$last_name', address1='$address1', address2='$address2', address3='$address3', city='$city', state='$state', province='$province', postal_code='$postal_code', country_code='$country_code', gender='$gender', date_of_birth='$date_of_birth', alt_phone='$alt_phone', email='$email', security_phrase='$security_phrase', comments='$comments' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - echo "Lead $lead_id Informationen sind aktualisiert worden\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage ist unzulässig\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' ist jetzt im Status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list ist unzulässig\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - - - -if ($format=='debug') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/vicidial.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/vicidial.php deleted file mode 100644 index dd90edfc..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/vicidial.php +++ /dev/null @@ -1,4633 +0,0 @@ - LICENSE: GPLv2 -### -### make sure you have added a user to the vicidial_users MySQL table with at least -### user_level 1 or greater to access this page. Also, you need to have the login -### and pass of a phone listed in the asterisk.phones table. The page grabs the -### server info and other details from this login and pass. -### -### This script works best with Firefox or Mozilla, but will run for a couple -### hours on Internet Explorer before the memory leaks cause a crash. -### -### Other scripts that this application depends on: -### - vdc_db_query.php: Updates information in the database -### - manager_send.php: Sends manager actions to the DB for execution -### -### CHANGES -### 50607-1426 - First Build of VICIDIAL web client basic login process finished -### 50628-1620 - Added some basic formatting and worked on process flow -### 50628-1715 - Startup variables mapped to javascript variables -### 50629-1303 - Added Login Closer in-groups selection box and vla update -### 50629-1530 - Rough layout for customer info form section and button links -### 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -### 50701-1450 - Added vicidial_log entries on dial and hangup -### 50701-1634 - Added Logout function -### 50705-1259 - Added call disposition functionality -### 50705-1432 - Added lead info DB update function -### 50705-1658 - Added web form functionality -### 50706-1043 - Added call park and pickup functions -### 50706-1234 - Added Start/Stop Recording functionality -### 50706-1614 - Added conference channels display option -### 50711-1333 - Removed call check redundancy and fixed a span bug -### 50727-1424 - Added customer channel and participant present sensing/alerts -### 50804-1057 - Added SendDTMF function and reconfigured the transfer span -### 50804-1224 - Added Local and Internal Closer transfer functions -### 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -### 50804-1808 - Added button images for left buttons -### 50815-1151 - Added 3Way calling functions to Transfer-conf frame -### 50815-1602 - Added images and buttons for xfer functions -### 50816-1813 - Added basic autodial outbound call pickup functions -### 50817-1113 - Fixes to auto_dialing call receipt -### 50817-1234 - Added inbound call receipt capability -### 50817-1541 - Added customer time display -### 50817-1541 - Added customer time display -### 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -### 50818-1703 - Added pretty login section -### 50825-1200 - Modified form field lengths, added double-click dispositions -### 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -### 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -### 50903-0904 - Added preview-lead code for manual dialing -### 50904-0016 - Added ability to hangup manual dials before pickup -### 50906-1319 - Added override for filters on xfer calls, fixed login display bug -### 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -### 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -### 50913-1212 - Added campaign_cid to 3rd party calls -### 50923-1546 - Modified to work with language translation -### 50926-1656 - Added campaign pull-down at login of active campaigns -### 50928-1633 - Added manual dial alternate number dial option -### 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -### 51004-1656 - Fixed recording filename bug and new Spanish translation -### 51020-1103 - Added campaign-specific recording control abilities -### 51020-1352 - Added Basic vicidial_agent_log framework -### 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -### 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -### 51110-1432 - Fixed non-standard http port issue -### 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -### 51118-1305 - Activate multi-line comments from $multi_line_comments var -### 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -### 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -### 51129-1010 - Added ability to accept calls from other VICIDIAL servers -### 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -### 51208-1732 - Created user-first login that looks for default phone info -### 51219-1526 - Added variable framework for campaign and in-group scripts -### 51221-1200 - Added SCRIPT tab, layout and functionality -### 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -### 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -### 51229-1028 - Added checks on web_form_address to allow for var in the DB value -### 60117-1312 - Added Transfer-conf frame toggle on button press -### 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -### 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -### 60213-1210 - Added ability to sort routing of calls by user_level -### 60214-0932 - Initial Callback calendar display framework -### 60214-1407 - Added ability to minimize the dispo screen to see info below -### 60215-1104 - Added ANYONE scheduled callbacks functionality -### - -require("dbconnect.php"); - -$DB=$_GET['DB']; if (!$DB) {$DB=$_POST["DB"];} -$phone_login=$_GET['phone_login']; if (!$phone_login) {$phone_login=$_POST["phone_login"];} - if (!$phone_login) {$phone_login=$_GET["pl"];} -$phone_pass=$_GET['phone_pass']; if (!$phone_pass) {$phone_pass=$_POST["phone_pass"];} - if (!$phone_pass) {$phone_pass=$_GET["pp"];} -$VD_login=$_GET['VD_login']; if (!$VD_login) {$VD_login=$_POST["VD_login"];} -$VD_pass=$_GET['VD_pass']; if (!$VD_pass) {$VD_pass=$_POST["VD_pass"];} -$VD_campaign=$_GET['VD_campaign']; if (!$VD_campaign) {$VD_campaign=$_POST["VD_campaign"];} - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); -$relogin=$_GET['relogin']; if (!$relogin) {$relogin=$_POST["relogin"];} - -$forever_stop=0; - -$version = '1.1.66'; -$build = '60215-1104'; - -if ($force_logout) -{ - echo "Sie haben jetzt heraus geloggt. Danke\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$manual_dial_preview = '1'; # Allow preview lead option when manual dial -$HKuser_level = '5'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_alt_phone = '1'; # allow manual dial users to call alt phone number -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIVORWAHLKNOPF web client: Re-LOGON\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-LOGON
 
Telefon-LOGON:
Telefon-Kennwort:
Benutzer-LOGON:
Benutzer-Kennwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIVORWAHLKNOPF web client: Kampagne LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Benutzer-LOGON

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Kampagne LOGON
 
Benutzer-LOGON:
Benutzer-Kennwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIVORWAHLKNOPF web client: LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
LOGON
 
Telefon-LOGON:
Telefon-Kennwort:
Benutzer-LOGON:
Benutzer-Kennwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIVORWAHLKNOPF web client: Telefon-LOGON\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Telefon-LOGON
 
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Die aktive Kampagne nicht, versuchen bitte noch einmal
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Der falsche LOGON, versuchen bitte noch einmal
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIVORWAHLKNOPF web client: Kampagne LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Kampagne LOGON
 
Benutzer-LOGON:
Benutzer-Kennwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIVORWAHLKNOPF web client: Telefon-LOGON Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
LOGON Error
 
Traurig, Ihr Telefon-LOGON und Kennwort seien Sie nicht in diesem:
 
Telefon-LOGON:
Telefon-Kennwort:

VERSION: $version       BAU: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIVORWAHLKNOPF web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed auf this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login auf phone: $SIP_user zur Kampagne: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NEU record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIVORWAHLKNOPF web client: VICIVORWAHLKNOPF Kampagne LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Traurig, gibt es keine Leitungen im Zufuhrbehälter für diese\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "LOGON: \n
"; - echo "Kennwort:
\n"; - echo "Kampagne: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIVORWAHLKNOPF web client: VICIVORWAHLKNOPF Kampagne LOGON\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "LOGON: \n
"; - echo "Kennwort:
\n"; - echo "Kampagne: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -LOGOUT\n"; ?> -
-
- - - - - - - - -
VICIVORWAHLKNOPFSCRIPT   LIVE     Lernabschnitt ID: Leben Anruf
-
- - - - -

VICIVORWAHLKNOPF
-
- - - - -
- - Übertragung - Konferenz
- INTERNES GENAUERES - EINHEIMISCHER GENAUER - CODE - Hängezustand Xfer Linie - Hängezustand Beide Linien - -
- - Zahl zum zu benennen   - Sekunden   - channel - - OVERRIDE   - D1 - D2 -
- - Vorwahlknopf Mit Kunden - Park-Kunde Vorwahlknopf - ANRUF DES URLAUB-3-WAY - Vorwahlknopf-Vorhang-Übertragung - Blind Transfer VMail Message -
-
-
- - - - -
Leitung Dispositioned Wie:

- -
-
-
- - - - - - - -
Einteilung Heiße Schlüssel: - Wenn aktiv, betätigen Sie einfach die Taste für die gewünschte:
- - - - - -
-
- - -
Noone ist in Ihrem Lernabschnitt:
- OK -
-
- - -
Kunde hat oben gehangen:
- OK -
-
- - -

LOGOUT
-
- - -
-
- - -
 
-
- - -
Alle mögliche Änderungen, die am Kunden vorgenommen wurden, den, Informationen unten diesmal nicht sind, comitted, Sie müssen Kunde Informationen vor Ihnen ändern Hängezustand der Anruf.
-
- - -
EINTEILUNG ANRUF :       setzen Sie herab
- Ende-von-benennen Sie Einteilung Vorwähler -
- STOPPEN SIE ZU BENENNEN
- ZURÜCKSTELLEN | - SUBMITSie -



  -
-
- - - -
Wählen Sie ein Wiederholungsbesuch Datum vor :
- - - Wählen Sie ein Datum unten vor   -     - Hour: -   - Minutes: -   - -  
- - COLUMBIUM Anmerkungen:

- - SUBMITSie

- - -

  -
-
- - -
GENAUERE INBOUND GRUPPENWAHL
- Genauere Inbound Gruppenwahl -
- GEMISCHTES BENENNEN(outbound aktiviert)
- ZURÜCKSTELLEN | - SUBMITSie -



  -
-
- - - - - - - - - - - -
PHASENANRUF-ÜBERTRAGUNG
Gebracht zu werden Führung: Führung
Verlängerungen:
Verlängerungen Menü
-
- Senden Sie zu vorgewählter Verlängerung

- Senden Sie zu vorgewähltem vmail Kasten

- Senden Sie zu dieser Zahl:


- ERNEUERNSie


- Zurück zu Hauptfenster

-
Konferenzen:
(klicken Sie an eine Zahl unten, um zu einer Konferenz zu senden)
Senden Sie meine Führung auch
Konferenz-Menü
-
- - - - -
VICIVORWAHLKNOPF SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Vorwahlknopf-Folgende Zahl
- LEITUNG VORBETRACHTUNG
";} -if ( ($manual_dial_alt_phone) and ($auto_dial_level==0) ) - {echo " WECH TELEFON
";} - - -?> -REGISTERAKTE:
-
-
-SATZ IDENTIFIKATION:
-
- -Fangen Sie an Zu notieren
-
-Netz-Form
-
-Park-Anruf
-Übertragung - Konferenz
-
-Hängezustand-Kunde
-
-Senden Sie DTMF
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
Sekunden:   Führung:   Cust Zeit:
Kunde Informationen:
Titel:   Zuerst:   MI:  Letztes:
Adresse1:
Adresse2:   Adresse3:
Stadt:   Zustand:   PostCode:
Provinz:   Verkäufer Identifikation:
Telefon:   DialCode:   Wech Telefon:
Erscheinen:   Email:
Anmerkungen:
- -
-


  - -
- - - - -
VICIVORWAHLKNOPF Netz-Klient Version:     BAU:               Bediener:              
-Zeigen Sie Konferenzanruf-Führung Informationen
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HEISSE SCHLÜSSEL UNAKTIVIERT - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/voicemail_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/voicemail_check.php deleted file mode 100644 index acb1d46f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_de/voicemail_check.php +++ /dev/null @@ -1,130 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Unzulässig Benutzername/Kennwort: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Unzulässig server_ip: |$server_ip| or Unzulässig session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Unzulässig session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Voicemail Überprüfung"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "voicemail Kasten $vmail_box ist unzulässig\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/active_list_refresh.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/active_list_refresh.php deleted file mode 100644 index 23615375..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/active_list_refresh.php +++ /dev/null @@ -1,446 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Ακυρο Χρήστηςname/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Κατάλογος Οθόνης: "; -if ($ADD==1) {echo "Ενεργές τηλ. συνδέσεις";} -if ($ADD==2) {echo "Απασχολημένες τηλ. συνδέσεις";} -if ($ADD==3) {echo "Εξωτερικές γραμμές";} -if ($ADD==4) {echo "Τοπικές τηλ. συνδέσεις";} -if ($ADD==5) {echo "Διασκέψεις";} -if ($ADD==99999) {echo "ΒΟΗΘΕΙΑ";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/astguiclient.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/astguiclient.php deleted file mode 100644 index 4d797060..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/astguiclient.php +++ /dev/null @@ -1,2874 +0,0 @@ - 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.9'; -$build = '60112-1622'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Έχετε αποσυνδεθεί. Σας ευχαριστούμε\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: Σύνδεση\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση
 
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIΚΛΗΣΗ|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIΚΛΗΣΗ|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Σύνδεση Τηλεφώνου\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Σύνδεση Τηλεφώνου
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Σύνδεση Τηλεφώνου\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση Τηλεφώνου
 
Συγγνώμη, αλλά η τηλεφωνική σύνδεση και ο κωδικός πρόσβασής σας δεν είναι ενεργά σε αυτό το σύστημα, παρακαλώ προσπαθήστε πάλι:
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -ΑΠΟΣΥΝΔΕΣΗ
\n"; ?> -
Κύριος ΠίνακαςΠίνακας Ενεργών ΓραμμώνΠίνακας διασκέψεωνΕλεγχος Φωνητικού ταχυδρομείουΕνεργή κλήση
-
- - -

Logout
-
- - -
TRUNK ΚΛΕΙΣΙΜΟ

- Active Trunks Menu
- Κλείσιμο Trunk   |   - Κλέψιμο Trunk   |   - Ακούστε Trunk   |   - Ανανέωση   |   - Επιστροφή στο κύριο παράθυρο -
-
- - -
ΤΟΠΙΚΟ ΚΛΕΙΣΙΜΟ ΤΗΛΕΦΩΝΟΥ

- Ενεργές Τοπικές Επιλογές
- Κλείσιμο τοπικού   |   - Κλέψιμο τοπικού   |   - Ακούστε τοπικό   |   - Ανανέωση   |   - Επιστροφή στο κύριο παράθυρο -
-
- - - - - - - -
ΜΕΤΑΦΟΡΑ ΕΝΕΡΓΗΣ ΚΛΗΣΗΣ
Κανάλι που μεταφέρεται: Κανάλι
Τηλ.συνδέσεις:
Επιλογές τηλ. συνδέσεων
-
- Στείλε στην επιλεγμένη τηλ.σύνδεση

- Στείλε στο επιλεγμένο vmail

- Στείλε σε αυτόν τον αριθμό:


- Ανανέωση


- Επιστροφή στο κύριο παράθυρο

-
Διασκέψεις:
(επιλέξτε έναν αριθμό κατωτέρω που θα σταλεί σε μια διάσκεψη)
Στείλε το κανάλι μου επίσης
Επιλογές διασκέψεων
-
- - - - - -
ΤΟΠΙΚΕΣ τηλ. συνδέσεις Κλήσεως
Τηλέφωνο που καλεί από: Κανάλι
Τηλ.συνδέσεις:
Επιλογές τηλ. συνδέσεων
-
- Επιλεγμένη κλήση τηλ. σύνδεσης

- Επιλεγμένη κλήση vmail

- Ανανέωση


- Επιστροφή στο κύριο παράθυρο

-
-
- - -
ΣΤΑΘΜΕΥΜΕΝΕΣ ΚΛΗΣΕΙΣ:
- Επιστροφή στο κύριο παράθυρο

-
-
- - - - - - - - - - - - - - - -
  -
ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ     ΝΕΟ:     ΠΑΛΑΙΟ:             ΧΕΙΡΩΝΑΚΤΙΚΗ ΚΛΗΣΗ       ΚΛΗΣΗ
ΣΤΑΘΜΕΥΜΕΝΕΣ ΚΛΗΣΕΙΣ: 0                ΤΗΛ. ΣΥΝΔΕΣΕΙΣ ΤΟΠΙΚΗΣ ΚΛΗΣΗΣ
ΕΞΕΡΧΟΜΕΝΕΣ ΚΛΗΣΕΙΣ:
ΕΙΣΕΡΧΟΜΕΝΕΣ ΚΛΗΣΕΙΣ:
ΈΚΔΟΣΗ astGUIclient: ΔΗΜΙΟΥΡΓΙΑ:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
ΣΥΜΠΑΘΕΙΕΣ       εκδώστε
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
ΣΥΜΠΑΘΕΙΕΣ

 
ΥΠΟΒΑΛΕΤΕ ΣΥΜΠΑΘΕΙΕΣ CHANGES - requires logout
ΠΙΣΩ στο ΚΥΡΙΟ ΠΑΡΑΘΥΡΟ - αγνοήστε τις αλλαγές που γίνονται
-
- -
- - - - - - - - - - - - - -
-ΠΑΥΣΗ | ΕΝΑΡΞΗ     Ποσοστό ανανέωσης: 1000 ms Γρηγορότερα | Πιό αργά

-
Αρχή..
-
Ενεργές τηλ. συνδέσεις
-ΑΝΑΝΕΩΣΗ | -ΔΙΑΤΑΓΗ | -
Εξωτερικές γραμμές
-ΑΝΑΝΕΩΣΗ | -ΔΙΑΤΑΓΗ | -
Τοπικές τηλ. συνδέσεις
-ΑΝΑΝΕΩΣΗ | -ΔΙΑΤΑΓΗ | -
- Τα δεδομένα πηγαίνουν εδώ

-
- Τα δεδομένα πηγαίνουν εδώ

Κίνηση Trunk -
- Τα δεδομένα πηγαίνουν εδώ

Τοπική Κίνηση -
-
- - - - -
- - -Κατάλογος διασκέψεων - - - -
-Επιλέξτε έναν αριθμό δωματίου διάσκεψης στα αριτερά για τις πληροφορίες σε εκείνη την διάσκεψη -
- - - - - - - - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/call_log_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/call_log_display.php deleted file mode 100644 index 9559ad84..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/call_log_display.php +++ /dev/null @@ -1,181 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Ακυρο Χρήστηςname/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Έμφάνιση Καταγραμμένων Κλήσεων"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten δεν ισχύει ή πρωτόκολλο $protocol δεν ισχύει\n"; - exit; - } - else - { - ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - - echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; - } - echo "\n"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/conf_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/conf_exten_check.php deleted file mode 100644 index e6eb9568..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/conf_exten_check.php +++ /dev/null @@ -1,213 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Ακυρο Χρήστηςname/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Έλεγχος τηλ.σύνδεσης διάσκεψης"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten δεν ισχύει\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ΚανάλιA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ΚανάλιA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ΚανάλιA[$counter] ~"; - # echo "$ΚανάλιA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten δεν ισχύει or Exten $exten δεν ισχύει\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Διάσκεψη $conf_exten έχει καταχωρηθεί $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/dbconnect.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/inbound_popup.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/inbound_popup.php deleted file mode 100644 index e017b132..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/inbound_popup.php +++ /dev/null @@ -1,335 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Ακυρο Χρήστηςname/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -ΕΝΕΡΓΗ ΕΙΣΕΡΧΟΜΕΝΗ ΚΛΗΣΗ"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

ΕΝΕΡΓΗ ΕΙΣΕΡΧΟΜΕΝΗ ΚΛΗΣΗ

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid δεν ισχύει\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Κανάλι: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Κανάλι=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "ΣΥΝΗΘΕΙΑ - \n"; - - echo "
Αριθμός που καλέσατε: $row[8]
Σημειώσεις: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "ΚΛΕΙΣΙΜΟ - \n"; - echo "ΣΤΕΙΛΕ ΣΤΟ ΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΙΟ ΜΟΥ\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/live_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/live_exten_check.php deleted file mode 100644 index 083caa12..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/live_exten_check.php +++ /dev/null @@ -1,263 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Ακυρο Χρήστηςname/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Ελεγχος ενεργής τηλ.σύνδεσης"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten δεν ισχύει ή πρωτόκολλο $protocol δεν ισχύει\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ΚανάλιA[$loop_count] = "$row[0]"; - $ΚανάλιB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ΚανάλιA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ΚανάλιA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ΚανάλιB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ΚανάλιB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ΚανάλιA: $ΚανάλιA[$counter] ~"; - echo "ΚανάλιB: $ΚανάλιB[$counter] ~"; - echo "ΚανάλιBtrunk: $ΚανάλιA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/manager_send.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/manager_send.php deleted file mode 100644 index 0c2be0a8..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/manager_send.php +++ /dev/null @@ -1,882 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -### - $queryCID - ('CN012345678901234567',...) -### - $format - ('text','debug') -### - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $exten - ('1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $filename - ('20050406-125623_44444',...) -### - $extenName - ('phone100',...) -### - $parkedby - ('phone100',...) -### - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $auto_dial_level - ('0','1','1.1',...) -### - $campaign - ('CLOSER','TESTCAMP',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('1234',...) -### - $seconds - ('32',...) -### - $outbound_cid - ('3125551212','0000000000',...) -### - $agent_log_id - ('123456',...) -### - $call_server_ip - ('10.10.10.15',...) -### - $CalLCID - ('VD01234567890123456',...) -### - -# changes -# 50401-1002 First build of script, Hangup function only -# 50404-1045 Redirect basic function enabled -# 50406-1522 Monitor basic function enabled -# 50407-1647 Monitor and StopMonitor full functions enabled -# 50422-1120 basic Originate function enabled -# 50428-1451 basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 basic RedirectName and RedirectNameVmail added -# 50503-1227 added session_name checking for extra security -# 50523-1341 added Conference call start/stop recording -# 50523-1421 added OriginateName and OriginateNameVmail for local calls -# 50524-1602 added RedirectToPark and RedirectFromPark -# 50531-1203 added RedirecXtra for dual channel redirection -# 50630-1100 script changed to not use HTTP login vars, user/pass instead -# 50804-1148 Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 Added outbound_cid set if present to originate call -# 51020-1556 Added agent_log_id framework for detailed agent activity logging -# 51118-1204 Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 Added ability to accept calls from other VICIDIAL servers -# 51129-1253 Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### These are variable assignments for PHP globals off -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$queryCID=$_GET["queryCID"]; if (!$queryCID) {$queryCID=$_POST["queryCID"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$filename=$_GET["filename"]; if (!$filename) {$filename=$_POST["filename"];} -$extenName=$_GET["extenName"]; if (!$extenName) {$extenName=$_POST["extenName"];} -$parkedby=$_GET["parkedby"]; if (!$parkedby) {$parkedby=$_POST["parkedby"];} -$extrachannel=$_GET["extrachannel"]; if (!$extrachannel) {$extrachannel=$_POST["extrachannel"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$secondS=$_GET["secondS"]; if (!$secondS) {$secondS=$_POST["secondS"];} -$outbound_cid=$_GET["outbound_cid"]; if (!$outbound_cid) {$outbound_cid=$_POST["outbound_cid"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$call_server_ip=$_GET["call_server_ip"]; if (!$call_server_ip) {$call_server_ip=$_POST["call_server_ip"];} -$CalLCID=$_GET["CalLCID"]; if (!$CalLCID) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!$ACTION) {$ACTION="Originate";} -if (!$format) {$format="alert";} -if (!$ext_priority) {$ext_priority="1";} - - -$version = '0.0.22'; -$build = '60310-2022'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!$query_date) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Ακυρο Χρήστηςname/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Ο διευθυντής στέλνει: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "ΒΟΗΘΕΙΑ";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten δεν ισχύει or queryCID $queryCID δεν ισχύει, Originate εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate εντολή που στέλνεται για Exten $exten Κανάλι $channel Στην $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nOriginateName Action μην σταλμένος\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nOriginateNameVmail Action μην σταλμένος\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten δεν ισχύει or queryCID $queryCID δεν ισχύει, Originate εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate εντολή που στέλνεται για Exten $exten Κανάλι $channel Στην $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten δεν ισχύει or ext_context $ext_context or queryCID $queryCID δεν ισχύει, Hangup εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Κανάλι $channel δεν ισχύει or queryCID $queryCID δεν ισχύει, Hangup εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel δεν είναι ενεργό Στην $call_server_ip, Checking Live Κανάλι...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Κανάλι $channel δεν είναι ενεργό Στην $call_server_ip, Hangup εντολή που δεν έγινε εισαγωγή $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup εντολή που στέλνεται για Κανάλι $channel Στην $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "auto_dial_level $auto_dial_level πρέπει να τεθεί\n"; - echo "campaign $campaign πρέπει να τεθεί\n"; - echo "uniqueid $uniqueid πρέπει να τεθεί\n"; - echo "lead_id $lead_id πρέπει να τεθεί\n"; - echo "\nRedirectVD Action μην σταλμένος\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "parkedby $parkedby πρέπει να τεθεί\n"; - echo "\nRedirectToPark Action μην σταλμένος\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirectFromPark Action μην σταλμένος\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirectName Action μην σταλμένος\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "extenName $extenName πρέπει να τεθεί\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirectNameVmail Action μην σταλμένος\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "ExtraΚανάλι $extrachannel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirect Action μην σταλμένος\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Δεν υπάρχει κενή διάσκεψη Στην $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Κανάλι $channel δεν είναι ενεργό Στην $call_server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Κανάλι $channel δεν είναι ενεργό Στην $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra εντολή που στέλνεται για Κανάλι $channel and \nExtraΚανάλι $extrachannel\n to $exten Στην $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra εντολή που στέλνεται για Κανάλι $channel Στην $call_server_ip and \nExtraΚανάλι $extrachannel\n to $exten Στην $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Μία από αυτές τις μεταβλητές δεν ισχύει:\n"; - echo "Κανάλι $channel πρέπει να είναι μεγαλύτερος από 2 χαρακτήρες\n"; - echo "queryCID $queryCID πρέπει να είναι μεγαλύτερος από 14 χαρακτήρες\n"; - echo "exten $exten πρέπει να τεθεί\n"; - echo "ext_context $ext_context πρέπει να τεθεί\n"; - echo "ext_priority $ext_priority πρέπει να τεθεί\n"; - echo "\nRedirect Action μην σταλμένος\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Κανάλι $channel δεν είναι ενεργό Στην $server_ip, Redirect εντολή που δεν έγινε εισαγωγή\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect εντολή που στέλνεται για Κανάλι $channel Στην $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Κανάλι $channel δεν ισχύει or queryCID $queryCID δεν ισχύει or filename: $filename δεν ισχύει, $ACTION εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Κανάλι $channel δεν είναι ενεργό Στην $server_ip, $ACTION εντολή που δεν έγινε εισαγωγή\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION εντολή που στέλνεται για Κανάλι $channel Στην $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Κανάλι $channel δεν ισχύει or exten $exten δεν ισχύει or filename: $filename δεν ισχύει, $ACTION εντολή που δεν έγινε εισαγωγή\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going Στην in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION εντολή που στέλνεται για Κανάλι $channel Στην $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n Η ΚΑΤΑΓΡΑΦΗ ΘΑ ΔΙΑΡΚΕΣΕΙ ΜΕΧΡΙ 60 ΛΕΠΤΑ\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/park_calls_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/park_calls_display.php deleted file mode 100644 index 2da41b45..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/park_calls_display.php +++ /dev/null @@ -1,136 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Ακυρο Χρήστηςname/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Εμφάνιση Σταθμευμένων Κλήσεων"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten δεν ισχύει ή πρωτόκολλο $protocol δεν ισχύει\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/vdc_db_query.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/vdc_db_query.php deleted file mode 100644 index 0af92dbb..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/vdc_db_query.php +++ /dev/null @@ -1,1289 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the meetme conference has live channels connected and which they are -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs') -### - $stage - ('start','finish') -### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -### - $conf_exten - ('8600011',...) -### - $exten - ('123test',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $campaign - ('testcamp',...) -### - $dial_timeout - ('60','26',...) -### - $dial_prefix - ('9','8',...) -### - $campaign_cid - ('3125551212','0000000000',...) -### - $MDnextCID - ('M06301413000000002',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('36524',...) -### - $list_id - ('101','123456',...) -### - $length_in_sec - ('12',...) -### - $phone_code - ('1',...) -### - $phone_number - ('3125551212',...) -### - $channel - ('Zap/12-1',...) -### - $start_epoch - ('1120236911',...) -### - $vendor_lead_code - ('1234test',...) -### - $title - ('Mr.',...) -### - $first_name - ('Bob',...) -### - $middle_initial - ('L',...) -### - $last_name - ('Wilson',...) -### - $address1 - ('1324 Main St.',...) -### - $address2 - ('Apt. 12',...) -### - $address3 - ('co Robert Wilson',...) -### - $city - ('Chicago',...) -### - $state - ('IL',...) -### - $province - ('NA',...) -### - $postal_code - ('60054',...) -### - $country_code - ('USA',...) -### - $gender - ('M',...) -### - $date_of_birth - ('1970-01-01',...) -### - $alt_phone - ('3125551213',...) -### - $email - ('bob@bob.com',...) -### - $security_phrase - ('Hello',...) -### - $comments - ('Good Customer',...) -### - $auto_dial_level - ('0','1','1.2',...) -### - $VDstop_rec_after_each_call - ('0','1') -### - $conf_silent_prefix - ('7','8','',...) -### - $extension - ('123','user123','25-1',...) -### - $protocol - ('Zap','SIP','IAX2',...) -### - $user_abb - ('1234','6666',...) -### - $preview - ('YES','NO',...) -### - $called_count - ('0','1','2',...) -### - $agent_log_id - ('123456',...) -### - $agent_log - ('NO',...) -### - $favorites_list - (",'cc160','cc100'",...) -### - -# changes -# 50629-1044 First build of script -# 50630-1422 Added manual dial action and MD channel lookup -# 50701-1451 Added dial log for start and end of vicidial calls -# 50705-1239 Added call disposition update -# 50804-1627 Fixed updateDispo to update vicidial_log entry -# 50816-1605 Added VDADpause/ready for auto dialing -# 50816-1811 Added basic autodial call pickup functions -# 50817-1005 Altered logging functions to accomodate auto_dialing -# 50818-1305 Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 Added hangup of agent phone after Logout -# 50901-1315 Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 Fixed CLOSER log length_in_sec bug -# 50902-1730 Added functions for manual preview dialing and revert -# 50913-1214 Added agent random update to leadupdate -# 51020-1421 Added agent_log_id framework for detailed agent activity logging -# 51021-1717 Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 Altered echo statements for several small PHP speed optimizations -# 51122-1328 Fixed UserLogout issue not removing conference reservation -# 51129-1012 Added ability to accept calls from other VICIDIAL servers -# 51129-1729 Changed manual dial to use the '/n' flag for calls -# 51221-1154 Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 Added Updating of astguiclient favorites in the DB -# 60208-1617 Added dtmf buttons output per call -# 60213-1521 Added closer_campaigns update to vicidial_users -# 60215-1036 Added Callback date-time entry into vicidial_callbacks table -# - -$version = '0.0.26'; -$build = '60215-1036'; - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$stage=$_GET["stage"]; if (!$stage) {$stage=$_POST["stage"];} -$closer_choice=$_GET["closer_choice"]; if (!$closer_choice) {$closer_choice=$_POST["closer_choice"];} -$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$dial_timeout=$_GET["dial_timeout"]; if (!$dial_timeout) {$dial_timeout=$_POST["dial_timeout"];} -$dial_prefix=$_GET["dial_prefix"]; if (!$dial_prefix) {$dial_prefix=$_POST["dial_prefix"];} -$campaign_cid=$_GET["campaign_cid"]; if (!$campaign_cid) {$campaign_cid=$_POST["campaign_cid"];} -$MDnextCID=$_GET["MDnextCID"]; if (!$MDnextCID) {$MDnextCID=$_POST["MDnextCID"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$list_id=$_GET["list_id"]; if (!$list_id) {$list_id=$_POST["list_id"];} -$length_in_sec=$_GET["length_in_sec"]; if (!$length_in_sec) {$length_in_sec=$_POST["length_in_sec"];} -$phone_code=$_GET["phone_code"]; if (!$phone_code) {$phone_code=$_POST["phone_code"];} -$phone_number=$_GET["phone_number"]; if (!$phone_number) {$phone_number=$_POST["phone_number"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$start_epoch=$_GET["start_epoch"]; if (!$start_epoch) {$start_epoch=$_POST["start_epoch"];} -$dispo_choice=$_GET["dispo_choice"]; if (!$dispo_choice) {$dispo_choice=$_POST["dispo_choice"];} -$vendor_lead_code=$_GET["vendor_lead_code"]; if (!$vendor_lead_code) {$vendor_lead_code=$_POST["vendor_lead_code"];} -$title=$_GET["title"]; if (!$title) {$title=$_POST["title"];} -$first_name=$_GET["first_name"]; if (!$first_name) {$first_name=$_POST["first_name"];} -$middle_initial=$_GET["middle_initial"]; if (!$middle_initial) {$middle_initial=$_POST["middle_initial"];} -$last_name=$_GET["last_name"]; if (!$last_name) {$last_name=$_POST["last_name"];} -$address1=$_GET["address1"]; if (!$address1) {$address1=$_POST["address1"];} -$address2=$_GET["address2"]; if (!$address2) {$address2=$_POST["address2"];} -$address3=$_GET["address3"]; if (!$address3) {$address3=$_POST["address3"];} -$city=$_GET["city"]; if (!$city) {$city=$_POST["city"];} -$state=$_GET["state"]; if (!$state) {$state=$_POST["state"];} -$province=$_GET["province"]; if (!$province) {$province=$_POST["province"];} -$postal_code=$_GET["postal_code"]; if (!$postal_code) {$postal_code=$_POST["postal_code"];} -$country_code=$_GET["country_code"]; if (!$country_code) {$country_code=$_POST["country_code"];} -$gender=$_GET["gender"]; if (!$gender) {$gender=$_POST["gender"];} -$date_of_birth=$_GET["date_of_birth"]; if (!$date_of_birth) {$date_of_birth=$_POST["date_of_birth"];} -$alt_phone=$_GET["alt_phone"]; if (!$alt_phone) {$alt_phone=$_POST["alt_phone"];} -$email=$_GET["email"]; if (!$email) {$email=$_POST["email"];} -$security_phrase=$_GET["security_phrase"]; if (!$security_phrase) {$security_phrase=$_POST["security_phrase"];} -$comments=$_GET["comments"]; if (!$comments) {$comments=$_POST["comments"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"]; if (!$VDstop_rec_after_each_call) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -$conf_silent_prefix=$_GET["conf_silent_prefix"]; if (!$conf_silent_prefix) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];} -$protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];} -$user_abb=$_GET["user_abb"]; if (!$user_abb) {$user_abb=$_POST["user_abb"];} -$preview=$_GET["preview"]; if (!$preview) {$preview=$_POST["preview"];} -$called_count=$_GET["called_count"]; if (!$called_count) {$called_count=$_POST["called_count"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log"];} -$favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];} -$CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -$recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];} - - -# default optional vars if not set -if (!$format) {$format="text";} -if ($format == 'debug') {$DB=1;} -if (!$ACTION) {$ACTION="refresh";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -if (!$query_date) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) -{ -echo "Ακυρο Χρήστηςname/Κωδικός πρόσβασης: |$user|$pass|\n"; -exit; -} -else -{ - -if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Κώδικας ερώτησης βάσεων δεδομένων"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Επιλογή ομάδας $closer_choice δεν ισχύει\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Επιλογή ομάδας $closer_choice έχει καταχωρηθεί user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "ΚΕΝΟΣ HOPPER\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context δεν ισχύει\n"; - exit; - } - else - { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - ##### grab the lead_id of the reserved user in vicidial_hopper - $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - } - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "ΚΕΝΟΣ HOPPER\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context δεν ισχύει\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "ΚΛΗΣΗ NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context δεν ισχύει\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID δεν ισχύει\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign δεν ισχύει\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Εισαγωγή : $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "ΚΛΗΣΗ_LOG Εισαγωγή : $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id δεν ισχύει\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "ΔΕΝ ΕΓΙΝΕ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΚΑΤΑΓΡΑΦΗ ΓΕΓΟΝΟΤΩΝ\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Εκστρατεία $campaign δεν ισχύει\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INΚΛΗΣΗ in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INΚΛΗΣΗ - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send Στην to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user Στην $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten δεν ισχύει\n"; - exit; - } -else - { - ##### Insert a ΑΠΟΣΥΝΔΕΣΗ record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','ΑΠΟΣΥΝΔΕΣΗ','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation Στην the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id δεν ισχύει\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### ΚΛΗΣΗBACK ENTRY - if ( ($dispo_choice == 'CBHΠΑΛΑΙΟ') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' έχει αλλαχτεί ' . $dispo_choice . " Κατάσταση\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id δεν ισχύει\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='$vendor_lead_code', title='$title', first_name='$first_name', middle_initial='$middle_initial', last_name='$last_name', address1='$address1', address2='$address2', address3='$address3', city='$city', state='$state', province='$province', postal_code='$postal_code', country_code='$country_code', gender='$gender', date_of_birth='$date_of_birth', alt_phone='$alt_phone', email='$email', security_phrase='$security_phrase', comments='$comments' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - echo "Lead $lead_id οι πληροφορίες έχουν ενημερωθεί\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage δεν ισχύει\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' είναι τώρα στη κατάσταση ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list δεν ισχύει\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - - - -if ($format=='debug') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/vicidial.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/vicidial.php deleted file mode 100644 index ee49fb0f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/vicidial.php +++ /dev/null @@ -1,4633 +0,0 @@ - LICENSE: GPLv2 -### -### make sure you have added a user to the vicidial_users MySQL table with at least -### user_level 1 or greater to access this page. Also, you need to have the login -### and pass of a phone listed in the asterisk.phones table. The page grabs the -### server info and other details from this login and pass. -### -### This script works best with Firefox or Mozilla, but will run for a couple -### hours on Internet Explorer before the memory leaks cause a crash. -### -### Other scripts that this application depends on: -### - vdc_db_query.php: Updates information in the database -### - manager_send.php: Sends manager actions to the DB for execution -### -### CHANGES -### 50607-1426 - First Build of VICIDIAL web client basic login process finished -### 50628-1620 - Added some basic formatting and worked on process flow -### 50628-1715 - Startup variables mapped to javascript variables -### 50629-1303 - Added Login Closer in-groups selection box and vla update -### 50629-1530 - Rough layout for customer info form section and button links -### 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -### 50701-1450 - Added vicidial_log entries on dial and hangup -### 50701-1634 - Added Logout function -### 50705-1259 - Added call disposition functionality -### 50705-1432 - Added lead info DB update function -### 50705-1658 - Added web form functionality -### 50706-1043 - Added call park and pickup functions -### 50706-1234 - Added Start/Stop Recording functionality -### 50706-1614 - Added conference channels display option -### 50711-1333 - Removed call check redundancy and fixed a span bug -### 50727-1424 - Added customer channel and participant present sensing/alerts -### 50804-1057 - Added SendDTMF function and reconfigured the transfer span -### 50804-1224 - Added Local and Internal Closer transfer functions -### 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -### 50804-1808 - Added button images for left buttons -### 50815-1151 - Added 3Way calling functions to Transfer-conf frame -### 50815-1602 - Added images and buttons for xfer functions -### 50816-1813 - Added basic autodial outbound call pickup functions -### 50817-1113 - Fixes to auto_dialing call receipt -### 50817-1234 - Added inbound call receipt capability -### 50817-1541 - Added customer time display -### 50817-1541 - Added customer time display -### 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -### 50818-1703 - Added pretty login section -### 50825-1200 - Modified form field lengths, added double-click dispositions -### 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -### 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -### 50903-0904 - Added preview-lead code for manual dialing -### 50904-0016 - Added ability to hangup manual dials before pickup -### 50906-1319 - Added override for filters on xfer calls, fixed login display bug -### 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -### 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -### 50913-1212 - Added campaign_cid to 3rd party calls -### 50923-1546 - Modified to work with language translation -### 50926-1656 - Added campaign pull-down at login of active campaigns -### 50928-1633 - Added manual dial alternate number dial option -### 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -### 51004-1656 - Fixed recording filename bug and new Spanish translation -### 51020-1103 - Added campaign-specific recording control abilities -### 51020-1352 - Added Basic vicidial_agent_log framework -### 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -### 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -### 51110-1432 - Fixed non-standard http port issue -### 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -### 51118-1305 - Activate multi-line comments from $multi_line_comments var -### 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -### 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -### 51129-1010 - Added ability to accept calls from other VICIDIAL servers -### 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -### 51208-1732 - Created user-first login that looks for default phone info -### 51219-1526 - Added variable framework for campaign and in-group scripts -### 51221-1200 - Added SCRIPT tab, layout and functionality -### 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -### 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -### 51229-1028 - Added checks on web_form_address to allow for var in the DB value -### 60117-1312 - Added Transfer-conf frame toggle on button press -### 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -### 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -### 60213-1210 - Added ability to sort routing of calls by user_level -### 60214-0932 - Initial Callback calendar display framework -### 60214-1407 - Added ability to minimize the dispo screen to see info below -### 60215-1104 - Added ANYONE scheduled callbacks functionality -### - -require("dbconnect.php"); - -$DB=$_GET['DB']; if (!$DB) {$DB=$_POST["DB"];} -$phone_login=$_GET['phone_login']; if (!$phone_login) {$phone_login=$_POST["phone_login"];} - if (!$phone_login) {$phone_login=$_GET["pl"];} -$phone_pass=$_GET['phone_pass']; if (!$phone_pass) {$phone_pass=$_POST["phone_pass"];} - if (!$phone_pass) {$phone_pass=$_GET["pp"];} -$VD_login=$_GET['VD_login']; if (!$VD_login) {$VD_login=$_POST["VD_login"];} -$VD_pass=$_GET['VD_pass']; if (!$VD_pass) {$VD_pass=$_POST["VD_pass"];} -$VD_campaign=$_GET['VD_campaign']; if (!$VD_campaign) {$VD_campaign=$_POST["VD_campaign"];} - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); -$relogin=$_GET['relogin']; if (!$relogin) {$relogin=$_POST["relogin"];} - -$forever_stop=0; - -$version = '1.1.66'; -$build = '60215-1104'; - -if ($force_logout) -{ - echo "Έχετε αποσυνδεθεί. Σας ευχαριστούμε\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$manual_dial_preview = '1'; # Allow preview lead option when manual dial -$HKuser_level = '5'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_alt_phone = '1'; # allow manual dial users to call alt phone number -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIΚΛΗΣΗ web client: Επανασύνδεση\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Επανασύνδεση
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIΚΛΗΣΗ web client: Σύνδεση εκστρατείας\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Σύνδεση χρήστη

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση εκστρατείας
 
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIΚΛΗΣΗ web client: Σύνδεση\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIΚΛΗΣΗ web client: Σύνδεση Τηλεφώνου\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Σύνδεση Τηλεφώνου
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Η εκστρατεία είναι μη ενεργή, παρακαλώ προσπαθήστε πάλι
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Η σύνδεση δεν είναι σωστή, παρακαλώ προσπαθήστε πάλι
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIΚΛΗΣΗ web client: Σύνδεση εκστρατείας\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση εκστρατείας
 
Σύνδεση χρήστη:
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIΚΛΗΣΗ web client: Σύνδεση Τηλεφώνου Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Σύνδεση Error
 
Συγγνώμη, αλλά η τηλεφωνική σύνδεση και ο κωδικός πρόσβασής σας δεν είναι ενεργά σε αυτό το σύστημα, παρακαλώ προσπαθήστε πάλι:
 
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIΚΛΗΣΗ web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed Στην this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login Στην phone: $SIP_user στην εκστρατεία: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a ΝΕΟ record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIΚΛΗΣΗ web client: VICIΚΛΗΣΗ Σύνδεση εκστρατείας\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Συγγνώμη, δεν υπάρχουν καθοδηγητές στον hopper για αυτήν την εκστρατεία\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Σύνδεση: \n
"; - echo "Κωδικός πρόσβασης:
\n"; - echo "Εκστρατεία: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIΚΛΗΣΗ web client: VICIΚΛΗΣΗ Σύνδεση εκστρατείας\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Σύνδεση: \n
"; - echo "Κωδικός πρόσβασης:
\n"; - echo "Εκστρατεία: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -ΑΠΟΣΥΝΔΕΣΗ\n"; ?> -
-
- - - - - - - - -
VICIΚΛΗΣΗSCRIPT   LIVE     Ταυτότητα εργασίας: Ενεργή κλήση
-
- - - - -

VICIΚΛΗΣΗ
-
- - - - -
- - Μεταφορά - διάσκεψη
- ΕΣΩΤΕΡΙΚΟΣ CLOSER - ΤΟΠΙΚΟΣ CLOSER - CODE - Κλείσιμο Γραμμής Xfer - Κλείσιμο και τις δύο γραμμές - -
- - Αριθμός για κλήση   - δευτερόλεπτα   - channel - - OVERRIDE   - D1 - D2 -
- - Κλήση με τον πελάτη - Στάθμευση κλήσης πελάτη - ΑΠΟΧΩΡΗΣΗ 3WAY ΚΛΗΣΗΣ - Τυφλή μεταφορά κλήσης - Blind Transfer VMail Message -
-
-
- - - - -
Τερματισμό Καθοδήγησης όπως:

- -
-
-
- - - - - - - -
Πλήκτρα κλειδιά Τερματισμού: - Όταν είναι ενεργό, πιέστε απλά το πλήκτρο κλειδί για τον επιθυμητό τερματισμό της κλήσης. Η κλήση θα τρεματίσει αυτόματα:
- - - - - -
-
- - -
Κανένας δεν είναι στη σύνοδό σας:
- OK -
-
- - -
Ο πελάτης έχει κλείσει το τηλέφωνο:
- OK -
-
- - -

ΑΠΟΣΥΝΔΕΣΗ
-
- - -
-
- - -
 
-
- - -
Οποιεσδήποτε αλλαγές που γίνονται στις πληροφορίες πελατών κατωτέρω αυτή τη στιγμή δεν θα είναι, πρέπει να αλλάξετε τις πληροφορίες πελατών ενώπιον σας Hangup η κλήση.
-
- - -
Τερματισμός Κλήσης :       ελαχιστοποιήστε
- Επιλογή τερματισμού της κλήσης -
- ΤΕΡΜΑΤΙΣΜΟΣ ΚΛΗΣΗΣ
- ΕΠΑΝΑΦΟΡΑ | - ΥΠΟΒΑΛΕΤΕ -



  -
-
- - - -
Επιλέξτε μια ημερομηνία CallBack :
- - - Επιλέξτε μια ημερομηνία κατωτέρω   -     - Hour: -   - Minutes: -   - -  
- - Σχόλια CB:

- - ΥΠΟΒΑΛΕΤΕ

- - -

  -
-
- - -
CLOSER ΕΙΣΕΡΧΟΜΕΝΗ ΕΠΙΛΟΓΗ ΟΜΑΔΑΣ
- Επιλογή Closer εισερχόμενης ομάδας -
- ΣΥΝΔΥΑΣΜΕΝΗ ΚΛΗΣΗ(εξερχόμενες ενεργοποιημένες)
- ΕΠΑΝΑΦΟΡΑ | - ΥΠΟΒΑΛΕΤΕ -



  -
-
- - - - - - - - - - - -
ΜΕΤΑΦΟΡΑ ΕΝΕΡΓΗΣ ΚΛΗΣΗΣ
Κανάλι που μεταφέρεται: Κανάλι
Τηλ.συνδέσεις:
Επιλογές τηλ. συνδέσεων
-
- Στείλε στην επιλεγμένη τηλ.σύνδεση

- Στείλε στο επιλεγμένο vmail

- Στείλε σε αυτόν τον αριθμό:


- ΑΝΑΝΕΩΣΗ


- Επιστροφή στο κύριο παράθυρο

-
Διασκέψεις:
(επιλέξτε έναν αριθμό κατωτέρω που θα σταλεί σε μια διάσκεψη)
Στείλε το κανάλι μου επίσης
Επιλογές διασκέψεων
-
- - - - -
VICIΚΛΗΣΗ SCRIPT
-
- - - - - - - - - - - - - - - - - -
ΚΑΤΑΣΤΑΣΗ:
-
-Κλήση επόμενου αριθμού
- ΠΡΟΒΟΛΗ ΚΑΘΟΔΗΓΗΣΗΣ
";} -if ( ($manual_dial_alt_phone) and ($auto_dial_level==0) ) - {echo " ΚΛΗΣΗ ENAΛ/ΚΟΥ ΤΗΛΕΦΩΝΟΥ
";} - - -?> -ΑΡΧΕΙΟ ΚΑΤΑΓΡΑΦΗΣ:
-
-
-ΤΑΥΤΟΤΗΤΑ ΕΓΓΡΑΦΗΣ:
-
- -Εναρξη καταγραφής
-
-Σελίδα Διαδικτύου
-
-Στάθμευση Κλήσης
-Μεταφορά - διάσκεψη
-
-΄Κλείσιμο Πελάτη
-
-Στείλε DTMF
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
δευτερόλεπτα:   Κανάλι:   Χρόνος Πελάτη:
Πληροφορίες πελατών:
Τίτλος:   Πρώτο:   MI:  Διάρκεια:
Διεύθυνση1:
Διεύθυνση2:   Διεύθυνση3:
Πόλη:   Κράτος:   Ταχ.Κωδ.:
Επαρχία:   Ταυτότητα προμηθευτού:
Τηλέφωνο:   Κωδικός Κλήσης:   Εναλ/κό Τηλέφωνο:
Παρουσίαση:   Ηλεκτρονικό ταχυδρομείο:
Σχόλια:
- -
-


  - -
- - - - -
Έκδοση VICIΚΛΗΣΗ:     ΔΗΜΙΟΥΡΓΙΑ:               Κεντρικός υπολογιστής:              
-Παρουσίαση πληροφοριών κλήσης καναλιού διασκέψης
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -ΠΛΗΚΤΡΑ ΚΛΕΙΔΙΑ ΑΝΕΝΕΡΓΑ - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/voicemail_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/voicemail_check.php deleted file mode 100644 index f7ec9736..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_el/voicemail_check.php +++ /dev/null @@ -1,130 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Ακυρο Χρήστηςname/Κωδικός πρόσβασης: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Έλεγχος φωνητικού ταχυδρομείου"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "Κουτί φωνητικού ταχυδρομείου $vmail_box δεν ισχύει\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/active_list_refresh.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/active_list_refresh.php deleted file mode 100644 index 301e5ed7..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/active_list_refresh.php +++ /dev/null @@ -1,446 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "List Display: "; -if ($ADD==1) {echo "Live Extensions";} -if ($ADD==2) {echo "Busy Extensions";} -if ($ADD==3) {echo "Outside Lines";} -if ($ADD==4) {echo "Local Extensions";} -if ($ADD==5) {echo "Conferences";} -if ($ADD==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/astguiclient.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/astguiclient.php deleted file mode 100644 index 3c67d015..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/astguiclient.php +++ /dev/null @@ -1,2874 +0,0 @@ - 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.9'; -$build = '60112-1622'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "astGUIclient web client: Login\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
User Login:
User Password:
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "astGUIclient web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "astGUIclient web client: Phone Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Phone Login
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "astGUIclient web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
Main PanelActive Lines PanelConferences PanelCheck VoicemailLive Call
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Hangup Trunk   |   - Hijack Trunk   |   - Listen Trunk   |   - Refresh   |   - Back to Main Window -
-
- - -
LOCAL HANGUP

- Active Local Menu
- Hangup Local   |   - Hijack Local   |   - Listen Local   |   - Refresh   |   - Back to Main Window -
-
- - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- Refresh


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - - -
LOCAL Extensions Dial
Phone calling from: Channel
Extensions:
Extensions Menu
-
- Call selected extension

- Call selected vmail box

- Refresh


- Back to Main Window

-
-
- - -
PARKED CALLS:
- Back to Main Window

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NEW:     OLD:             MANUAL DIAL       DIAL
PARKED CALLS: 0                LOCAL DIAL EXTENSIONS
OUTBOUND CALLS:
INBOUND CALLS:
astGUIclient web-client VERSION: BUILD:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITES       edit
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITES

 
SUBMIT FAVORITES CHANGES - requires logout
BACK TO MAIN WINDOW - ignore changes made
-
- -
- - - - - - - - - - - - - -
-PAUSE | START     Refresh rate: 1000 ms Faster | Slower

-
Initializing..
-
Active Extensions
-REFRESH | -ORDER | -
Outside Lines
-REFRESH | -ORDER | -
Local Extensions
-REFRESH | -ORDER | -
- Data Goes Here

-
- Data Goes Here

Trunk Action -
- Data Goes Here

Local Action -
-
- - - - -
- - -Conferences List - - - -
-Click on a conference room number on the left for info on that conference -
- - - - - - - - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/call_log_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/call_log_display.php deleted file mode 100644 index 79187564..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/call_log_display.php +++ /dev/null @@ -1,181 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Call Log Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - - echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; - } - echo "\n"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/conf_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/conf_exten_check.php deleted file mode 100644 index 671d29ba..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/conf_exten_check.php +++ /dev/null @@ -1,213 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Conf Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ChannelA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ChannelA[$counter] ~"; - # echo "$ChannelA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten is not valid or Exten $exten is not valid\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conference $conf_exten has been registered to $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/dbconnect.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/inbound_popup.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/inbound_popup.php deleted file mode 100644 index ec418bce..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/inbound_popup.php +++ /dev/null @@ -1,335 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -LIVE INBOUND CALL"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

LIVE INBOUND CALL

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid is not valid\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Channel: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Channel=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "CUSTOM - \n"; - - echo "
Number Dialed: $row[8]
Notes: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "SEND TO MY VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/live_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/live_exten_check.php deleted file mode 100644 index 7fdd5730..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/live_exten_check.php +++ /dev/null @@ -1,263 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Live Extension Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ChannelA[$loop_count] = "$row[0]"; - $ChannelB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChannelA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChannelB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ChannelA: $ChannelA[$counter] ~"; - echo "ChannelB: $ChannelB[$counter] ~"; - echo "ChannelBtrunk: $ChannelA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/manager_send.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/manager_send.php deleted file mode 100644 index e6887a26..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/manager_send.php +++ /dev/null @@ -1,882 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -### - $queryCID - ('CN012345678901234567',...) -### - $format - ('text','debug') -### - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $exten - ('1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $filename - ('20050406-125623_44444',...) -### - $extenName - ('phone100',...) -### - $parkedby - ('phone100',...) -### - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $auto_dial_level - ('0','1','1.1',...) -### - $campaign - ('CLOSER','TESTCAMP',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('1234',...) -### - $seconds - ('32',...) -### - $outbound_cid - ('3125551212','0000000000',...) -### - $agent_log_id - ('123456',...) -### - $call_server_ip - ('10.10.10.15',...) -### - $CalLCID - ('VD01234567890123456',...) -### - -# changes -# 50401-1002 First build of script, Hangup function only -# 50404-1045 Redirect basic function enabled -# 50406-1522 Monitor basic function enabled -# 50407-1647 Monitor and StopMonitor full functions enabled -# 50422-1120 basic Originate function enabled -# 50428-1451 basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 basic RedirectName and RedirectNameVmail added -# 50503-1227 added session_name checking for extra security -# 50523-1341 added Conference call start/stop recording -# 50523-1421 added OriginateName and OriginateNameVmail for local calls -# 50524-1602 added RedirectToPark and RedirectFromPark -# 50531-1203 added RedirecXtra for dual channel redirection -# 50630-1100 script changed to not use HTTP login vars, user/pass instead -# 50804-1148 Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 Added outbound_cid set if present to originate call -# 51020-1556 Added agent_log_id framework for detailed agent activity logging -# 51118-1204 Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 Added ability to accept calls from other VICIDIAL servers -# 51129-1253 Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### These are variable assignments for PHP globals off -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$queryCID=$_GET["queryCID"]; if (!$queryCID) {$queryCID=$_POST["queryCID"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$filename=$_GET["filename"]; if (!$filename) {$filename=$_POST["filename"];} -$extenName=$_GET["extenName"]; if (!$extenName) {$extenName=$_POST["extenName"];} -$parkedby=$_GET["parkedby"]; if (!$parkedby) {$parkedby=$_POST["parkedby"];} -$extrachannel=$_GET["extrachannel"]; if (!$extrachannel) {$extrachannel=$_POST["extrachannel"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$secondS=$_GET["secondS"]; if (!$secondS) {$secondS=$_POST["secondS"];} -$outbound_cid=$_GET["outbound_cid"]; if (!$outbound_cid) {$outbound_cid=$_POST["outbound_cid"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$call_server_ip=$_GET["call_server_ip"]; if (!$call_server_ip) {$call_server_ip=$_POST["call_server_ip"];} -$CalLCID=$_GET["CalLCID"]; if (!$CalLCID) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!$ACTION) {$ACTION="Originate";} -if (!$format) {$format="alert";} -if (!$ext_priority) {$ext_priority="1";} - - -$version = '0.0.22'; -$build = '60310-2022'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!$query_date) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Manager Send: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "HELP";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nOriginateNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten is not valid or queryCID $queryCID is not valid, Originate command not inserted\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten is not valid or ext_context $ext_context or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid, Hangup command not inserted\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel is not live on $call_server_ip, Checking Live Channel...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup command sent for Channel $channel on $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "auto_dial_level $auto_dial_level must be set\n"; - echo "campaign $campaign must be set\n"; - echo "uniqueid $uniqueid must be set\n"; - echo "lead_id $lead_id must be set\n"; - echo "\nRedirectVD Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "parkedby $parkedby must be set\n"; - echo "\nRedirectToPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectFromPark Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectName Action not sent\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "extenName $extenName must be set\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirectNameVmail Action not sent\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "ExtraChannel $extrachannel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Cannot find empty conference on $server_ip, Redirect command not inserted\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "One of these variables is not valid:\n"; - echo "Channel $channel must be greater than 2 characters\n"; - echo "queryCID $queryCID must be greater than 14 characters\n"; - echo "exten $exten must be set\n"; - echo "ext_context $ext_context must be set\n"; - echo "ext_priority $ext_priority must be set\n"; - echo "\nRedirect Action not sent\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect command sent for Channel $channel on $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or queryCID $queryCID is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Channel $channel is not live on $server_ip, $ACTION command not inserted\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Channel $channel is not valid or exten $exten is not valid or filename: $filename is not valid, $ACTION command not inserted\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going on in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION command sent for Channel $channel on $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n RECORDING WILL LAST UP TO 60 MINUTES\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/park_calls_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/park_calls_display.php deleted file mode 100644 index ce421f53..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/park_calls_display.php +++ /dev/null @@ -1,136 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Parked Calls Display"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten is not valid or protocol $protocol is not valid\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/vdc_db_query.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/vdc_db_query.php deleted file mode 100644 index 7fbc2fd5..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/vdc_db_query.php +++ /dev/null @@ -1,1289 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the meetme conference has live channels connected and which they are -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs') -### - $stage - ('start','finish') -### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -### - $conf_exten - ('8600011',...) -### - $exten - ('123test',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $campaign - ('testcamp',...) -### - $dial_timeout - ('60','26',...) -### - $dial_prefix - ('9','8',...) -### - $campaign_cid - ('3125551212','0000000000',...) -### - $MDnextCID - ('M06301413000000002',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('36524',...) -### - $list_id - ('101','123456',...) -### - $length_in_sec - ('12',...) -### - $phone_code - ('1',...) -### - $phone_number - ('3125551212',...) -### - $channel - ('Zap/12-1',...) -### - $start_epoch - ('1120236911',...) -### - $vendor_lead_code - ('1234test',...) -### - $title - ('Mr.',...) -### - $first_name - ('Bob',...) -### - $middle_initial - ('L',...) -### - $last_name - ('Wilson',...) -### - $address1 - ('1324 Main St.',...) -### - $address2 - ('Apt. 12',...) -### - $address3 - ('co Robert Wilson',...) -### - $city - ('Chicago',...) -### - $state - ('IL',...) -### - $province - ('NA',...) -### - $postal_code - ('60054',...) -### - $country_code - ('USA',...) -### - $gender - ('M',...) -### - $date_of_birth - ('1970-01-01',...) -### - $alt_phone - ('3125551213',...) -### - $email - ('bob@bob.com',...) -### - $security_phrase - ('Hello',...) -### - $comments - ('Good Customer',...) -### - $auto_dial_level - ('0','1','1.2',...) -### - $VDstop_rec_after_each_call - ('0','1') -### - $conf_silent_prefix - ('7','8','',...) -### - $extension - ('123','user123','25-1',...) -### - $protocol - ('Zap','SIP','IAX2',...) -### - $user_abb - ('1234','6666',...) -### - $preview - ('YES','NO',...) -### - $called_count - ('0','1','2',...) -### - $agent_log_id - ('123456',...) -### - $agent_log - ('NO',...) -### - $favorites_list - (",'cc160','cc100'",...) -### - -# changes -# 50629-1044 First build of script -# 50630-1422 Added manual dial action and MD channel lookup -# 50701-1451 Added dial log for start and end of vicidial calls -# 50705-1239 Added call disposition update -# 50804-1627 Fixed updateDispo to update vicidial_log entry -# 50816-1605 Added VDADpause/ready for auto dialing -# 50816-1811 Added basic autodial call pickup functions -# 50817-1005 Altered logging functions to accomodate auto_dialing -# 50818-1305 Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 Added hangup of agent phone after Logout -# 50901-1315 Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 Fixed CLOSER log length_in_sec bug -# 50902-1730 Added functions for manual preview dialing and revert -# 50913-1214 Added agent random update to leadupdate -# 51020-1421 Added agent_log_id framework for detailed agent activity logging -# 51021-1717 Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 Altered echo statements for several small PHP speed optimizations -# 51122-1328 Fixed UserLogout issue not removing conference reservation -# 51129-1012 Added ability to accept calls from other VICIDIAL servers -# 51129-1729 Changed manual dial to use the '/n' flag for calls -# 51221-1154 Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 Added Updating of astguiclient favorites in the DB -# 60208-1617 Added dtmf buttons output per call -# 60213-1521 Added closer_campaigns update to vicidial_users -# 60215-1036 Added Callback date-time entry into vicidial_callbacks table -# - -$version = '0.0.26'; -$build = '60215-1036'; - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$stage=$_GET["stage"]; if (!$stage) {$stage=$_POST["stage"];} -$closer_choice=$_GET["closer_choice"]; if (!$closer_choice) {$closer_choice=$_POST["closer_choice"];} -$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$dial_timeout=$_GET["dial_timeout"]; if (!$dial_timeout) {$dial_timeout=$_POST["dial_timeout"];} -$dial_prefix=$_GET["dial_prefix"]; if (!$dial_prefix) {$dial_prefix=$_POST["dial_prefix"];} -$campaign_cid=$_GET["campaign_cid"]; if (!$campaign_cid) {$campaign_cid=$_POST["campaign_cid"];} -$MDnextCID=$_GET["MDnextCID"]; if (!$MDnextCID) {$MDnextCID=$_POST["MDnextCID"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$list_id=$_GET["list_id"]; if (!$list_id) {$list_id=$_POST["list_id"];} -$length_in_sec=$_GET["length_in_sec"]; if (!$length_in_sec) {$length_in_sec=$_POST["length_in_sec"];} -$phone_code=$_GET["phone_code"]; if (!$phone_code) {$phone_code=$_POST["phone_code"];} -$phone_number=$_GET["phone_number"]; if (!$phone_number) {$phone_number=$_POST["phone_number"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$start_epoch=$_GET["start_epoch"]; if (!$start_epoch) {$start_epoch=$_POST["start_epoch"];} -$dispo_choice=$_GET["dispo_choice"]; if (!$dispo_choice) {$dispo_choice=$_POST["dispo_choice"];} -$vendor_lead_code=$_GET["vendor_lead_code"]; if (!$vendor_lead_code) {$vendor_lead_code=$_POST["vendor_lead_code"];} -$title=$_GET["title"]; if (!$title) {$title=$_POST["title"];} -$first_name=$_GET["first_name"]; if (!$first_name) {$first_name=$_POST["first_name"];} -$middle_initial=$_GET["middle_initial"]; if (!$middle_initial) {$middle_initial=$_POST["middle_initial"];} -$last_name=$_GET["last_name"]; if (!$last_name) {$last_name=$_POST["last_name"];} -$address1=$_GET["address1"]; if (!$address1) {$address1=$_POST["address1"];} -$address2=$_GET["address2"]; if (!$address2) {$address2=$_POST["address2"];} -$address3=$_GET["address3"]; if (!$address3) {$address3=$_POST["address3"];} -$city=$_GET["city"]; if (!$city) {$city=$_POST["city"];} -$state=$_GET["state"]; if (!$state) {$state=$_POST["state"];} -$province=$_GET["province"]; if (!$province) {$province=$_POST["province"];} -$postal_code=$_GET["postal_code"]; if (!$postal_code) {$postal_code=$_POST["postal_code"];} -$country_code=$_GET["country_code"]; if (!$country_code) {$country_code=$_POST["country_code"];} -$gender=$_GET["gender"]; if (!$gender) {$gender=$_POST["gender"];} -$date_of_birth=$_GET["date_of_birth"]; if (!$date_of_birth) {$date_of_birth=$_POST["date_of_birth"];} -$alt_phone=$_GET["alt_phone"]; if (!$alt_phone) {$alt_phone=$_POST["alt_phone"];} -$email=$_GET["email"]; if (!$email) {$email=$_POST["email"];} -$security_phrase=$_GET["security_phrase"]; if (!$security_phrase) {$security_phrase=$_POST["security_phrase"];} -$comments=$_GET["comments"]; if (!$comments) {$comments=$_POST["comments"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"]; if (!$VDstop_rec_after_each_call) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -$conf_silent_prefix=$_GET["conf_silent_prefix"]; if (!$conf_silent_prefix) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];} -$protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];} -$user_abb=$_GET["user_abb"]; if (!$user_abb) {$user_abb=$_POST["user_abb"];} -$preview=$_GET["preview"]; if (!$preview) {$preview=$_POST["preview"];} -$called_count=$_GET["called_count"]; if (!$called_count) {$called_count=$_POST["called_count"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log"];} -$favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];} -$CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -$recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];} - - -# default optional vars if not set -if (!$format) {$format="text";} -if ($format == 'debug') {$DB=1;} -if (!$ACTION) {$ACTION="refresh";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -if (!$query_date) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) -{ -echo "Invalid Username/Password: |$user|$pass|\n"; -exit; -} -else -{ - -if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Database Query Script"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Group Choice $closer_choice is not valid\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Group Choice $closer_choice has been registered to user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "HOPPER EMPTY\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - ##### grab the lead_id of the reserved user in vicidial_hopper - $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - } - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "HOPPER EMPTY\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCALL - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CALL NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context is not valid\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID is not valid\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign is not valid\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inserted: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "LOG NOT ENTERED\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CALL_LOG Inserted: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "LOG NOT ENTERED\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "LOG NOT ENTERED\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id is not valid\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "LOG NOT ENTERED\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campaign $campaign is not valid\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCALL - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCALL - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user on $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten is not valid\n"; - exit; - } -else - { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation on the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CALLBACK ENTRY - if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' has been changed to ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id is not valid\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='$vendor_lead_code', title='$title', first_name='$first_name', middle_initial='$middle_initial', last_name='$last_name', address1='$address1', address2='$address2', address3='$address3', city='$city', state='$state', province='$province', postal_code='$postal_code', country_code='$country_code', gender='$gender', date_of_birth='$date_of_birth', alt_phone='$alt_phone', email='$email', security_phrase='$security_phrase', comments='$comments' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - echo "Lead $lead_id information has been updated\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage is not valid\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' is now in status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list is not valid\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - - - -if ($format=='debug') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/vicidial.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/vicidial.php deleted file mode 100644 index e217b09e..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/vicidial.php +++ /dev/null @@ -1,4633 +0,0 @@ - LICENSE: GPLv2 -### -### make sure you have added a user to the vicidial_users MySQL table with at least -### user_level 1 or greater to access this page. Also, you need to have the login -### and pass of a phone listed in the asterisk.phones table. The page grabs the -### server info and other details from this login and pass. -### -### This script works best with Firefox or Mozilla, but will run for a couple -### hours on Internet Explorer before the memory leaks cause a crash. -### -### Other scripts that this application depends on: -### - vdc_db_query.php: Updates information in the database -### - manager_send.php: Sends manager actions to the DB for execution -### -### CHANGES -### 50607-1426 - First Build of VICIDIAL web client basic login process finished -### 50628-1620 - Added some basic formatting and worked on process flow -### 50628-1715 - Startup variables mapped to javascript variables -### 50629-1303 - Added Login Closer in-groups selection box and vla update -### 50629-1530 - Rough layout for customer info form section and button links -### 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -### 50701-1450 - Added vicidial_log entries on dial and hangup -### 50701-1634 - Added Logout function -### 50705-1259 - Added call disposition functionality -### 50705-1432 - Added lead info DB update function -### 50705-1658 - Added web form functionality -### 50706-1043 - Added call park and pickup functions -### 50706-1234 - Added Start/Stop Recording functionality -### 50706-1614 - Added conference channels display option -### 50711-1333 - Removed call check redundancy and fixed a span bug -### 50727-1424 - Added customer channel and participant present sensing/alerts -### 50804-1057 - Added SendDTMF function and reconfigured the transfer span -### 50804-1224 - Added Local and Internal Closer transfer functions -### 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -### 50804-1808 - Added button images for left buttons -### 50815-1151 - Added 3Way calling functions to Transfer-conf frame -### 50815-1602 - Added images and buttons for xfer functions -### 50816-1813 - Added basic autodial outbound call pickup functions -### 50817-1113 - Fixes to auto_dialing call receipt -### 50817-1234 - Added inbound call receipt capability -### 50817-1541 - Added customer time display -### 50817-1541 - Added customer time display -### 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -### 50818-1703 - Added pretty login section -### 50825-1200 - Modified form field lengths, added double-click dispositions -### 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -### 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -### 50903-0904 - Added preview-lead code for manual dialing -### 50904-0016 - Added ability to hangup manual dials before pickup -### 50906-1319 - Added override for filters on xfer calls, fixed login display bug -### 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -### 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -### 50913-1212 - Added campaign_cid to 3rd party calls -### 50923-1546 - Modified to work with language translation -### 50926-1656 - Added campaign pull-down at login of active campaigns -### 50928-1633 - Added manual dial alternate number dial option -### 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -### 51004-1656 - Fixed recording filename bug and new Spanish translation -### 51020-1103 - Added campaign-specific recording control abilities -### 51020-1352 - Added Basic vicidial_agent_log framework -### 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -### 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -### 51110-1432 - Fixed non-standard http port issue -### 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -### 51118-1305 - Activate multi-line comments from $multi_line_comments var -### 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -### 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -### 51129-1010 - Added ability to accept calls from other VICIDIAL servers -### 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -### 51208-1732 - Created user-first login that looks for default phone info -### 51219-1526 - Added variable framework for campaign and in-group scripts -### 51221-1200 - Added SCRIPT tab, layout and functionality -### 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -### 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -### 51229-1028 - Added checks on web_form_address to allow for var in the DB value -### 60117-1312 - Added Transfer-conf frame toggle on button press -### 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -### 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -### 60213-1210 - Added ability to sort routing of calls by user_level -### 60214-0932 - Initial Callback calendar display framework -### 60214-1407 - Added ability to minimize the dispo screen to see info below -### 60215-1104 - Added ANYONE scheduled callbacks functionality -### - -require("dbconnect.php"); - -$DB=$_GET['DB']; if (!$DB) {$DB=$_POST["DB"];} -$phone_login=$_GET['phone_login']; if (!$phone_login) {$phone_login=$_POST["phone_login"];} - if (!$phone_login) {$phone_login=$_GET["pl"];} -$phone_pass=$_GET['phone_pass']; if (!$phone_pass) {$phone_pass=$_POST["phone_pass"];} - if (!$phone_pass) {$phone_pass=$_GET["pp"];} -$VD_login=$_GET['VD_login']; if (!$VD_login) {$VD_login=$_POST["VD_login"];} -$VD_pass=$_GET['VD_pass']; if (!$VD_pass) {$VD_pass=$_POST["VD_pass"];} -$VD_campaign=$_GET['VD_campaign']; if (!$VD_campaign) {$VD_campaign=$_POST["VD_campaign"];} - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); -$relogin=$_GET['relogin']; if (!$relogin) {$relogin=$_POST["relogin"];} - -$forever_stop=0; - -$version = '1.1.66'; -$build = '60215-1104'; - -if ($force_logout) -{ - echo "You have now logged out. Thank you\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$manual_dial_preview = '1'; # Allow preview lead option when manual dial -$HKuser_level = '5'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_alt_phone = '1'; # allow manual dial users to call alt phone number -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "VICIDIAL web client: Re-Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

User Login

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "VICIDIAL web client: Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login
 
Phone Login:
Phone Password:
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "VICIDIAL web client: Phone Login\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Phone Login
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Campaign not active, please try again
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "Login incorrect, please try again
"; - } - } - if ($VDloginDISPLAY) - { - echo "VICIDIAL web client: Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Campaign Login
 
User Login:
User Password:
Campaign: $camp_form_code

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "VICIDIAL web client: Phone Login Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Login Error
 
Sorry, your phone login and password are not active in this system, please try again:
 
Phone Login:
Phone Password:

VERSION: $version       BUILD: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "VICIDIAL web client\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed on this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login on phone: $SIP_user to campaign: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NEW record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Sorry, there are no leads in the hopper for this campaign\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Login: \n
"; - echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -LOGOUT\n"; ?> -
-
- - - - - - - - -
VICIDIALSCRIPT   LIVE     session ID: Live Call
-
- - - - -

VICIDIAL
-
- - - - -
- - Transfer - Conference
- INTERNAL CLOSER - LOCAL CLOSER - CODE - Hangup Xfer Line - Hangup Both Lines - -
- - Number to call   - seconds   - channel - - OVERRIDE   - D1 - D2 -
- - Dial With Customer - Park Customer Dial - LEAVE 3-WAY CALL - Dial Blind Transfer - Blind Transfer VMail Message -
-
-
- - - - -
Lead Dispositioned As:

- -
-
-
- - - - - - - -
Disposition Hot Keys: - When active, simply press the keyboard key for the desired disposition for this call. The call will then be hungup and dispositioned automatically:
- - - - - -
-
- - -
Noone is in your session:
- OK -
-
- - -
Customer has hung up:
- OK -
-
- - -

LOGOUT
-
- - -
-
- - -
 
-
- - -
Any changes made to the customer information below at this time will not be comitted, You must change customer information before you Hangup the call.
-
- - -
DISPOSITION CALL :       minimize
- End-of-call Disposition Selection -
- STOP CALLING
- RESET | - SUBMIT -



  -
-
- - - -
Select a CallBack Date :
- - - Select a Date Below   -     - Hour: -   - Minutes: -   - -  
- - CB Comments:

- - SUBMIT

- - -

  -
-
- - -
CLOSER INBOUND GROUP SELECTION
- Closer Inbound Group Selection -
- BLENDED CALLING(outbound activated)
- RESET | - SUBMIT -



  -
-
- - - - - - - - - - - -
LIVE CALL TRANSFER
Channel to be transferred: Channel
Extensions:
Extensions Menu
-
- Send to selected extension

- Send to selected vmail box

- Send to this number:


- REFRESH


- Back to Main Window

-
Conferences:
(click on a number below to send to a conference)
Send my channel too
Conferences Menu
-
- - - - -
VICIDIAL SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Dial Next Number
- LEAD PREVIEW
";} -if ( ($manual_dial_alt_phone) and ($auto_dial_level==0) ) - {echo " ALT PHONE DIAL
";} - - -?> -RECORDING FILE:
-
-
-RECORD ID:
-
- -Start Recording
-
-Web Form
-
-Park Call
-Transfer - Conference
-
-Hangup Customer
-
-Send DTMF
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
seconds:   Channel:   Cust Time:
Customer Information:
Title:   First:   MI:   Last:
Address1:
Address2:   Address3:
City:   State:   PostCode:
Province:   Vendor ID:
Phone:   DialCode:   Alt. Phone:
Show:   Email:
Comments:
- -
-


  - -
- - - - -
VICIDIAL web-client version:     BUILD:               Server:              
-Show conference call channel information
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HOT KEYS INACTIVE - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/voicemail_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/voicemail_check.php deleted file mode 100644 index eb01d84b..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_en/voicemail_check.php +++ /dev/null @@ -1,130 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Invalid Username/Password: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Invalid session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Voicemail Check"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "voicemail box $vmail_box is not valid\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/active_list_refresh.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/active_list_refresh.php deleted file mode 100644 index be5b78fa..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/active_list_refresh.php +++ /dev/null @@ -1,446 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuarioname/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Mostrar Listas: "; -if ($ADD==1) {echo "Extensiones Activas";} -if ($ADD==2) {echo "Extensiones Ocupadas";} -if ($ADD==3) {echo "Líneas de salida";} -if ($ADD==4) {echo "Extensiones Locales";} -if ($ADD==5) {echo "Conferencias";} -if ($ADD==99999) {echo "AYUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/astguiclient.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/astguiclient.php deleted file mode 100644 index 790f7cf8..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/astguiclient.php +++ /dev/null @@ -1,2874 +0,0 @@ - 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.9'; -$build = '60112-1622'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Usted ahora ha registrado hacia fuera. Gracias\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "web client astGUIclient: Conexión\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión
 
Conexión Del Usuario:
Contraseña Del Usuario:
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client astGUIclient: Conexión Del Teléfono\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conexión Del Teléfono
 
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client astGUIclient: Conexión Del Teléfono\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión Del Teléfono
 
Disculpe, la conexión del teléfono y contraseña no están activos en este sistema, intentelo otra vez por favor:
 
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client astGUIclient\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -SALIR
\n"; ?> -
Pantalla PrincipalPantalla Lineas ActivasPantalla de ConferenciasComprobar buzón de vozLlamada Activa
-
- - -

Logout
-
- - -
TRUNK COLGAR

- Active Trunks Menu
- Colgar Trunk   |   - Capturar Trunk   |   - Escuchar Trunk   |   - Recarga   |   - Volver a la pantalla principal -
-
- - -
Colgar Local

- Menú Local Activa
- Colgar Local   |   - Capturar Local   |   - Escuchar Local   |   - Recarga   |   - Volver a la pantalla principal -
-
- - - - - - - -
TRANSFERIR LLAMADA ACTIVA
Canal que va a ser transferido: Canal
Extensiones:
Menú Extensiones
-
- Envíe a la extensión seleccionada

- Enviar al buzón de voz seleccionada

- Envíe a este número:


- Recarga


- Volver a la pantalla principal

-
Conferencias:
(Pinchar en un número de abajo para enviar a una conferencia)
Enviar mi canal también
Menú de Conferencias
-
- - - - - -
Marcar a Extensiones LOCALES
Teléfono llamando desde: Canal
Extensiones:
Menú Extensiones
-
- Llamar extensión seleccionada

- Llamar buzón de voz seleccionado

- Recarga


- Volver a la pantalla principal

-
-
- - -
LLAMADAS APARCADAS:
- Volver a la pantalla principal

-
-
- - - - - - - - - - - - - - - -
  -
BUZÓN DE VOZ     NUEVO:     VIEJO:             MARCADO MANUAL       DIAL
LLAMADAS APARCADAS: 0                MARCAR EXTENSIONES LOCALES
LLAMADAS SALIENTES:
LLAMADAS ENTRANTES:
versión astGUIclient del tela-cliente: CONSTRUCCION:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITOS       corrija
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITOS

 
ENVIAR FAVORITOS CHANGES - requires logout
DE NUEVO A VENTANA PRINCIPAL - no haga caso de los cambios realizados
-
- -
- - - - - - - - - - - - - -
-PAUSA | COMIENZO     Actualizar la tarifa: 1000 ms Más rápido | Más lento

-
Inizializando..
-
Extensiones Activas
-ACTUALIZAR | -ORDEN | -
Líneas de salida
-ACTUALIZAR | -ORDEN | -
Extensiones Locales
-ACTUALIZAR | -ORDEN | -
- Los Datos Van Aquí

-
- Los Datos Van Aquí

Acciones en Trunk -
- Los Datos Van Aquí

Acción Local -
-
- - - - -
- - -Lista De las Conferencias - - - -
-Pinchar a la izquierda del número de una sala de conferencias para obtener información -
- - - - - - - - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/call_log_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/call_log_display.php deleted file mode 100644 index 9cb9298e..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/call_log_display.php +++ /dev/null @@ -1,181 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuarioname/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Motrar el registro de llamadas"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten No es válido o protocolo $protocol No es válido\n"; - exit; - } - else - { - ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - - echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; - } - echo "\n"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/conf_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/conf_exten_check.php deleted file mode 100644 index 00c15bda..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/conf_exten_check.php +++ /dev/null @@ -1,213 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuarioname/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Comprobar la Extensión de Conf"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten No es válido\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanalA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanalA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$CanalA[$counter] ~"; - # echo "$CanalA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten No es válido or Exten $exten No es válido\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conferencia $conf_exten Ha sido registrado para $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/dbconnect.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/inbound_popup.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/inbound_popup.php deleted file mode 100644 index 8363b57e..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/inbound_popup.php +++ /dev/null @@ -1,335 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuarioname/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -LLAMADA DE ENTRADA ACTIVA"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

LLAMADA DE ENTRADA ACTIVA

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid No es válido\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Canal: $row[1]
LlamadorID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Canal=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "A MEDIDA - \n"; - - echo "
Número Marcado: $row[8]
Notas: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "COLGAR - \n"; - echo "ENVIAR A MI BUZÓN DE VOZ\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/live_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/live_exten_check.php deleted file mode 100644 index 179a4be4..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/live_exten_check.php +++ /dev/null @@ -1,263 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuarioname/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Comprobar Extensión Activa"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten No es válido o protocolo $protocol No es válido\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $CanalA[$loop_count] = "$row[0]"; - $CanalB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$CanalA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$CanalA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$CanalB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$CanalB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "CanalA: $CanalA[$counter] ~"; - echo "CanalB: $CanalB[$counter] ~"; - echo "CanalBtrunk: $CanalA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/manager_send.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/manager_send.php deleted file mode 100644 index 55d65ef6..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/manager_send.php +++ /dev/null @@ -1,882 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -### - $queryCID - ('CN012345678901234567',...) -### - $format - ('text','debug') -### - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $exten - ('1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $filename - ('20050406-125623_44444',...) -### - $extenName - ('phone100',...) -### - $parkedby - ('phone100',...) -### - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $auto_dial_level - ('0','1','1.1',...) -### - $campaign - ('CLOSER','TESTCAMP',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('1234',...) -### - $seconds - ('32',...) -### - $outbound_cid - ('3125551212','0000000000',...) -### - $agent_log_id - ('123456',...) -### - $call_server_ip - ('10.10.10.15',...) -### - $CalLCID - ('VD01234567890123456',...) -### - -# changes -# 50401-1002 First build of script, Hangup function only -# 50404-1045 Redirect basic function enabled -# 50406-1522 Monitor basic function enabled -# 50407-1647 Monitor and StopMonitor full functions enabled -# 50422-1120 basic Originate function enabled -# 50428-1451 basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 basic RedirectName and RedirectNameVmail added -# 50503-1227 added session_name checking for extra security -# 50523-1341 added Conference call start/stop recording -# 50523-1421 added OriginateName and OriginateNameVmail for local calls -# 50524-1602 added RedirectToPark and RedirectFromPark -# 50531-1203 added RedirecXtra for dual channel redirection -# 50630-1100 script changed to not use HTTP login vars, user/pass instead -# 50804-1148 Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 Added outbound_cid set if present to originate call -# 51020-1556 Added agent_log_id framework for detailed agent activity logging -# 51118-1204 Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 Added ability to accept calls from other VICIDIAL servers -# 51129-1253 Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### These are variable assignments for PHP globals off -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$queryCID=$_GET["queryCID"]; if (!$queryCID) {$queryCID=$_POST["queryCID"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$filename=$_GET["filename"]; if (!$filename) {$filename=$_POST["filename"];} -$extenName=$_GET["extenName"]; if (!$extenName) {$extenName=$_POST["extenName"];} -$parkedby=$_GET["parkedby"]; if (!$parkedby) {$parkedby=$_POST["parkedby"];} -$extrachannel=$_GET["extrachannel"]; if (!$extrachannel) {$extrachannel=$_POST["extrachannel"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$secondS=$_GET["secondS"]; if (!$secondS) {$secondS=$_POST["secondS"];} -$outbound_cid=$_GET["outbound_cid"]; if (!$outbound_cid) {$outbound_cid=$_POST["outbound_cid"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$call_server_ip=$_GET["call_server_ip"]; if (!$call_server_ip) {$call_server_ip=$_POST["call_server_ip"];} -$CalLCID=$_GET["CalLCID"]; if (!$CalLCID) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!$ACTION) {$ACTION="Originate";} -if (!$format) {$format="alert";} -if (!$ext_priority) {$ext_priority="1";} - - -$version = '0.0.22'; -$build = '60310-2022'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!$query_date) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuarioname/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Enviar al Manager: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "AYUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten No es válido or queryCID $queryCID No es válido, Originate comando no insertado\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando enviado a Exten $exten Canal $channel en $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nOriginateName Action no enviado\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nOriginateNameVmail Action no enviado\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten No es válido or queryCID $queryCID No es válido, Originate comando no insertado\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando enviado a Exten $exten Canal $channel en $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten No es válido or ext_context $ext_context or queryCID $queryCID No es válido, Hangup comando no insertado\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Canal $channel No es válido or queryCID $queryCID No es válido, Hangup comando no insertado\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel no está activo en $call_server_ip, Checking Live Canal...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Canal $channel no está activo en $call_server_ip, Hangup comando no insertado $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup comando enviado a Canal $channel en $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "auto_dial_level $auto_dial_level debe ser fijado\n"; - echo "campaign $campaign debe ser fijado\n"; - echo "uniqueid $uniqueid debe ser fijado\n"; - echo "lead_id $lead_id debe ser fijado\n"; - echo "\nRedirectVD Action no enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='TRANSFERENCIA' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='TRANSFERENCIA' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "parkedby $parkedby debe ser fijado\n"; - echo "\nRedirectToPark Action no enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirectFromPark Action no enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirectName Action no enviado\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "extenName $extenName debe ser fijado\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirectNameVmail Action no enviado\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "ExtraCanal $extrachannel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirect Action no enviado\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "No puede encontrar conferencia vacía en $server_ip, Redirect comando no insertado\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Canal $channel no está activo en $call_server_ip, Redirect comando no insertado\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Canal $channel no está activo en $server_ip, Redirect comando no insertado\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando enviado a Canal $channel and \nExtraCanal $extrachannel\n to $exten en $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando enviado a Canal $channel en $call_server_ip and \nExtraCanal $extrachannel\n to $exten en $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una de estas variables No es válido:\n"; - echo "Canal $channel debe ser mayor de 2 caracteres\n"; - echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; - echo "exten $exten debe ser fijado\n"; - echo "ext_context $ext_context debe ser fijado\n"; - echo "ext_priority $ext_priority debe ser fijado\n"; - echo "\nRedirect Action no enviado\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canal $channel no está activo en $server_ip, Redirect comando no insertado\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect comando enviado a Canal $channel en $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canal $channel No es válido or queryCID $queryCID No es válido or filename: $filename No es válido, $ACTION comando no insertado\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canal $channel no está activo en $server_ip, $ACTION comando no insertado\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION comando enviado a Canal $channel en $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canal $channel No es válido or exten $exten No es válido or filename: $filename No es válido, $ACTION comando no insertado\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going en in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION comando enviado a Canal $channel en $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n LA GRABACIÓN DURARÁ HASTA 60 MINUTOS\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/park_calls_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/park_calls_display.php deleted file mode 100644 index 27973705..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/park_calls_display.php +++ /dev/null @@ -1,136 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuarioname/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Mostrar Llamadas Aparcadas"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten No es válido o protocolo $protocol No es válido\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/vdc_db_query.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/vdc_db_query.php deleted file mode 100644 index b6d8e241..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/vdc_db_query.php +++ /dev/null @@ -1,1289 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the meetme conference has live channels connected and which they are -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs') -### - $stage - ('start','finish') -### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -### - $conf_exten - ('8600011',...) -### - $exten - ('123test',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $campaign - ('testcamp',...) -### - $dial_timeout - ('60','26',...) -### - $dial_prefix - ('9','8',...) -### - $campaign_cid - ('3125551212','0000000000',...) -### - $MDnextCID - ('M06301413000000002',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('36524',...) -### - $list_id - ('101','123456',...) -### - $length_in_sec - ('12',...) -### - $phone_code - ('1',...) -### - $phone_number - ('3125551212',...) -### - $channel - ('Zap/12-1',...) -### - $start_epoch - ('1120236911',...) -### - $vendor_lead_code - ('1234test',...) -### - $title - ('Mr.',...) -### - $first_name - ('Bob',...) -### - $middle_initial - ('L',...) -### - $last_name - ('Wilson',...) -### - $address1 - ('1324 Main St.',...) -### - $address2 - ('Apt. 12',...) -### - $address3 - ('co Robert Wilson',...) -### - $city - ('Chicago',...) -### - $state - ('IL',...) -### - $province - ('NA',...) -### - $postal_code - ('60054',...) -### - $country_code - ('USA',...) -### - $gender - ('M',...) -### - $date_of_birth - ('1970-01-01',...) -### - $alt_phone - ('3125551213',...) -### - $email - ('bob@bob.com',...) -### - $security_phrase - ('Hello',...) -### - $comments - ('Good Customer',...) -### - $auto_dial_level - ('0','1','1.2',...) -### - $VDstop_rec_after_each_call - ('0','1') -### - $conf_silent_prefix - ('7','8','',...) -### - $extension - ('123','user123','25-1',...) -### - $protocol - ('Zap','SIP','IAX2',...) -### - $user_abb - ('1234','6666',...) -### - $preview - ('YES','NO',...) -### - $called_count - ('0','1','2',...) -### - $agent_log_id - ('123456',...) -### - $agent_log - ('NO',...) -### - $favorites_list - (",'cc160','cc100'",...) -### - -# changes -# 50629-1044 First build of script -# 50630-1422 Added manual dial action and MD channel lookup -# 50701-1451 Added dial log for start and end of vicidial calls -# 50705-1239 Added call disposition update -# 50804-1627 Fixed updateDispo to update vicidial_log entry -# 50816-1605 Added VDADpause/ready for auto dialing -# 50816-1811 Added basic autodial call pickup functions -# 50817-1005 Altered logging functions to accomodate auto_dialing -# 50818-1305 Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 Added hangup of agent phone after Logout -# 50901-1315 Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 Fixed CLOSER log length_in_sec bug -# 50902-1730 Added functions for manual preview dialing and revert -# 50913-1214 Added agent random update to leadupdate -# 51020-1421 Added agent_log_id framework for detailed agent activity logging -# 51021-1717 Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 Altered echo statements for several small PHP speed optimizations -# 51122-1328 Fixed UserLogout issue not removing conference reservation -# 51129-1012 Added ability to accept calls from other VICIDIAL servers -# 51129-1729 Changed manual dial to use the '/n' flag for calls -# 51221-1154 Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 Added Updating of astguiclient favorites in the DB -# 60208-1617 Added dtmf buttons output per call -# 60213-1521 Added closer_campaigns update to vicidial_users -# 60215-1036 Added Callback date-time entry into vicidial_callbacks table -# - -$version = '0.0.26'; -$build = '60215-1036'; - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$stage=$_GET["stage"]; if (!$stage) {$stage=$_POST["stage"];} -$closer_choice=$_GET["closer_choice"]; if (!$closer_choice) {$closer_choice=$_POST["closer_choice"];} -$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$dial_timeout=$_GET["dial_timeout"]; if (!$dial_timeout) {$dial_timeout=$_POST["dial_timeout"];} -$dial_prefix=$_GET["dial_prefix"]; if (!$dial_prefix) {$dial_prefix=$_POST["dial_prefix"];} -$campaign_cid=$_GET["campaign_cid"]; if (!$campaign_cid) {$campaign_cid=$_POST["campaign_cid"];} -$MDnextCID=$_GET["MDnextCID"]; if (!$MDnextCID) {$MDnextCID=$_POST["MDnextCID"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$list_id=$_GET["list_id"]; if (!$list_id) {$list_id=$_POST["list_id"];} -$length_in_sec=$_GET["length_in_sec"]; if (!$length_in_sec) {$length_in_sec=$_POST["length_in_sec"];} -$phone_code=$_GET["phone_code"]; if (!$phone_code) {$phone_code=$_POST["phone_code"];} -$phone_number=$_GET["phone_number"]; if (!$phone_number) {$phone_number=$_POST["phone_number"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$start_epoch=$_GET["start_epoch"]; if (!$start_epoch) {$start_epoch=$_POST["start_epoch"];} -$dispo_choice=$_GET["dispo_choice"]; if (!$dispo_choice) {$dispo_choice=$_POST["dispo_choice"];} -$vendor_lead_code=$_GET["vendor_lead_code"]; if (!$vendor_lead_code) {$vendor_lead_code=$_POST["vendor_lead_code"];} -$title=$_GET["title"]; if (!$title) {$title=$_POST["title"];} -$first_name=$_GET["first_name"]; if (!$first_name) {$first_name=$_POST["first_name"];} -$middle_initial=$_GET["middle_initial"]; if (!$middle_initial) {$middle_initial=$_POST["middle_initial"];} -$last_name=$_GET["last_name"]; if (!$last_name) {$last_name=$_POST["last_name"];} -$address1=$_GET["address1"]; if (!$address1) {$address1=$_POST["address1"];} -$address2=$_GET["address2"]; if (!$address2) {$address2=$_POST["address2"];} -$address3=$_GET["address3"]; if (!$address3) {$address3=$_POST["address3"];} -$city=$_GET["city"]; if (!$city) {$city=$_POST["city"];} -$state=$_GET["state"]; if (!$state) {$state=$_POST["state"];} -$province=$_GET["province"]; if (!$province) {$province=$_POST["province"];} -$postal_code=$_GET["postal_code"]; if (!$postal_code) {$postal_code=$_POST["postal_code"];} -$country_code=$_GET["country_code"]; if (!$country_code) {$country_code=$_POST["country_code"];} -$gender=$_GET["gender"]; if (!$gender) {$gender=$_POST["gender"];} -$date_of_birth=$_GET["date_of_birth"]; if (!$date_of_birth) {$date_of_birth=$_POST["date_of_birth"];} -$alt_phone=$_GET["alt_phone"]; if (!$alt_phone) {$alt_phone=$_POST["alt_phone"];} -$email=$_GET["email"]; if (!$email) {$email=$_POST["email"];} -$security_phrase=$_GET["security_phrase"]; if (!$security_phrase) {$security_phrase=$_POST["security_phrase"];} -$comments=$_GET["comments"]; if (!$comments) {$comments=$_POST["comments"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"]; if (!$VDstop_rec_after_each_call) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -$conf_silent_prefix=$_GET["conf_silent_prefix"]; if (!$conf_silent_prefix) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];} -$protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];} -$user_abb=$_GET["user_abb"]; if (!$user_abb) {$user_abb=$_POST["user_abb"];} -$preview=$_GET["preview"]; if (!$preview) {$preview=$_POST["preview"];} -$called_count=$_GET["called_count"]; if (!$called_count) {$called_count=$_POST["called_count"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log"];} -$favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];} -$CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -$recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];} - - -# default optional vars if not set -if (!$format) {$format="text";} -if ($format == 'debug') {$DB=1;} -if (!$ACTION) {$ACTION="refresh";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -if (!$query_date) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) -{ -echo "Inválido Usuarioname/Contraseña: |$user|$pass|\n"; -exit; -} -else -{ - -if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Database Query Script"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Opción Del Grupo $closer_choice No es válido\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Opción Del Grupo $closer_choice Ha sido registrado para user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "TOLVA VACÍA\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context No es válido\n"; - exit; - } - else - { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - ##### grab the lead_id of the reserved user in vicidial_hopper - $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - } - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INLLAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "TOLVA VACÍA\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context No es válido\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INLLAMADA - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LLAMADA NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context No es válido\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID No es válido\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "REGISTRO NO ENTRADO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign No es válido\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Insertado: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "REGISTRO NO ENTRADO\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "LLAMADA_LOG Insertado: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "REGISTRO NO ENTRADO\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "REGISTRO NO ENTRADO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id No es válido\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "REGISTRO NO ENTRADO\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campaña $campaign No es válido\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INLLAMADA in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INLLAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INLLAMADA - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INLLAMADA - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send en to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user en $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten No es válido\n"; - exit; - } -else - { - ##### Insert a SALIR record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','SALIR','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation en the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id No es válido\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### LLAMADABACK ENTRY - if ( ($dispo_choice == 'CBHVIEJO') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' se ha cambiado a ' . $dispo_choice . " Estado\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id No es válido\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='$vendor_lead_code', title='$title', first_name='$first_name', middle_initial='$middle_initial', last_name='$last_name', address1='$address1', address2='$address2', address3='$address3', city='$city', state='$state', province='$province', postal_code='$postal_code', country_code='$country_code', gender='$gender', date_of_birth='$date_of_birth', alt_phone='$alt_phone', email='$email', security_phrase='$security_phrase', comments='$comments' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - echo "Lead $lead_id La información ha sido actualizada\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage No es válido\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' ahora está en estado ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list No es válido\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - - - -if ($format=='debug') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/vicidial.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/vicidial.php deleted file mode 100644 index 55c738d9..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/vicidial.php +++ /dev/null @@ -1,4633 +0,0 @@ - LICENSE: GPLv2 -### -### make sure you have added a user to the vicidial_users MySQL table with at least -### user_level 1 or greater to access this page. Also, you need to have the login -### and pass of a phone listed in the asterisk.phones table. The page grabs the -### server info and other details from this login and pass. -### -### This script works best with Firefox or Mozilla, but will run for a couple -### hours on Internet Explorer before the memory leaks cause a crash. -### -### Other scripts that this application depends on: -### - vdc_db_query.php: Updates information in the database -### - manager_send.php: Sends manager actions to the DB for execution -### -### CHANGES -### 50607-1426 - First Build of VICIDIAL web client basic login process finished -### 50628-1620 - Added some basic formatting and worked on process flow -### 50628-1715 - Startup variables mapped to javascript variables -### 50629-1303 - Added Login Closer in-groups selection box and vla update -### 50629-1530 - Rough layout for customer info form section and button links -### 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -### 50701-1450 - Added vicidial_log entries on dial and hangup -### 50701-1634 - Added Logout function -### 50705-1259 - Added call disposition functionality -### 50705-1432 - Added lead info DB update function -### 50705-1658 - Added web form functionality -### 50706-1043 - Added call park and pickup functions -### 50706-1234 - Added Start/Stop Recording functionality -### 50706-1614 - Added conference channels display option -### 50711-1333 - Removed call check redundancy and fixed a span bug -### 50727-1424 - Added customer channel and participant present sensing/alerts -### 50804-1057 - Added SendDTMF function and reconfigured the transfer span -### 50804-1224 - Added Local and Internal Closer transfer functions -### 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -### 50804-1808 - Added button images for left buttons -### 50815-1151 - Added 3Way calling functions to Transfer-conf frame -### 50815-1602 - Added images and buttons for xfer functions -### 50816-1813 - Added basic autodial outbound call pickup functions -### 50817-1113 - Fixes to auto_dialing call receipt -### 50817-1234 - Added inbound call receipt capability -### 50817-1541 - Added customer time display -### 50817-1541 - Added customer time display -### 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -### 50818-1703 - Added pretty login section -### 50825-1200 - Modified form field lengths, added double-click dispositions -### 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -### 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -### 50903-0904 - Added preview-lead code for manual dialing -### 50904-0016 - Added ability to hangup manual dials before pickup -### 50906-1319 - Added override for filters on xfer calls, fixed login display bug -### 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -### 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -### 50913-1212 - Added campaign_cid to 3rd party calls -### 50923-1546 - Modified to work with language translation -### 50926-1656 - Added campaign pull-down at login of active campaigns -### 50928-1633 - Added manual dial alternate number dial option -### 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -### 51004-1656 - Fixed recording filename bug and new Spanish translation -### 51020-1103 - Added campaign-specific recording control abilities -### 51020-1352 - Added Basic vicidial_agent_log framework -### 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -### 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -### 51110-1432 - Fixed non-standard http port issue -### 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -### 51118-1305 - Activate multi-line comments from $multi_line_comments var -### 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -### 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -### 51129-1010 - Added ability to accept calls from other VICIDIAL servers -### 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -### 51208-1732 - Created user-first login that looks for default phone info -### 51219-1526 - Added variable framework for campaign and in-group scripts -### 51221-1200 - Added SCRIPT tab, layout and functionality -### 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -### 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -### 51229-1028 - Added checks on web_form_address to allow for var in the DB value -### 60117-1312 - Added Transfer-conf frame toggle on button press -### 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -### 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -### 60213-1210 - Added ability to sort routing of calls by user_level -### 60214-0932 - Initial Callback calendar display framework -### 60214-1407 - Added ability to minimize the dispo screen to see info below -### 60215-1104 - Added ANYONE scheduled callbacks functionality -### - -require("dbconnect.php"); - -$DB=$_GET['DB']; if (!$DB) {$DB=$_POST["DB"];} -$phone_login=$_GET['phone_login']; if (!$phone_login) {$phone_login=$_POST["phone_login"];} - if (!$phone_login) {$phone_login=$_GET["pl"];} -$phone_pass=$_GET['phone_pass']; if (!$phone_pass) {$phone_pass=$_POST["phone_pass"];} - if (!$phone_pass) {$phone_pass=$_GET["pp"];} -$VD_login=$_GET['VD_login']; if (!$VD_login) {$VD_login=$_POST["VD_login"];} -$VD_pass=$_GET['VD_pass']; if (!$VD_pass) {$VD_pass=$_POST["VD_pass"];} -$VD_campaign=$_GET['VD_campaign']; if (!$VD_campaign) {$VD_campaign=$_POST["VD_campaign"];} - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); -$relogin=$_GET['relogin']; if (!$relogin) {$relogin=$_POST["relogin"];} - -$forever_stop=0; - -$version = '1.1.66'; -$build = '60215-1104'; - -if ($force_logout) -{ - echo "Usted ahora ha registrado hacia fuera. Gracias\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$manual_dial_preview = '1'; # Allow preview lead option when manual dial -$HKuser_level = '5'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_alt_phone = '1'; # allow manual dial users to call alt phone number -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "web client VICIDIAL: Conexión Otra Vez\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conexión Otra Vez
 
Conexión Del Teléfono:
Contraseña Del Teléfono:
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code

VERSIÓN: $version       CONSTRUCCION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "web client VICIDIAL: Conexión en la Campaña\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Conexión Del Usuario

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión en la Campaña
 
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "web client VICIDIAL: Conexión\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión
 
Conexión Del Teléfono:
Contraseña Del Teléfono:
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client VICIDIAL: Conexión Del Teléfono\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Conexión Del Teléfono
 
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "La campaña no está activa, intentelo otra vez, por favor
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "La conexión incorrecta, intentelo otra vez, por favor
"; - } - } - if ($VDloginDISPLAY) - { - echo "web client VICIDIAL: Conexión en la Campaña\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión en la Campaña
 
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client VICIDIAL: Conexión Del Teléfono Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión Error
 
Disculpe, la conexión del teléfono y contraseña no están activos en este sistema, intentelo otra vez por favor:
 
Conexión Del Teléfono:
Contraseña Del Teléfono:

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client VICIDIAL\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $LlamadorID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed en this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login en phone: $SIP_user a la campaña: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NUEVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "web client VICIDIAL: VICIDIAL Conexión en la Campaña\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Lo siento, no hay leads en el hopper de esta campaña\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Conexión: \n
"; - echo "Contraseña:
\n"; - echo "Campaña: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "web client VICIDIAL: VICIDIAL Conexión en la Campaña\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Conexión: \n
"; - echo "Contraseña:
\n"; - echo "Campaña: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -SALIR\n"; ?> -
-
- - - - - - - - -
VICIDIALSCRIPT   LIVE     sesión ID: Llamada Activa
-
- - - - -

VICIDIAL
-
- - - - -
- - Transferencia - Conferencia
- CLOSER INTERNO - CLOSER LOCAL - CODE - Colgar Línea Xfer - Colgar Ambas Líneas - -
- - Número a llamar   - segundos   - channel - - OVERRIDE   - D1 - D2 -
- - Marcar Con El Cliente - Dial Del Cliente Del Parque - ABANDONAR LLAMADA 3-WAY - Marcar Blind Transfer - Blind Transfer VMail Message -
-
-
- - - - -
Lead Dispositioned Como:

- -
-
-
- - - - - - - -
Teclas de acceso rápido a la Disposición: - Cuando esté activo, presione simplemente la tecla para la disposición deseada para esta llamada. La llamada después será colgada y dispositioned automáticamente:
- - - - - -
-
- - -
Nadie está en su sesión:
- OK -
-
- - -
El cliente ha colgado:
- OK -
-
- - -

SALIR
-
- - -
-
- - -
 
-
- - -
Cualquier cambio realizado al cliente que no será la información abajo en este tiempo comitted, usted debe cambiar la información del cliente antes de usted retraso la llamada.
-
- - -
DISPOSITION LLAMADA :       reduzca al mínimo
- selección de la disposición del End-of-call -
- PARAR LA LLAMADA
- REINICIAR | - ENVIAR -



  -
-
- - - -
Seleccione una fecha del servicio repetido :
- - - Seleccione una fecha abajo   -     - Hour: -   - Minutes: -   - -  
- - Comentarios de los CBES:

- - ENVIAR

- - -

  -
-
- - -
SELECCIÓN DEL GRUPO DE ENTRANTES CLOSER
- SELECCIÓN DEL GRUPO DE ENTRANTES CLOSER -
- BLENDED LLAMADAING(Salientes activdas)
- REINICIAR | - ENVIAR -



  -
-
- - - - - - - - - - - -
TRANSFERIR LLAMADA ACTIVA
Canal que va a ser transferido: Canal
Extensiones:
Menú Extensiones
-
- Envíe a la extensión seleccionada

- Enviar al buzón de voz seleccionada

- Envíe a este número:


- ACTUALIZAR


- Volver a la pantalla principal

-
Conferencias:
(Pinchar en un número de abajo para enviar a una conferencia)
Enviar mi canal también
Menú de Conferencias
-
- - - - -
VICIDIAL SCRIPT
-
- - - - - - - - - - - - - - - - - -
ESTADO:
-
-Marcar el Siguiente Número
- MOSTRAR LEAD
";} -if ( ($manual_dial_alt_phone) and ($auto_dial_level==0) ) - {echo " TELÉFONO DEL ALT
";} - - -?> -GRABANDO ARCHIVO:
-
-
-GRABACIÓN ID:
-
- -Comenzar La Grabación
-
-Formulario Web
-
-Aparcar llamada
-Transferencia - Conferencia
-
-Colgar al Cliente
-
-Enviar DTMF
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
segundos:   Canal:   Tiempo:
Información Del Cliente:
Título:   Primero:   IM:   Último:
Dirección1:
Dirección2:   Dirección3:
Ciudad:   Estado:   Código Postal:
Provincia:   Vendedor ID:
Teléfono:   Código Del Dial:   Teléfono Alt:
Demostración:   Email:
Comentarios:
- -
-


  - -
- - - - -
versión web client VICIDIAL:     CONSTRUCCION:               Servidor:              
-Mostrar la información del canal Conferencia
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TECLAS ACCESO RÁPIDO INACTIVAS - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/voicemail_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/voicemail_check.php deleted file mode 100644 index 41bab949..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_es/voicemail_check.php +++ /dev/null @@ -1,130 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuarioname/Contraseña: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Comprobar el buzón de voz"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "caja del buzón de voz $vmail_box No es válido\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/active_list_refresh.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/active_list_refresh.php deleted file mode 100644 index 94f9599c..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/active_list_refresh.php +++ /dev/null @@ -1,446 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Affichage De Liste: "; -if ($ADD==1) {echo "Prolongements De phase";} -if ($ADD==2) {echo "Prolongements Occupés";} -if ($ADD==3) {echo "Lignes Extérieures";} -if ($ADD==4) {echo "Prolongements Locaux";} -if ($ADD==5) {echo "Conférences";} -if ($ADD==99999) {echo "AIDE";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/astguiclient.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/astguiclient.php deleted file mode 100644 index 5b75f3e5..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/astguiclient.php +++ /dev/null @@ -1,2874 +0,0 @@ - 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.9'; -$build = '60112-1622'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Vous vous êtes maintenant déconnecté. Merci\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "web client astGUIclient: Ouverture\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture
 
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICICADRAN|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICICADRAN|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client astGUIclient: Ouverture De Téléphone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Ouverture De Téléphone
 
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client astGUIclient: Ouverture De Téléphone\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture De Téléphone
 
Désolé, votre ouverture de téléphone et mot de passe ne soyez pas:
 
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client astGUIclient\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -DÉCONNEXION
\n"; ?> -
Panneau PrincipalLignes Actives PanneauPanneau De ConférencesVérifiez VoicemailVivent L'Appel
-
- - -

Logout
-
- - -
TRUNK DÉCROCHEMENT

- Active Trunks Menu
- Tronc De Décrochement   |   - Tronc De Détournement   |   - Écoutent Le Tronc   |   - Régénérez   |   - De nouveau à la fenêtre principale -
-
- - -
DÉCROCHEMENT LOCAL

- Menu Local Actif
- Gens du pays De Décrochement   |   - Gens du pays De Détournement   |   - Écoutent Les Gens du pays   |   - Régénérez   |   - De nouveau à la fenêtre principale -
-
- - - - - - - -
TRANSFERT DE PHASE D'APPEL
La Manche à transférer: LaManche
Prolongements:
Menu De Prolongements
-
- Envoyez à la prolongation choisie

- Envoyez dans la boîte choisie de vmail

- Envoyez à ce nombre:


- Régénérez


- De nouveau à la fenêtre principale

-
Conférences:
(cliquez sur un nombre ci-dessous pour envoyer à une)
Envoyez mon canal aussi
Menu De Conférences
-
- - - - - -
Cadran LOCAL De Prolongements
Téléphone appelant de: LaManche
Prolongements:
Menu De Prolongements
-
- Prolongation choisie par appel

- Boîte de vmail choisie par appel

- Régénérez


- De nouveau à la fenêtre principale

-
-
- - -
APPELS GARÉS:
- De nouveau à la fenêtre principale

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NOUVEAU:     VIEUX:             CADRAN MANUEL       CADRAN
APPELS GARÉS: 0                PROLONGEMENTS LOCAUX DE CADRAN
APPELS EN PARTANCE:
APPELS D'ARRIVÉE:
VERSION astGUIclient d'enchaînement-client: CONSTRUCTION:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORIS       éditez
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORIS

 
SOUMETTEZ FAVORIS CHANGES - requires logout
DE NOUVEAU À LA FENÊTRE PRINCIPALE - ignorez les changements faits
-
- -
- - - - - - - - - - - - - -
-PAUSE | DÉBUT     La vitesse de régénération: 1000 ms Plus rapidement | Plus lent

-
Initialisation..
-
Prolongements Actifs
-RÉGÉNÉREZ | -ORDRE | -
Lignes Extérieures
-RÉGÉNÉREZ | -ORDRE | -
Prolongements Locaux
-RÉGÉNÉREZ | -ORDRE | -
- Les Données Vont Ici

-
- Les Données Vont Ici

Action De Tronc -
- Les Données Vont Ici

Action Locale -
-
- - - - -
- - -Liste De Conférences - - - -
-Cliquez sur un nombre de salle de conférence du côté gauche -
- - - - - - - - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/call_log_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/call_log_display.php deleted file mode 100644 index 783b255f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/call_log_display.php +++ /dev/null @@ -1,181 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Affichage De Notation D'Appel"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten est inadmissible ou protocole $protocol est inadmissible\n"; - exit; - } - else - { - ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - - echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; - } - echo "\n"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/conf_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/conf_exten_check.php deleted file mode 100644 index a25fd51c..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/conf_exten_check.php +++ /dev/null @@ -1,213 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Contrôle De Prolongation De Conf"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten est inadmissible\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $LaMancheA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $LaMancheA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$LaMancheA[$counter] ~"; - # echo "$LaMancheA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten est inadmissible or Exten $exten est inadmissible\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conférence $conf_exten a été enregistré à $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/dbconnect.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/htglobalize.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/htglobalize.php deleted file mode 100644 index 72a10e1f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/htglobalize.php +++ /dev/null @@ -1,23 +0,0 @@ - $value){ - ${$key} = $value; - global ${$key};// = $value; - } - -} -array_conv($_GET); -array_conv($_POST); -array_conv($_SERVER); - -?> \ No newline at end of file diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/inbound_popup.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/inbound_popup.php deleted file mode 100644 index 45f0a9ed..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/inbound_popup.php +++ /dev/null @@ -1,335 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -APPEL D'ARRIVÉE DE PHASE"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

APPEL D'ARRIVÉE DE PHASE

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid est inadmissible\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
LaManche: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_LaManche=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "COUTUME - \n"; - - echo "
Numéro Composé: $row[8]
Notes: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "DÉCROCHEMENT - \n"; - echo "ENVOYEZ À MON VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/live_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/live_exten_check.php deleted file mode 100644 index cdc41871..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/live_exten_check.php +++ /dev/null @@ -1,263 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Contrôle De phase De Prolongation"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten est inadmissible ou protocole $protocol est inadmissible\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $LaMancheA[$loop_count] = "$row[0]"; - $LaMancheB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$LaMancheA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$LaMancheA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$LaMancheB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$LaMancheB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "LaMancheA: $LaMancheA[$counter] ~"; - echo "LaMancheB: $LaMancheB[$counter] ~"; - echo "LaMancheBtrunk: $LaMancheA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/manager_send.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/manager_send.php deleted file mode 100644 index b7c58870..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/manager_send.php +++ /dev/null @@ -1,882 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -### - $queryCID - ('CN012345678901234567',...) -### - $format - ('text','debug') -### - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $exten - ('1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $filename - ('20050406-125623_44444',...) -### - $extenName - ('phone100',...) -### - $parkedby - ('phone100',...) -### - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $auto_dial_level - ('0','1','1.1',...) -### - $campaign - ('CLOSER','TESTCAMP',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('1234',...) -### - $seconds - ('32',...) -### - $outbound_cid - ('3125551212','0000000000',...) -### - $agent_log_id - ('123456',...) -### - $call_server_ip - ('10.10.10.15',...) -### - $CalLCID - ('VD01234567890123456',...) -### - -# changes -# 50401-1002 First build of script, Hangup function only -# 50404-1045 Redirect basic function enabled -# 50406-1522 Monitor basic function enabled -# 50407-1647 Monitor and StopMonitor full functions enabled -# 50422-1120 basic Originate function enabled -# 50428-1451 basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 basic RedirectName and RedirectNameVmail added -# 50503-1227 added session_name checking for extra security -# 50523-1341 added Conference call start/stop recording -# 50523-1421 added OriginateName and OriginateNameVmail for local calls -# 50524-1602 added RedirectToPark and RedirectFromPark -# 50531-1203 added RedirecXtra for dual channel redirection -# 50630-1100 script changed to not use HTTP login vars, user/pass instead -# 50804-1148 Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 Added outbound_cid set if present to originate call -# 51020-1556 Added agent_log_id framework for detailed agent activity logging -# 51118-1204 Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 Added ability to accept calls from other VICIDIAL servers -# 51129-1253 Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### These are variable assignments for PHP globals off -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$queryCID=$_GET["queryCID"]; if (!$queryCID) {$queryCID=$_POST["queryCID"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$filename=$_GET["filename"]; if (!$filename) {$filename=$_POST["filename"];} -$extenName=$_GET["extenName"]; if (!$extenName) {$extenName=$_POST["extenName"];} -$parkedby=$_GET["parkedby"]; if (!$parkedby) {$parkedby=$_POST["parkedby"];} -$extrachannel=$_GET["extrachannel"]; if (!$extrachannel) {$extrachannel=$_POST["extrachannel"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$secondS=$_GET["secondS"]; if (!$secondS) {$secondS=$_POST["secondS"];} -$outbound_cid=$_GET["outbound_cid"]; if (!$outbound_cid) {$outbound_cid=$_POST["outbound_cid"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$call_server_ip=$_GET["call_server_ip"]; if (!$call_server_ip) {$call_server_ip=$_POST["call_server_ip"];} -$CalLCID=$_GET["CalLCID"]; if (!$CalLCID) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!$ACTION) {$ACTION="Originate";} -if (!$format) {$format="alert";} -if (!$ext_priority) {$ext_priority="1";} - - -$version = '0.0.22'; -$build = '60310-2022'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!$query_date) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Le Directeur Envoient: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "AIDE";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten est inadmissible or queryCID $queryCID est inadmissible, Originate commande non insérée\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate commande envoyée pour Exten $exten LaManche $channel sur $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "extenName $extenName doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nOriginateName Action non envoyé\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "extenName $extenName doit être placé\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nOriginateNameVmail Action non envoyé\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten est inadmissible or queryCID $queryCID est inadmissible, Originate commande non insérée\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate commande envoyée pour Exten $exten LaManche $channel sur $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten est inadmissible or ext_context $ext_context or queryCID $queryCID est inadmissible, Hangup commande non insérée\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "LaManche $channel est inadmissible or queryCID $queryCID est inadmissible, Hangup commande non insérée\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel n'est pas de phase sur $call_server_ip, Checking Live LaManche...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "LaManche $channel n'est pas de phase sur $call_server_ip, Hangup commande non insérée $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup commande envoyée pour LaManche $channel sur $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "auto_dial_level $auto_dial_level doit être placé\n"; - echo "campaign $campaign doit être placé\n"; - echo "uniqueid $uniqueid doit être placé\n"; - echo "lead_id $lead_id doit être placé\n"; - echo "\nRedirectVD Action non envoyé\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "extenName $extenName doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "parkedby $parkedby doit être placé\n"; - echo "\nRedirectToPark Action non envoyé\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirectFromPark Action non envoyé\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "extenName $extenName doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirectName Action non envoyé\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "extenName $extenName doit être placé\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirectNameVmail Action non envoyé\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "ExtraLaManche $extrachannel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirect Action non envoyé\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Ne peut pas trouver la conférence vide sur $server_ip, Redirect commande non insérée\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "LaManche $channel n'est pas de phase sur $call_server_ip, Redirect commande non insérée\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "LaManche $channel n'est pas de phase sur $server_ip, Redirect commande non insérée\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra commande envoyée pour LaManche $channel and \nExtraLaManche $extrachannel\n to $exten sur $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra commande envoyée pour LaManche $channel sur $call_server_ip and \nExtraLaManche $extrachannel\n to $exten sur $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Une de ces variables est inadmissible:\n"; - echo "LaManche $channel doivent être les 2 caractères plus grands que\n"; - echo "queryCID $queryCID doivent être les 14 caractères plus grands que\n"; - echo "exten $exten doit être placé\n"; - echo "ext_context $ext_context doit être placé\n"; - echo "ext_priority $ext_priority doit être placé\n"; - echo "\nRedirect Action non envoyé\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "LaManche $channel n'est pas de phase sur $server_ip, Redirect commande non insérée\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect commande envoyée pour LaManche $channel sur $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "LaManche $channel est inadmissible or queryCID $queryCID est inadmissible or filename: $filename est inadmissible, $ACTION commande non insérée\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "LaManche $channel n'est pas de phase sur $server_ip, $ACTION commande non insérée\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION commande envoyée pour LaManche $channel sur $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "LaManche $channel est inadmissible or exten $exten est inadmissible or filename: $filename est inadmissible, $ACTION commande non insérée\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going sur in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION commande envoyée pour LaManche $channel sur $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n L'ENREGISTREMENT DURERA JUSQU'À 60 MINUTES\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/park_calls_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/park_calls_display.php deleted file mode 100644 index 4833f40c..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/park_calls_display.php +++ /dev/null @@ -1,136 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Affichage Garé D'Appels"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten est inadmissible ou protocole $protocol est inadmissible\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/vdc_db_query.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/vdc_db_query.php deleted file mode 100644 index 6260080e..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/vdc_db_query.php +++ /dev/null @@ -1,1289 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the meetme conference has live channels connected and which they are -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs') -### - $stage - ('start','finish') -### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -### - $conf_exten - ('8600011',...) -### - $exten - ('123test',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $campaign - ('testcamp',...) -### - $dial_timeout - ('60','26',...) -### - $dial_prefix - ('9','8',...) -### - $campaign_cid - ('3125551212','0000000000',...) -### - $MDnextCID - ('M06301413000000002',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('36524',...) -### - $list_id - ('101','123456',...) -### - $length_in_sec - ('12',...) -### - $phone_code - ('1',...) -### - $phone_number - ('3125551212',...) -### - $channel - ('Zap/12-1',...) -### - $start_epoch - ('1120236911',...) -### - $vendor_lead_code - ('1234test',...) -### - $title - ('Mr.',...) -### - $first_name - ('Bob',...) -### - $middle_initial - ('L',...) -### - $last_name - ('Wilson',...) -### - $address1 - ('1324 Main St.',...) -### - $address2 - ('Apt. 12',...) -### - $address3 - ('co Robert Wilson',...) -### - $city - ('Chicago',...) -### - $state - ('IL',...) -### - $province - ('NA',...) -### - $postal_code - ('60054',...) -### - $country_code - ('USA',...) -### - $gender - ('M',...) -### - $date_of_birth - ('1970-01-01',...) -### - $alt_phone - ('3125551213',...) -### - $email - ('bob@bob.com',...) -### - $security_phrase - ('Hello',...) -### - $comments - ('Good Customer',...) -### - $auto_dial_level - ('0','1','1.2',...) -### - $VDstop_rec_after_each_call - ('0','1') -### - $conf_silent_prefix - ('7','8','',...) -### - $extension - ('123','user123','25-1',...) -### - $protocol - ('Zap','SIP','IAX2',...) -### - $user_abb - ('1234','6666',...) -### - $preview - ('YES','NO',...) -### - $called_count - ('0','1','2',...) -### - $agent_log_id - ('123456',...) -### - $agent_log - ('NO',...) -### - $favorites_list - (",'cc160','cc100'",...) -### - -# changes -# 50629-1044 First build of script -# 50630-1422 Added manual dial action and MD channel lookup -# 50701-1451 Added dial log for start and end of vicidial calls -# 50705-1239 Added call disposition update -# 50804-1627 Fixed updateDispo to update vicidial_log entry -# 50816-1605 Added VDADpause/ready for auto dialing -# 50816-1811 Added basic autodial call pickup functions -# 50817-1005 Altered logging functions to accomodate auto_dialing -# 50818-1305 Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 Added hangup of agent phone after Logout -# 50901-1315 Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 Fixed CLOSER log length_in_sec bug -# 50902-1730 Added functions for manual preview dialing and revert -# 50913-1214 Added agent random update to leadupdate -# 51020-1421 Added agent_log_id framework for detailed agent activity logging -# 51021-1717 Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 Altered echo statements for several small PHP speed optimizations -# 51122-1328 Fixed UserLogout issue not removing conference reservation -# 51129-1012 Added ability to accept calls from other VICIDIAL servers -# 51129-1729 Changed manual dial to use the '/n' flag for calls -# 51221-1154 Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 Added Updating of astguiclient favorites in the DB -# 60208-1617 Added dtmf buttons output per call -# 60213-1521 Added closer_campaigns update to vicidial_users -# 60215-1036 Added Callback date-time entry into vicidial_callbacks table -# - -$version = '0.0.26'; -$build = '60215-1036'; - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$stage=$_GET["stage"]; if (!$stage) {$stage=$_POST["stage"];} -$closer_choice=$_GET["closer_choice"]; if (!$closer_choice) {$closer_choice=$_POST["closer_choice"];} -$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$dial_timeout=$_GET["dial_timeout"]; if (!$dial_timeout) {$dial_timeout=$_POST["dial_timeout"];} -$dial_prefix=$_GET["dial_prefix"]; if (!$dial_prefix) {$dial_prefix=$_POST["dial_prefix"];} -$campaign_cid=$_GET["campaign_cid"]; if (!$campaign_cid) {$campaign_cid=$_POST["campaign_cid"];} -$MDnextCID=$_GET["MDnextCID"]; if (!$MDnextCID) {$MDnextCID=$_POST["MDnextCID"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$list_id=$_GET["list_id"]; if (!$list_id) {$list_id=$_POST["list_id"];} -$length_in_sec=$_GET["length_in_sec"]; if (!$length_in_sec) {$length_in_sec=$_POST["length_in_sec"];} -$phone_code=$_GET["phone_code"]; if (!$phone_code) {$phone_code=$_POST["phone_code"];} -$phone_number=$_GET["phone_number"]; if (!$phone_number) {$phone_number=$_POST["phone_number"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$start_epoch=$_GET["start_epoch"]; if (!$start_epoch) {$start_epoch=$_POST["start_epoch"];} -$dispo_choice=$_GET["dispo_choice"]; if (!$dispo_choice) {$dispo_choice=$_POST["dispo_choice"];} -$vendor_lead_code=$_GET["vendor_lead_code"]; if (!$vendor_lead_code) {$vendor_lead_code=$_POST["vendor_lead_code"];} -$title=$_GET["title"]; if (!$title) {$title=$_POST["title"];} -$first_name=$_GET["first_name"]; if (!$first_name) {$first_name=$_POST["first_name"];} -$middle_initial=$_GET["middle_initial"]; if (!$middle_initial) {$middle_initial=$_POST["middle_initial"];} -$last_name=$_GET["last_name"]; if (!$last_name) {$last_name=$_POST["last_name"];} -$address1=$_GET["address1"]; if (!$address1) {$address1=$_POST["address1"];} -$address2=$_GET["address2"]; if (!$address2) {$address2=$_POST["address2"];} -$address3=$_GET["address3"]; if (!$address3) {$address3=$_POST["address3"];} -$city=$_GET["city"]; if (!$city) {$city=$_POST["city"];} -$state=$_GET["state"]; if (!$state) {$state=$_POST["state"];} -$province=$_GET["province"]; if (!$province) {$province=$_POST["province"];} -$postal_code=$_GET["postal_code"]; if (!$postal_code) {$postal_code=$_POST["postal_code"];} -$country_code=$_GET["country_code"]; if (!$country_code) {$country_code=$_POST["country_code"];} -$gender=$_GET["gender"]; if (!$gender) {$gender=$_POST["gender"];} -$date_of_birth=$_GET["date_of_birth"]; if (!$date_of_birth) {$date_of_birth=$_POST["date_of_birth"];} -$alt_phone=$_GET["alt_phone"]; if (!$alt_phone) {$alt_phone=$_POST["alt_phone"];} -$email=$_GET["email"]; if (!$email) {$email=$_POST["email"];} -$security_phrase=$_GET["security_phrase"]; if (!$security_phrase) {$security_phrase=$_POST["security_phrase"];} -$comments=$_GET["comments"]; if (!$comments) {$comments=$_POST["comments"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"]; if (!$VDstop_rec_after_each_call) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -$conf_silent_prefix=$_GET["conf_silent_prefix"]; if (!$conf_silent_prefix) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];} -$protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];} -$user_abb=$_GET["user_abb"]; if (!$user_abb) {$user_abb=$_POST["user_abb"];} -$preview=$_GET["preview"]; if (!$preview) {$preview=$_POST["preview"];} -$called_count=$_GET["called_count"]; if (!$called_count) {$called_count=$_POST["called_count"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log"];} -$favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];} -$CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -$recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];} - - -# default optional vars if not set -if (!$format) {$format="text";} -if ($format == 'debug') {$DB=1;} -if (!$ACTION) {$ACTION="refresh";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -if (!$query_date) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) -{ -echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; -exit; -} -else -{ - -if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Manuscrit De Question De Base de données"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Choix De Groupe $closer_choice est inadmissible\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Choix De Groupe $closer_choice a été enregistré à user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "DISTRIBUTEUR VIDE\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context est inadmissible\n"; - exit; - } - else - { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - ##### grab the lead_id of the reserved user in vicidial_hopper - $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - } - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INAPPEL - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "DISTRIBUTEUR VIDE\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context est inadmissible\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INAPPEL - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "APPEL NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context est inadmissible\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID est inadmissible\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "NOTATION NON ENTRÉE\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign est inadmissible\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inséré: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "NOTATION NON ENTRÉE\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "APPEL_LOG Inséré: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "NOTATION NON ENTRÉE\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "NOTATION NON ENTRÉE\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id est inadmissible\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "NOTATION NON ENTRÉE\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campagne $campaign est inadmissible\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INAPPEL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INAPPEL - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INAPPEL - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INAPPEL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send sur to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user sur $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten est inadmissible\n"; - exit; - } -else - { - ##### Insert a DÉCONNEXION record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','DÉCONNEXION','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation sur the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id est inadmissible\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### APPELBACK ENTRY - if ( ($dispo_choice == 'CBHVIEUX') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' a été changé en ' . $dispo_choice . " Statut\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id est inadmissible\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='$vendor_lead_code', title='$title', first_name='$first_name', middle_initial='$middle_initial', last_name='$last_name', address1='$address1', address2='$address2', address3='$address3', city='$city', state='$state', province='$province', postal_code='$postal_code', country_code='$country_code', gender='$gender', date_of_birth='$date_of_birth', alt_phone='$alt_phone', email='$email', security_phrase='$security_phrase', comments='$comments' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - echo "Lead $lead_id l'information a été mise à jour\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage est inadmissible\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' est maintenant dans le statut ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list est inadmissible\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - - - -if ($format=='debug') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/vicidial.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/vicidial.php deleted file mode 100644 index f2100ace..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/vicidial.php +++ /dev/null @@ -1,4633 +0,0 @@ - LICENSE: GPLv2 -### -### make sure you have added a user to the vicidial_users MySQL table with at least -### user_level 1 or greater to access this page. Also, you need to have the login -### and pass of a phone listed in the asterisk.phones table. The page grabs the -### server info and other details from this login and pass. -### -### This script works best with Firefox or Mozilla, but will run for a couple -### hours on Internet Explorer before the memory leaks cause a crash. -### -### Other scripts that this application depends on: -### - vdc_db_query.php: Updates information in the database -### - manager_send.php: Sends manager actions to the DB for execution -### -### CHANGES -### 50607-1426 - First Build of VICIDIAL web client basic login process finished -### 50628-1620 - Added some basic formatting and worked on process flow -### 50628-1715 - Startup variables mapped to javascript variables -### 50629-1303 - Added Login Closer in-groups selection box and vla update -### 50629-1530 - Rough layout for customer info form section and button links -### 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -### 50701-1450 - Added vicidial_log entries on dial and hangup -### 50701-1634 - Added Logout function -### 50705-1259 - Added call disposition functionality -### 50705-1432 - Added lead info DB update function -### 50705-1658 - Added web form functionality -### 50706-1043 - Added call park and pickup functions -### 50706-1234 - Added Start/Stop Recording functionality -### 50706-1614 - Added conference channels display option -### 50711-1333 - Removed call check redundancy and fixed a span bug -### 50727-1424 - Added customer channel and participant present sensing/alerts -### 50804-1057 - Added SendDTMF function and reconfigured the transfer span -### 50804-1224 - Added Local and Internal Closer transfer functions -### 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -### 50804-1808 - Added button images for left buttons -### 50815-1151 - Added 3Way calling functions to Transfer-conf frame -### 50815-1602 - Added images and buttons for xfer functions -### 50816-1813 - Added basic autodial outbound call pickup functions -### 50817-1113 - Fixes to auto_dialing call receipt -### 50817-1234 - Added inbound call receipt capability -### 50817-1541 - Added customer time display -### 50817-1541 - Added customer time display -### 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -### 50818-1703 - Added pretty login section -### 50825-1200 - Modified form field lengths, added double-click dispositions -### 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -### 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -### 50903-0904 - Added preview-lead code for manual dialing -### 50904-0016 - Added ability to hangup manual dials before pickup -### 50906-1319 - Added override for filters on xfer calls, fixed login display bug -### 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -### 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -### 50913-1212 - Added campaign_cid to 3rd party calls -### 50923-1546 - Modified to work with language translation -### 50926-1656 - Added campaign pull-down at login of active campaigns -### 50928-1633 - Added manual dial alternate number dial option -### 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -### 51004-1656 - Fixed recording filename bug and new Spanish translation -### 51020-1103 - Added campaign-specific recording control abilities -### 51020-1352 - Added Basic vicidial_agent_log framework -### 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -### 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -### 51110-1432 - Fixed non-standard http port issue -### 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -### 51118-1305 - Activate multi-line comments from $multi_line_comments var -### 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -### 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -### 51129-1010 - Added ability to accept calls from other VICIDIAL servers -### 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -### 51208-1732 - Created user-first login that looks for default phone info -### 51219-1526 - Added variable framework for campaign and in-group scripts -### 51221-1200 - Added SCRIPT tab, layout and functionality -### 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -### 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -### 51229-1028 - Added checks on web_form_address to allow for var in the DB value -### 60117-1312 - Added Transfer-conf frame toggle on button press -### 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -### 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -### 60213-1210 - Added ability to sort routing of calls by user_level -### 60214-0932 - Initial Callback calendar display framework -### 60214-1407 - Added ability to minimize the dispo screen to see info below -### 60215-1104 - Added ANYONE scheduled callbacks functionality -### - -require("dbconnect.php"); - -$DB=$_GET['DB']; if (!$DB) {$DB=$_POST["DB"];} -$phone_login=$_GET['phone_login']; if (!$phone_login) {$phone_login=$_POST["phone_login"];} - if (!$phone_login) {$phone_login=$_GET["pl"];} -$phone_pass=$_GET['phone_pass']; if (!$phone_pass) {$phone_pass=$_POST["phone_pass"];} - if (!$phone_pass) {$phone_pass=$_GET["pp"];} -$VD_login=$_GET['VD_login']; if (!$VD_login) {$VD_login=$_POST["VD_login"];} -$VD_pass=$_GET['VD_pass']; if (!$VD_pass) {$VD_pass=$_POST["VD_pass"];} -$VD_campaign=$_GET['VD_campaign']; if (!$VD_campaign) {$VD_campaign=$_POST["VD_campaign"];} - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); -$relogin=$_GET['relogin']; if (!$relogin) {$relogin=$_POST["relogin"];} - -$forever_stop=0; - -$version = '1.1.66'; -$build = '60215-1104'; - -if ($force_logout) -{ - echo "Vous vous êtes maintenant déconnecté. Merci\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$manual_dial_preview = '1'; # Allow preview lead option when manual dial -$HKuser_level = '5'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_alt_phone = '1'; # allow manual dial users to call alt phone number -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "Web client de VICICADRAN: Re-Ouverture\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Ouverture
 
Ouverture De Téléphone:
Mot de passe De Téléphone:
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Campagne: $camp_form_code

VERSION: $version       CONSTRUCTION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "Web client de VICICADRAN: Ouverture De Campagne\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Ouverture D'Utilisateur

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture De Campagne
 
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Campagne: $camp_form_code

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "Web client de VICICADRAN: Ouverture\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture
 
Ouverture De Téléphone:
Mot de passe De Téléphone:
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Campagne: $camp_form_code

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "Web client de VICICADRAN: Ouverture De Téléphone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Ouverture De Téléphone
 
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "La campagne non active, essayent svp encore
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "L'ouverture incorrecte, essayent svp encore
"; - } - } - if ($VDloginDISPLAY) - { - echo "Web client de VICICADRAN: Ouverture De Campagne\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture De Campagne
 
Ouverture D'Utilisateur:
Mot de passe D'Utilisateur:
Campagne: $camp_form_code

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "Web client de VICICADRAN: Ouverture De Téléphone Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Ouverture Error
 
Désolé, votre ouverture de téléphone et mot de passe ne soyez pas:
 
Ouverture De Téléphone:
Mot de passe De Téléphone:

VERSION: $version       CONSTRUCTION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "Web client de VICICADRAN\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed sur this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login sur phone: $SIP_user à la campagne: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NOUVEAU record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "Web client de VICICADRAN: VICICADRAN Ouverture De Campagne\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Désolé, il n'y a aucun fil dans le distributeur pour cette campagne\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Ouverture: \n
"; - echo "Mot de passe:
\n"; - echo "Campagne: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "Web client de VICICADRAN: VICICADRAN Ouverture De Campagne\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Ouverture: \n
"; - echo "Mot de passe:
\n"; - echo "Campagne: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -DÉCONNEXION\n"; ?> -
-
- - - - - - - - -
VICICADRANSCRIPT   LIVE     ID de session: Vivent L'Appel
-
- - - - -

VICICADRAN
-
- - - - -
- - Transfert - Conférence
- PLUS ÉTROIT INTERNE - GENS DU PAYS PLUS ÉTROITS - CODE - Ligne De Xfer De Décrochement - Décrochement Les deux Lignes - -
- - Nombre à appeler   - secondes   - channel - - OVERRIDE   - D1 - D2 -
- - Cadran Avec Le Client - Cadran De Client De Parc - APPEL DU CONGÉ 3-WAY - Transfert D'Aveugle De Cadran - Blind Transfer VMail Message -
-
-
- - - - -
Fil Dispositioned As:

- -
-
-
- - - - - - - -
Touches Directes De Disposition: - Si actif, appuyez sur simplement la touche de clavier pour la:
- - - - - -
-
- - -
Aucun n'est en votre session:
- OK -
-
- - -
Le client a raccroché:
- OK -
-
- - -

DÉCONNEXION
-
- - -
-
- - -
 
-
- - -
Tous les changements faits au client que l'information ci-dessous actuellement ne sera pas comitted, vous doivent changer l'information de client avant vous décrochement l'appel.
-
- - -
APPEL DE DISPOSITION :       réduisez au minimum
- Extrémité-de-appelez Le Choix De Disposition -
- CESSEZ D'APPELER
- REMISE | - SOUMETTEZ -



  -
-
- - - -
Choisissez une date de rappel de service :
- - - Choisissez une date ci-dessous   -     - Hour: -   - Minutes: -   - -  
- - Commentaires de CB:

- - SOUMETTEZ

- - -

  -
-
- - -
UN CHOIX DE GROUPE D'ARRIVÉE PLUS ÉTROIT
- Un Choix De Groupe D'arrivée Plus étroit -
- APPELER MÉLANGÉ(en partance activé)
- REMISE | - SOUMETTEZ -



  -
-
- - - - - - - - - - - -
TRANSFERT DE PHASE D'APPEL
La Manche à transférer: LaManche
Prolongements:
Menu De Prolongements
-
- Envoyez à la prolongation choisie

- Envoyez dans la boîte choisie de vmail

- Envoyez à ce nombre:


- RÉGÉNÉREZ


- De nouveau à la fenêtre principale

-
Conférences:
(cliquez sur un nombre ci-dessous pour envoyer à une)
Envoyez mon canal aussi
Menu De Conférences
-
- - - - -
VICICADRAN SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUT:
-
-Prochain Nombre De Cadran
- PRÉVISION DE FIL
";} -if ( ($manual_dial_alt_phone) and ($auto_dial_level==0) ) - {echo " TÉLÉPHONE D'ALT
";} - - -?> -DOSSIER D'ENREGISTREMENT:
-
-
-IDENTIFICATION DISQUE:
-
- -Commencez À enregistrer
-
-Forme de Web
-
-Appel De Parc
-Transfert - Conférence
-
-Client De Décrochement
-
-Envoyez DTMF
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
secondes:   LaManche:   Temps De Cust:
L'Information De Client:
Titre:   D'abord:   MI :  Bout:
Adresse1:
Adresse2:   Adresse3:
Ville:   État:   Code postal:
Province:   Identification De Fournisseur:
Téléphone:   DialCode:   Alt. Téléphone:
Exposition:   Email:
Commentaires:
- -
-


  - -
- - - - -
Version d'enchaînement-client de VICICADRAN:     CONSTRUCTION:               Serveur:              
-Montrez l'information de canal de conférence téléphonique
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TOUCHES DIRECTES INACTIVES - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/voicemail_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/voicemail_check.php deleted file mode 100644 index 1b5c88f1..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_fr/voicemail_check.php +++ /dev/null @@ -1,130 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inadmissible Utilisateurname/Mot de passe: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inadmissible server_ip: |$server_ip| or Inadmissible session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inadmissible session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Contrôle De Voicemail"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "boîte de voicemail $vmail_box est inadmissible\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/active_list_refresh.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/active_list_refresh.php deleted file mode 100644 index 39da8358..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/active_list_refresh.php +++ /dev/null @@ -1,446 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Esposizione Della Lista: "; -if ($ADD==1) {echo "Estensioni In tensione";} -if ($ADD==2) {echo "Estensioni Occupate";} -if ($ADD==3) {echo "Linee Esterne";} -if ($ADD==4) {echo "Estensioni Locali";} -if ($ADD==5) {echo "Congressi";} -if ($ADD==99999) {echo "AIUTO";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/astguiclient.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/astguiclient.php deleted file mode 100644 index d1db2c90..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/astguiclient.php +++ /dev/null @@ -1,2874 +0,0 @@ - 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.9'; -$build = '60112-1622'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Ora avete annotato fuori. Grazie\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "web client astGUIclient: Inizio attività\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività
 
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIMANOPOLA|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIMANOPOLA|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client astGUIclient: Inizio attività Del Telefono\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Inizio attività Del Telefono
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client astGUIclient: Inizio attività Del Telefono\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività Del Telefono
 
Spiacente, il vostri inizio attività del telefono e parola d'accesso:
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client astGUIclient\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -TERMINE
\n"; ?> -
Pannello PrincipaleLinee Attive PannelloPannello Di CongressiControlli VoicemailVive La Chiamata
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Tronco Di Hangup   |   - Tronco Di Dirottamento   |   - Ascolta Il Tronco   |   - Rinfreschi   |   - Di nuovo alla finestra principale -
-
- - -
HANGUP LOCALE

- Menu Locale Attivo
- Local Di Hangup   |   - Local Di Dirottamento   |   - Ascolta Il Local   |   - Rinfreschi   |   - Di nuovo alla finestra principale -
-
- - - - - - - -
TRASFERIMENTO IN TENSIONE DI CHIAMATA
Manica da trasferire: Manica
Estensioni:
Menu Di Estensioni
-
- Trasmetta all'estensione selezionata

- Trasmetta alla scatola selezionata del vmail

- _ trasmett questo numero:


- Rinfreschi


- Di nuovo alla finestra principale

-
Congressi:
(scatti sopra un numero qui sotto per trasmettere ad un congresso)
Trasmetta la mia scanalatura anche
Menu Di Congressi
-
- - - - - -
Manopola LOCALE Di Estensioni
Telefono che denomina da: Manica
Estensioni:
Menu Di Estensioni
-
- Estensione selezionata chiamata

- Scatola del vmail selezionata chiamata

- Rinfreschi


- Di nuovo alla finestra principale

-
-
- - -
CHIAMATE PARCHEGGIATE:
- Di nuovo alla finestra principale

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NUOVO:     VECCHIO:             MANOPOLA MANUALE       MANOPOLA
CHIAMATE PARCHEGGIATE: 0                ESTENSIONI LOCALI DELLA MANOPOLA
CHIAMATE OUTBOUND:
CHIAMATE INBOUND:
VERSIONEE astGUIclient del fotoricettore-cliente: CONFIGURAZIONE:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITI       pubblichi
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITI

 
PRESENTI FAVORITI CHANGES - requires logout
DI NUOVO ALLA FINESTRA PRINCIPALE - ignori i cambiamenti fatti
-
- -
- - - - - - - - - - - - - -
-PAUSA | INIZIO     La velocità di rinfrescamento: 1000 ms Più velocemente | Più lento

-
Inizializzazione..
-
Estensioni Attive
-RINFRESCHI | -ORDINE | -
Linee Esterne
-RINFRESCHI | -ORDINE | -
Estensioni Locali
-RINFRESCHI | -ORDINE | -
- I Dati Vanno Qui

-
- I Dati Vanno Qui

Azione Del Tronco -
- I Dati Vanno Qui

Azione Locale -
-
- - - - -
- - -Lista Di Congressi - - - -
-Scatti sopra un numero di stanza di congresso a sinistra per l'Info su -
- - - - - - - - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/call_log_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/call_log_display.php deleted file mode 100644 index 78dad078..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/call_log_display.php +++ /dev/null @@ -1,181 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Esposizione Del Ceppo Di Chiamata"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten è non valido o protocollo $protocol è non valido\n"; - exit; - } - else - { - ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - - echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; - } - echo "\n"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/conf_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/conf_exten_check.php deleted file mode 100644 index bbfbc10c..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/conf_exten_check.php +++ /dev/null @@ -1,213 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Controllo Di Estensione Di Conf"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten è non valido\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ManicaA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $ManicaA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$ManicaA[$counter] ~"; - # echo "$ManicaA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten è non valido or Exten $exten è non valido\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Congresso $conf_exten è stato registrato a $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/dbconnect.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/inbound_popup.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/inbound_popup.php deleted file mode 100644 index b2c85495..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/inbound_popup.php +++ /dev/null @@ -1,335 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -CHIAMATA INBOUND IN TENSIONE"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

CHIAMATA INBOUND IN TENSIONE

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid è non valido\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Manica: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Manica=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "ABITUDINE - \n"; - - echo "
Il Numero Ha composto: $row[8]
Note: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "TRASMETTA AL MIO VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/live_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/live_exten_check.php deleted file mode 100644 index df5ed62a..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/live_exten_check.php +++ /dev/null @@ -1,263 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Controllo In tensione Di Estensione"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten è non valido o protocollo $protocol è non valido\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $ManicaA[$loop_count] = "$row[0]"; - $ManicaB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ManicaA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ManicaA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ManicaB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ManicaB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "ManicaA: $ManicaA[$counter] ~"; - echo "ManicaB: $ManicaB[$counter] ~"; - echo "ManicaBtrunk: $ManicaA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/manager_send.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/manager_send.php deleted file mode 100644 index 72c7a54d..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/manager_send.php +++ /dev/null @@ -1,882 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -### - $queryCID - ('CN012345678901234567',...) -### - $format - ('text','debug') -### - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $exten - ('1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $filename - ('20050406-125623_44444',...) -### - $extenName - ('phone100',...) -### - $parkedby - ('phone100',...) -### - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $auto_dial_level - ('0','1','1.1',...) -### - $campaign - ('CLOSER','TESTCAMP',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('1234',...) -### - $seconds - ('32',...) -### - $outbound_cid - ('3125551212','0000000000',...) -### - $agent_log_id - ('123456',...) -### - $call_server_ip - ('10.10.10.15',...) -### - $CalLCID - ('VD01234567890123456',...) -### - -# changes -# 50401-1002 First build of script, Hangup function only -# 50404-1045 Redirect basic function enabled -# 50406-1522 Monitor basic function enabled -# 50407-1647 Monitor and StopMonitor full functions enabled -# 50422-1120 basic Originate function enabled -# 50428-1451 basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 basic RedirectName and RedirectNameVmail added -# 50503-1227 added session_name checking for extra security -# 50523-1341 added Conference call start/stop recording -# 50523-1421 added OriginateName and OriginateNameVmail for local calls -# 50524-1602 added RedirectToPark and RedirectFromPark -# 50531-1203 added RedirecXtra for dual channel redirection -# 50630-1100 script changed to not use HTTP login vars, user/pass instead -# 50804-1148 Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 Added outbound_cid set if present to originate call -# 51020-1556 Added agent_log_id framework for detailed agent activity logging -# 51118-1204 Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 Added ability to accept calls from other VICIDIAL servers -# 51129-1253 Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### These are variable assignments for PHP globals off -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$queryCID=$_GET["queryCID"]; if (!$queryCID) {$queryCID=$_POST["queryCID"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$filename=$_GET["filename"]; if (!$filename) {$filename=$_POST["filename"];} -$extenName=$_GET["extenName"]; if (!$extenName) {$extenName=$_POST["extenName"];} -$parkedby=$_GET["parkedby"]; if (!$parkedby) {$parkedby=$_POST["parkedby"];} -$extrachannel=$_GET["extrachannel"]; if (!$extrachannel) {$extrachannel=$_POST["extrachannel"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$secondS=$_GET["secondS"]; if (!$secondS) {$secondS=$_POST["secondS"];} -$outbound_cid=$_GET["outbound_cid"]; if (!$outbound_cid) {$outbound_cid=$_POST["outbound_cid"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$call_server_ip=$_GET["call_server_ip"]; if (!$call_server_ip) {$call_server_ip=$_POST["call_server_ip"];} -$CalLCID=$_GET["CalLCID"]; if (!$CalLCID) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!$ACTION) {$ACTION="Originate";} -if (!$format) {$format="alert";} -if (!$ext_priority) {$ext_priority="1";} - - -$version = '0.0.22'; -$build = '60310-2022'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!$query_date) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Il Responsabile Trasmette: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "AIUTO";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten è non valido or queryCID $queryCID è non valido, Originate ordine non inserito\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate ordine trasmesso per Exten $exten Manica $channel su $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nOriginateName Action non trasmesso\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nOriginateNameVmail Action non trasmesso\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten è non valido or queryCID $queryCID è non valido, Originate ordine non inserito\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate ordine trasmesso per Exten $exten Manica $channel su $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten è non valido or ext_context $ext_context or queryCID $queryCID è non valido, Hangup ordine non inserito\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Manica $channel è non valido or queryCID $queryCID è non valido, Hangup ordine non inserito\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel non è in tensione su $call_server_ip, Checking Live Manica...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Manica $channel non è in tensione su $call_server_ip, Hangup ordine non inserito $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup ordine trasmesso per Manica $channel su $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "auto_dial_level $auto_dial_level deve essere regolato\n"; - echo "campaign $campaign deve essere regolato\n"; - echo "uniqueid $uniqueid deve essere regolato\n"; - echo "lead_id $lead_id deve essere regolato\n"; - echo "\nRedirectVD Action non trasmesso\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "parkedby $parkedby deve essere regolato\n"; - echo "\nRedirectToPark Action non trasmesso\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirectFromPark Action non trasmesso\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirectName Action non trasmesso\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "extenName $extenName deve essere regolato\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirectNameVmail Action non trasmesso\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "ExtraManica $extrachannel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirect Action non trasmesso\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Non può trovare il congresso vuoto su $server_ip, Redirect ordine non inserito\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Manica $channel non è in tensione su $call_server_ip, Redirect ordine non inserito\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Manica $channel non è in tensione su $server_ip, Redirect ordine non inserito\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra ordine trasmesso per Manica $channel and \nExtraManica $extrachannel\n to $exten su $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra ordine trasmesso per Manica $channel su $call_server_ip and \nExtraManica $extrachannel\n to $exten su $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Una di queste variabili è non valido:\n"; - echo "Manica $channel deve essere più grande di 2 caratteri\n"; - echo "queryCID $queryCID deve essere più grande di 14 caratteri\n"; - echo "exten $exten deve essere regolato\n"; - echo "ext_context $ext_context deve essere regolato\n"; - echo "ext_priority $ext_priority deve essere regolato\n"; - echo "\nRedirect Action non trasmesso\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Manica $channel non è in tensione su $server_ip, Redirect ordine non inserito\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect ordine trasmesso per Manica $channel su $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Manica $channel è non valido or queryCID $queryCID è non valido or filename: $filename è non valido, $ACTION ordine non inserito\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Manica $channel non è in tensione su $server_ip, $ACTION ordine non inserito\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION ordine trasmesso per Manica $channel su $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Manica $channel è non valido or exten $exten è non valido or filename: $filename è non valido, $ACTION ordine non inserito\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going su in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION ordine trasmesso per Manica $channel su $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n LA REGISTRAZIONE DURERÀ FINO A 60 MINUTI\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/park_calls_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/park_calls_display.php deleted file mode 100644 index cf729c1d..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/park_calls_display.php +++ /dev/null @@ -1,136 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Esposizione Parcheggiata Di Chiamate"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten è non valido o protocollo $protocol è non valido\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/vdc_db_query.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/vdc_db_query.php deleted file mode 100644 index 925812f6..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/vdc_db_query.php +++ /dev/null @@ -1,1289 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the meetme conference has live channels connected and which they are -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs') -### - $stage - ('start','finish') -### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -### - $conf_exten - ('8600011',...) -### - $exten - ('123test',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $campaign - ('testcamp',...) -### - $dial_timeout - ('60','26',...) -### - $dial_prefix - ('9','8',...) -### - $campaign_cid - ('3125551212','0000000000',...) -### - $MDnextCID - ('M06301413000000002',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('36524',...) -### - $list_id - ('101','123456',...) -### - $length_in_sec - ('12',...) -### - $phone_code - ('1',...) -### - $phone_number - ('3125551212',...) -### - $channel - ('Zap/12-1',...) -### - $start_epoch - ('1120236911',...) -### - $vendor_lead_code - ('1234test',...) -### - $title - ('Mr.',...) -### - $first_name - ('Bob',...) -### - $middle_initial - ('L',...) -### - $last_name - ('Wilson',...) -### - $address1 - ('1324 Main St.',...) -### - $address2 - ('Apt. 12',...) -### - $address3 - ('co Robert Wilson',...) -### - $city - ('Chicago',...) -### - $state - ('IL',...) -### - $province - ('NA',...) -### - $postal_code - ('60054',...) -### - $country_code - ('USA',...) -### - $gender - ('M',...) -### - $date_of_birth - ('1970-01-01',...) -### - $alt_phone - ('3125551213',...) -### - $email - ('bob@bob.com',...) -### - $security_phrase - ('Hello',...) -### - $comments - ('Good Customer',...) -### - $auto_dial_level - ('0','1','1.2',...) -### - $VDstop_rec_after_each_call - ('0','1') -### - $conf_silent_prefix - ('7','8','',...) -### - $extension - ('123','user123','25-1',...) -### - $protocol - ('Zap','SIP','IAX2',...) -### - $user_abb - ('1234','6666',...) -### - $preview - ('YES','NO',...) -### - $called_count - ('0','1','2',...) -### - $agent_log_id - ('123456',...) -### - $agent_log - ('NO',...) -### - $favorites_list - (",'cc160','cc100'",...) -### - -# changes -# 50629-1044 First build of script -# 50630-1422 Added manual dial action and MD channel lookup -# 50701-1451 Added dial log for start and end of vicidial calls -# 50705-1239 Added call disposition update -# 50804-1627 Fixed updateDispo to update vicidial_log entry -# 50816-1605 Added VDADpause/ready for auto dialing -# 50816-1811 Added basic autodial call pickup functions -# 50817-1005 Altered logging functions to accomodate auto_dialing -# 50818-1305 Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 Added hangup of agent phone after Logout -# 50901-1315 Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 Fixed CLOSER log length_in_sec bug -# 50902-1730 Added functions for manual preview dialing and revert -# 50913-1214 Added agent random update to leadupdate -# 51020-1421 Added agent_log_id framework for detailed agent activity logging -# 51021-1717 Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 Altered echo statements for several small PHP speed optimizations -# 51122-1328 Fixed UserLogout issue not removing conference reservation -# 51129-1012 Added ability to accept calls from other VICIDIAL servers -# 51129-1729 Changed manual dial to use the '/n' flag for calls -# 51221-1154 Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 Added Updating of astguiclient favorites in the DB -# 60208-1617 Added dtmf buttons output per call -# 60213-1521 Added closer_campaigns update to vicidial_users -# 60215-1036 Added Callback date-time entry into vicidial_callbacks table -# - -$version = '0.0.26'; -$build = '60215-1036'; - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$stage=$_GET["stage"]; if (!$stage) {$stage=$_POST["stage"];} -$closer_choice=$_GET["closer_choice"]; if (!$closer_choice) {$closer_choice=$_POST["closer_choice"];} -$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$dial_timeout=$_GET["dial_timeout"]; if (!$dial_timeout) {$dial_timeout=$_POST["dial_timeout"];} -$dial_prefix=$_GET["dial_prefix"]; if (!$dial_prefix) {$dial_prefix=$_POST["dial_prefix"];} -$campaign_cid=$_GET["campaign_cid"]; if (!$campaign_cid) {$campaign_cid=$_POST["campaign_cid"];} -$MDnextCID=$_GET["MDnextCID"]; if (!$MDnextCID) {$MDnextCID=$_POST["MDnextCID"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$list_id=$_GET["list_id"]; if (!$list_id) {$list_id=$_POST["list_id"];} -$length_in_sec=$_GET["length_in_sec"]; if (!$length_in_sec) {$length_in_sec=$_POST["length_in_sec"];} -$phone_code=$_GET["phone_code"]; if (!$phone_code) {$phone_code=$_POST["phone_code"];} -$phone_number=$_GET["phone_number"]; if (!$phone_number) {$phone_number=$_POST["phone_number"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$start_epoch=$_GET["start_epoch"]; if (!$start_epoch) {$start_epoch=$_POST["start_epoch"];} -$dispo_choice=$_GET["dispo_choice"]; if (!$dispo_choice) {$dispo_choice=$_POST["dispo_choice"];} -$vendor_lead_code=$_GET["vendor_lead_code"]; if (!$vendor_lead_code) {$vendor_lead_code=$_POST["vendor_lead_code"];} -$title=$_GET["title"]; if (!$title) {$title=$_POST["title"];} -$first_name=$_GET["first_name"]; if (!$first_name) {$first_name=$_POST["first_name"];} -$middle_initial=$_GET["middle_initial"]; if (!$middle_initial) {$middle_initial=$_POST["middle_initial"];} -$last_name=$_GET["last_name"]; if (!$last_name) {$last_name=$_POST["last_name"];} -$address1=$_GET["address1"]; if (!$address1) {$address1=$_POST["address1"];} -$address2=$_GET["address2"]; if (!$address2) {$address2=$_POST["address2"];} -$address3=$_GET["address3"]; if (!$address3) {$address3=$_POST["address3"];} -$city=$_GET["city"]; if (!$city) {$city=$_POST["city"];} -$state=$_GET["state"]; if (!$state) {$state=$_POST["state"];} -$province=$_GET["province"]; if (!$province) {$province=$_POST["province"];} -$postal_code=$_GET["postal_code"]; if (!$postal_code) {$postal_code=$_POST["postal_code"];} -$country_code=$_GET["country_code"]; if (!$country_code) {$country_code=$_POST["country_code"];} -$gender=$_GET["gender"]; if (!$gender) {$gender=$_POST["gender"];} -$date_of_birth=$_GET["date_of_birth"]; if (!$date_of_birth) {$date_of_birth=$_POST["date_of_birth"];} -$alt_phone=$_GET["alt_phone"]; if (!$alt_phone) {$alt_phone=$_POST["alt_phone"];} -$email=$_GET["email"]; if (!$email) {$email=$_POST["email"];} -$security_phrase=$_GET["security_phrase"]; if (!$security_phrase) {$security_phrase=$_POST["security_phrase"];} -$comments=$_GET["comments"]; if (!$comments) {$comments=$_POST["comments"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"]; if (!$VDstop_rec_after_each_call) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -$conf_silent_prefix=$_GET["conf_silent_prefix"]; if (!$conf_silent_prefix) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];} -$protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];} -$user_abb=$_GET["user_abb"]; if (!$user_abb) {$user_abb=$_POST["user_abb"];} -$preview=$_GET["preview"]; if (!$preview) {$preview=$_POST["preview"];} -$called_count=$_GET["called_count"]; if (!$called_count) {$called_count=$_POST["called_count"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log"];} -$favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];} -$CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -$recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];} - - -# default optional vars if not set -if (!$format) {$format="text";} -if ($format == 'debug') {$DB=1;} -if (!$ACTION) {$ACTION="refresh";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -if (!$query_date) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) -{ -echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; -exit; -} -else -{ - -if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Scritto Di Domanda Della Base di dati"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Scelta Del Gruppo $closer_choice è non valido\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Scelta Del Gruppo $closer_choice è stato registrato a user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "TRAMOGGIA VUOTA\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context è non valido\n"; - exit; - } - else - { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - ##### grab the lead_id of the reserved user in vicidial_hopper - $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - } - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCHIAMATA - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "TRAMOGGIA VUOTA\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context è non valido\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCHIAMATA - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CHIAMATA NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context è non valido\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID è non valido\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "CEPPO NON INSERITO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign è non valido\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Inserito: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "CEPPO NON INSERITO\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CHIAMATA_LOG Inserito: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "CEPPO NON INSERITO\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "CEPPO NON INSERITO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id è non valido\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "CEPPO NON INSERITO\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campagna $campaign è non valido\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCHIAMATA in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCHIAMATA - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCHIAMATA - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCHIAMATA - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send su to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user su $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten è non valido\n"; - exit; - } -else - { - ##### Insert a TERMINE record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','TERMINE','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation su the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id è non valido\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CHIAMATABACK ENTRY - if ( ($dispo_choice == 'CBHVECCHIO') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' è stato cambiato a ' . $dispo_choice . " Condizione\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id è non valido\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='$vendor_lead_code', title='$title', first_name='$first_name', middle_initial='$middle_initial', last_name='$last_name', address1='$address1', address2='$address2', address3='$address3', city='$city', state='$state', province='$province', postal_code='$postal_code', country_code='$country_code', gender='$gender', date_of_birth='$date_of_birth', alt_phone='$alt_phone', email='$email', security_phrase='$security_phrase', comments='$comments' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - echo "Lead $lead_id le informazioni sono state aggiornate\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage è non valido\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' è ora nella condizione ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list è non valido\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - - - -if ($format=='debug') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/vicidial.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/vicidial.php deleted file mode 100644 index 50c0c241..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/vicidial.php +++ /dev/null @@ -1,4633 +0,0 @@ - LICENSE: GPLv2 -### -### make sure you have added a user to the vicidial_users MySQL table with at least -### user_level 1 or greater to access this page. Also, you need to have the login -### and pass of a phone listed in the asterisk.phones table. The page grabs the -### server info and other details from this login and pass. -### -### This script works best with Firefox or Mozilla, but will run for a couple -### hours on Internet Explorer before the memory leaks cause a crash. -### -### Other scripts that this application depends on: -### - vdc_db_query.php: Updates information in the database -### - manager_send.php: Sends manager actions to the DB for execution -### -### CHANGES -### 50607-1426 - First Build of VICIDIAL web client basic login process finished -### 50628-1620 - Added some basic formatting and worked on process flow -### 50628-1715 - Startup variables mapped to javascript variables -### 50629-1303 - Added Login Closer in-groups selection box and vla update -### 50629-1530 - Rough layout for customer info form section and button links -### 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -### 50701-1450 - Added vicidial_log entries on dial and hangup -### 50701-1634 - Added Logout function -### 50705-1259 - Added call disposition functionality -### 50705-1432 - Added lead info DB update function -### 50705-1658 - Added web form functionality -### 50706-1043 - Added call park and pickup functions -### 50706-1234 - Added Start/Stop Recording functionality -### 50706-1614 - Added conference channels display option -### 50711-1333 - Removed call check redundancy and fixed a span bug -### 50727-1424 - Added customer channel and participant present sensing/alerts -### 50804-1057 - Added SendDTMF function and reconfigured the transfer span -### 50804-1224 - Added Local and Internal Closer transfer functions -### 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -### 50804-1808 - Added button images for left buttons -### 50815-1151 - Added 3Way calling functions to Transfer-conf frame -### 50815-1602 - Added images and buttons for xfer functions -### 50816-1813 - Added basic autodial outbound call pickup functions -### 50817-1113 - Fixes to auto_dialing call receipt -### 50817-1234 - Added inbound call receipt capability -### 50817-1541 - Added customer time display -### 50817-1541 - Added customer time display -### 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -### 50818-1703 - Added pretty login section -### 50825-1200 - Modified form field lengths, added double-click dispositions -### 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -### 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -### 50903-0904 - Added preview-lead code for manual dialing -### 50904-0016 - Added ability to hangup manual dials before pickup -### 50906-1319 - Added override for filters on xfer calls, fixed login display bug -### 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -### 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -### 50913-1212 - Added campaign_cid to 3rd party calls -### 50923-1546 - Modified to work with language translation -### 50926-1656 - Added campaign pull-down at login of active campaigns -### 50928-1633 - Added manual dial alternate number dial option -### 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -### 51004-1656 - Fixed recording filename bug and new Spanish translation -### 51020-1103 - Added campaign-specific recording control abilities -### 51020-1352 - Added Basic vicidial_agent_log framework -### 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -### 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -### 51110-1432 - Fixed non-standard http port issue -### 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -### 51118-1305 - Activate multi-line comments from $multi_line_comments var -### 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -### 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -### 51129-1010 - Added ability to accept calls from other VICIDIAL servers -### 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -### 51208-1732 - Created user-first login that looks for default phone info -### 51219-1526 - Added variable framework for campaign and in-group scripts -### 51221-1200 - Added SCRIPT tab, layout and functionality -### 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -### 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -### 51229-1028 - Added checks on web_form_address to allow for var in the DB value -### 60117-1312 - Added Transfer-conf frame toggle on button press -### 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -### 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -### 60213-1210 - Added ability to sort routing of calls by user_level -### 60214-0932 - Initial Callback calendar display framework -### 60214-1407 - Added ability to minimize the dispo screen to see info below -### 60215-1104 - Added ANYONE scheduled callbacks functionality -### - -require("dbconnect.php"); - -$DB=$_GET['DB']; if (!$DB) {$DB=$_POST["DB"];} -$phone_login=$_GET['phone_login']; if (!$phone_login) {$phone_login=$_POST["phone_login"];} - if (!$phone_login) {$phone_login=$_GET["pl"];} -$phone_pass=$_GET['phone_pass']; if (!$phone_pass) {$phone_pass=$_POST["phone_pass"];} - if (!$phone_pass) {$phone_pass=$_GET["pp"];} -$VD_login=$_GET['VD_login']; if (!$VD_login) {$VD_login=$_POST["VD_login"];} -$VD_pass=$_GET['VD_pass']; if (!$VD_pass) {$VD_pass=$_POST["VD_pass"];} -$VD_campaign=$_GET['VD_campaign']; if (!$VD_campaign) {$VD_campaign=$_POST["VD_campaign"];} - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); -$relogin=$_GET['relogin']; if (!$relogin) {$relogin=$_POST["relogin"];} - -$forever_stop=0; - -$version = '1.1.66'; -$build = '60215-1104'; - -if ($force_logout) -{ - echo "Ora avete annotato fuori. Grazie\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$manual_dial_preview = '1'; # Allow preview lead option when manual dial -$HKuser_level = '5'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_alt_phone = '1'; # allow manual dial users to call alt phone number -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "Web client di VICIMANOPOLA: Re-Inizio attività\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Inizio attività
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Campagna: $camp_form_code

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "Web client di VICIMANOPOLA: Inizio attività Di Campagna\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Inizio attività Dell'Utente

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività Di Campagna
 
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Campagna: $camp_form_code

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "Web client di VICIMANOPOLA: Inizio attività\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Campagna: $camp_form_code

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "Web client di VICIMANOPOLA: Inizio attività Del Telefono\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Inizio attività Del Telefono
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "La campagna non attiva, prova prego ancora
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "L'inizio attività errato, prova prego ancora
"; - } - } - if ($VDloginDISPLAY) - { - echo "Web client di VICIMANOPOLA: Inizio attività Di Campagna\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività Di Campagna
 
Inizio attività Dell'Utente:
Parola d'accesso Dell'Utente:
Campagna: $camp_form_code

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "Web client di VICIMANOPOLA: Inizio attività Del Telefono Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Inizio attività Error
 
Spiacente, il vostri inizio attività del telefono e parola d'accesso:
 
Inizio attività Del Telefono:
Parola d'accesso Del Telefono:

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "Web client di VICIMANOPOLA\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed su this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login su phone: $SIP_user alla campagna: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NUOVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "Web client di VICIMANOPOLA: VICIMANOPOLA Inizio attività Di Campagna\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Spiacenti, non ci sono cavi nella tramoggia per questa campagna\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Inizio attività: \n
"; - echo "Parola d'accesso:
\n"; - echo "Campagna: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "Web client di VICIMANOPOLA: VICIMANOPOLA Inizio attività Di Campagna\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Inizio attività: \n
"; - echo "Parola d'accesso:
\n"; - echo "Campagna: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -TERMINE\n"; ?> -
-
- - - - - - - - -
VICIMANOPOLASCRIPT   LIVE     ID di sessione: Vive La Chiamata
-
- - - - -

VICIMANOPOLA
-
- - - - -
- - Trasferimento - Congresso
- PIÙ VICINO INTERNO - LOCAL PIÙ VICINO - CODE - Linea Di Xfer Di Hangup - Hangup Entrambe le Linee - -
- - Numero da denominare   - secondi   - channel - - OVERRIDE   - D1 - D2 -
- - Manopola Con Il Cliente - Manopola Del Cliente Del Parco - CHIAMATA DI PERMESSO 3-WAY - Trasferimento Dei Ciechi Della Manopola - Blind Transfer VMail Message -
-
-
- - - - -
Cavo Dispositioned As:

- -
-
-
- - - - - - - -
Chiavi Calde Di Disposizione: - Una volta attivo, premi semplicemente la chiave di tastiera per la:
- - - - - -
-
- - -
Nessuno è nella vostra sessione:
- OK -
-
- - -
Il cliente ha appeso in su:
- OK -
-
- - -

TERMINE
-
- - -
-
- - -
 
-
- - -
Tutti i cambiamenti fatti al cliente che le informazioni qui sotto attualmente non saranno comitted, voi devono cambiare le informazioni del cliente prima di voi hangup la chiamata.
-
- - -
CHIAMATA DI DISPOSIZIONE :       minimizzi
- Estremità-de-denomini La Selezione Di Disposizione -
- SMETTA DI DENOMINARE
- RISISTEMAZIONE | - PRESENTI -



  -
-
- - - -
Selezioni una data di chiamata ripetuta :
- - - Selezioni una data qui sotto   -     - Hour: -   - Minutes: -   - -  
- - Osservazioni dei CB:

- - PRESENTI

- - -

  -
-
- - -
SELEZIONE DI GRUPPO INBOUND PIÙ VICINA
- Selezione Di Gruppo Inbound Più vicina -
- CHIAMATA MESCOLATA(outbound attivato)
- RISISTEMAZIONE | - PRESENTI -



  -
-
- - - - - - - - - - - -
TRASFERIMENTO IN TENSIONE DI CHIAMATA
Manica da trasferire: Manica
Estensioni:
Menu Di Estensioni
-
- Trasmetta all'estensione selezionata

- Trasmetta alla scatola selezionata del vmail

- _ trasmett questo numero:


- RINFRESCHI


- Di nuovo alla finestra principale

-
Congressi:
(scatti sopra un numero qui sotto per trasmettere ad un congresso)
Trasmetta la mia scanalatura anche
Menu Di Congressi
-
- - - - -
VICIMANOPOLA SCRIPT
-
- - - - - - - - - - - - - - - - - -
CONDIZIONE:
-
-Numero Seguente Della Manopola
- PREVISIONE DEL CAVO
";} -if ( ($manual_dial_alt_phone) and ($auto_dial_level==0) ) - {echo " ALT DEL TELEFONO
";} - - -?> -LIMA DI REGISTRAZIONE:
-
-
-IDENTIFICAZIONE ANNOTAZIONE:
-
- -Inizi A registrare
-
-Forma Di Fotoricettore
-
-Chiamata Del Parco
-Trasferimento - Congresso
-
-Cliente Di Hangup
-
-Trasmetta DTMF
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
secondi:   Manica:   Tempo Di Cust:
Le Informazioni Del Cliente:
Titolo:   In primo luogo:   Mi:  Ultimo:
Indirizzo1:
Indirizzo2:   Indirizzo3:
Città:   Dichiari:   PostCode:
Provincia:   Identificazione Del Fornitore:
Telefono:   DialCode:   Alt. Telefono:
Esposizione:   Email:
Osservazioni:
- -
-


  - -
- - - - -
Versione del fotoricettore-cliente di VICIMANOPOLA:     CONFIGURAZIONE:               Assistente:              
-Mostri le informazioni della scanalatura di chiamata di congresso
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -CHIAVI CALDE INATTIVE - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/voicemail_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/voicemail_check.php deleted file mode 100644 index 1f1b0989..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_it/voicemail_check.php +++ /dev/null @@ -1,130 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Non valido Utentename/Parola d'accesso: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Non valido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Controllo Di Voicemail"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "scatola del voicemail $vmail_box è non valido\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/active_list_refresh.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/active_list_refresh.php deleted file mode 100644 index 10e474ad..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/active_list_refresh.php +++ /dev/null @@ -1,446 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='table') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Exposição Da Lista: "; -if ($ADD==1) {echo "Extensões Vivas";} -if ($ADD==2) {echo "Extensões Ocupadas";} -if ($ADD==3) {echo "Linhas Exteriores";} -if ($ADD==4) {echo "Extensões Locais";} -if ($ADD==5) {echo "Conferências";} -if ($ADD==99999) {echo "AJUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ADD=1 display all live extensions on a server -###################### -if ($ADD==1) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'extension';} - if ($format=='table') {echo "\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - -###################### -# ADD=2 display all busy extensions on a server -###################### -if ($ADD==2) -{ - if (!$field_name) {$field_name = 'busyext';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=3 display all busy outside lines(trunks) on a server -###################### -if ($ADD==3) -{ - if (!$field_name) {$field_name = 'trunk';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=4 display all busy Local lines on a server -###################### -if ($ADD==4) -{ - if (!$field_name) {$field_name = 'local';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - -###################### -# ADD=5 display all agc-usable conferences on a server -###################### -if ($ADD==5) -{ - $pt='pt'; - if (!$field_name) {$field_name = 'conferences';} - if ($format=='table') {echo "
\n";} - if ($format=='menu') {echo "\n"; - } - if ($format=='textarea') - { - echo "\n";} -} - - - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='table') {echo "\n";} -if ($format=='table') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/astguiclient.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/astguiclient.php deleted file mode 100644 index 03f06226..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/astguiclient.php +++ /dev/null @@ -1,2874 +0,0 @@ - 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -$version = '1.1.9'; -$build = '60112-1622'; - -if ($force_logout) -{ - if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "Você tem registrado agora para fora. Obrigado\n"; - exit; -} - -$StarTtime = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd-His"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$US='_'; -$CL=':'; -$fp = fopen ("./astguiclient_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = $agcPAGE; -$agcDIR = eregi_replace('astguiclient.php','',$agcDIR); - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) - { - header ("Content-type: text/html; charset=utf-8"); - - echo "web client astGUIclient: Início de uma sessão\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão
 
Início de uma sessão Do Usuário:
Senha Do Usuário:
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - - if($auth>0) - { - $office_no=strtoupper($user); - $password=strtoupper($pass); - $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICISELETOR|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICISELETOR|FAIL|$date|$user|$pass|$ip|$browser|\n"); - fclose($fp); - } - } - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "web client astGUIclient: Início de uma sessão Do Telefone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Início de uma sessão Do Telefone
 
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "web client astGUIclient: Início de uma sessão Do Telefone\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão Do Telefone
 
Pesaroso, seus início de uma sessão do telefone e senha não seja:
 
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "web client astGUIclient\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $phone_login=$row[6]; - $phone_pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CaLLerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - - $local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL); - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtime$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'agc';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','agc','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT count(*) from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_present=$row[0]; - if ($favorites_present > 0) - { - $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favorites_list=$row[0]; - $h=0; - $favorites_listX = eregi_replace("'",'',$favorites_list); - $favorites = explode(',',$favorites_listX); - $favorites_count = count($favorites); - $favorites_listX=''; - - $o=0; - while ($favorites_count > $o) - { - $stmt="SELECT fullname,protocol from phones where extension = '$favorites[$o]' and server_ip='$server_ip';"; - $rsltx=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rsltx); - $favorites_names[$o] = $rowx[0]; - $favorites_listX .= "$rowx[1]/$favorites[$o],"; - $o++; - } - - echo "\n"; - echo "\n"; - } - else - { - echo "\n"; - } - -### gather phone extensions and fullnames for favorites editor ### - $stmt="SELECT extension,fullname from phones where server_ip = '$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $exten_ct = mysql_num_rows($rslt); - $favlistCT=0; - $nofavlistCT=0; - while ($favlistCT < $exten_ct) - { - $row=mysql_fetch_row($rslt); - $favlist[$favlistCT]= "$row[0] - $row[1]"; - $favlistCT++; - } - - } -} - - -?> - - - - - - -\n"; - - -?> - -
- - - - - - - - - -
- - -LOGOUT
\n"; ?> -
Painel PrincipalLinhas Ativas PainelPainel Das ConferênciasVerifique VoicemailVive A Chamada
-
- - -

Logout
-
- - -
TRUNK HANGUP

- Active Trunks Menu
- Tronco Do Hangup   |   - Tronco Do Hijack   |   - Escuta O Tronco   |   - Refresque   |   - Para trás à janela principal -
-
- - -
HANGUP LOCAL

- Menu Local Ativo
- Local Do Hangup   |   - Local Do Hijack   |   - Escuta O Local   |   - Refresque   |   - Para trás à janela principal -
-
- - - - - - - -
TRANSFERÊNCIA VIVA DA CHAMADA
Canaleta a ser transferida: Canaleta
Extensões:
Menu Das Extensões
-
- Emita à extensão selecionada

- Emita à caixa selecionada do vmail

- Emita a este número:


- Refresque


- Para trás à janela principal

-
Conferências:
(estale sobre um número abaixo para emitir a uma conferência)
Emita minha canaleta demasiado
Menu Das Conferências
-
- - - - - -
Seletor LOCAL Das Extensões
Telefone que chama-se de: Canaleta
Extensões:
Menu Das Extensões
-
- Extensão selecionada chamada

- Caixa selecionada chamada do vmail

- Refresque


- Para trás à janela principal

-
-
- - -
CHAMADAS ESTACIONADAS:
- Para trás à janela principal

-
-
- - - - - - - - - - - - - - - -
  -
VOICEMAIL     NOVO:     VELHO:             SELETOR MANUAL       SELETOR
CHAMADAS ESTACIONADAS: 0                EXTENSÕES LOCAIS DO SELETOR
CHAMADAS OUTBOUND :
CHAMADAS INBOUND:
VERSÃO astGUIclient do correia-cliente: CONFIGURAÇÃO:
- - - - $h) - { - if (strlen($favorites[$h])>1) - { - echo "\n"; - } - $h++; - } -?> - -
FAVORITOS       edite
$favorites[$h] - $favorites_names[$h]
 
-
- - - - - - - -
FAVORITOS

 
SUBMETA FAVORITOS CHANGES - requires logout
PARA TRÁS À JANELA PRINCIPAL - ignore as mudanças feitas
-
- -
- - - - - - - - - - - - - -
-PAUSA | COMEÇO     Refresque a taxa: 1000 ms Mais rapidamente | Mais lento

-
Inicializar..
-
Extensões Ativas
-REFRESQUE | -ORDEM | -
Linhas Exteriores
-REFRESQUE | -ORDEM | -
Extensões Locais
-REFRESQUE | -ORDEM | -
- Os Dados Vão Aqui

-
- Os Dados Vão Aqui

Ação Do Tronco -
- Os Dados Vão Aqui

Ação Local -
-
- - - - -
- - -Lista Das Conferências - - - -
-Estale sobre um número de quarto da conferência na esquerda para o -
- - - - - - - - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/call_log_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/call_log_display.php deleted file mode 100644 index 2a9a0758..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/call_log_display.php +++ /dev/null @@ -1,181 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Exposição Do Registro Da Chamada"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten é inválido ou protocolo $protocol é inválido\n"; - exit; - } - else - { - ##### print outbound calls from the call_log table - $stmt="SELECT uniqueid,start_time,number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$out_calls_count = mysql_num_rows($rslt);} - echo "$out_calls_count|"; - $loop_count=0; - while ($out_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[3] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - - echo "$row[0] ~$row[1] ~$row[2] ~$call_time_MS|"; - } - echo "\n"; - - ##### print inbound calls from the live_inbound_log table - $stmt="SELECT call_log.uniqueid,live_inbound_log.start_time,live_inbound_log.extension,caller_id,length_in_sec from live_inbound_log,call_log where phone_ext='$exten' and live_inbound_log.server_ip = '$server_ip' and call_log.uniqueid=live_inbound_log.uniqueid order by start_time desc limit $in_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$in_calls_count = mysql_num_rows($rslt);} - echo "$in_calls_count|"; - $loop_count=0; - while ($in_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - - $call_time_M = ($row[4] / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $callerIDnum = $row[3]; $callerIDname = $row[3]; - $callerIDnum = preg_replace("/.*<|>.*/","",$callerIDnum); - $callerIDname = preg_replace("/\"| <\d*>/","",$callerIDname); - - echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|"; - } - echo "\n"; - - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/conf_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/conf_exten_check.php deleted file mode 100644 index c02f22b7..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/conf_exten_check.php +++ /dev/null @@ -1,213 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Verificação Da Extensão De Conf"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - if ($ACTION == 'refresh') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($conf_exten)<1) - { - $channel_live=0; - echo "Conf Exten $conf_exten é inválido\n"; - exit; - } - else - { - - if ($client == 'vdc') - { - if ($auto_dial_level > 0) - { - ### update the vicidial_live_agents every second with a new random number so it is shown to be alive - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . "|\n"; - - } - $total_conf=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$sip_list = mysql_num_rows($rslt);} - # echo "$sip_list|"; - $loop_count=0; - while ($sip_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanaletaA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and extension = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - # echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; $total_conf++; - $row=mysql_fetch_row($rslt); - $CanaletaA[$total_conf] = "$row[0]"; - if ($format=='debug') {echo "\n";} - } - } - $channels_list = ($channels_list + $sip_list); - echo "$channels_list|"; - - $counter=0; - $countecho=''; - while($total_conf > $counter) - { - $counter++; - $countecho = "$countecho$CanaletaA[$counter] ~"; - # echo "$CanaletaA[$counter] ~"; - } - - echo "$countecho\n"; - } - - if ($ACTION == 'register') - { - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($exten)<1) ) - { - $channel_live=0; - echo "Conf Exten $conf_exten é inválido or Exten $exten é inválido\n"; - exit; - } - else - { - $stmt="UPDATE conferences set extension='$exten' where server_ip = '$server_ip' and conf_exten = '$conf_exten';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - echo "Conferência $conf_exten foi registado a $exten\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/dbconnect.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/dbconnect.php deleted file mode 100644 index 1662f18f..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/dbconnect.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/inbound_popup.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/inbound_popup.php deleted file mode 100644 index c85eb868..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/inbound_popup.php +++ /dev/null @@ -1,335 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -$forever_stop=0; -$user_abb = "$user$user$user$user"; -while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - -echo "\n"; -echo "\n"; -echo "\n"; -?> - - -CHAMADA INBOUND VIVA"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "

CHAMADA INBOUND VIVA

\n"; -echo "$NOW_TIME

\n"; -} - - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if (strlen($uniqueid)<9) - { - $channel_live=0; - echo "Uniqueid $uniqueid é inválido\n"; - exit; - } - else - { - $stmt="SELECT * FROM live_inbound where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $channels_list = mysql_num_rows($rslt); - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); -# echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; -# Zap/73|"V.I.C.I. MARKET" <7275338730>|2005-04-28 14:01:21|7274514936|Inbound direct to Matt||||| - if ($format=='debug') {echo "\n";} - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Canaleta: $row[1]
CallerID: $row[3]
\n"; - - $phone = eregi_replace(".*\<","",$row[3]); - $phone = eregi_replace("\>.*","",$phone); - $NPA = substr($phone, 0, 3); - $NXX = substr($phone, 3, 3); - $XXXX = substr($phone, 6, 4); - $D='-'; - echo "GOOGLE - \n"; - echo "ANYWHO - \n"; - echo "SWITCHBOARD - \n"; - echo "VERIZON - \n"; - echo "WHITEPAGES - \n"; - echo "411.COM - \n"; - echo "411.COM - \n"; - - $local_web_callerID_QUERY_STRING =''; - $local_web_callerID_QUERY_STRING.="?callerID_areacode=$NPA"; - $local_web_callerID_QUERY_STRING.="&callerID_prefix=$NXX"; - $local_web_callerID_QUERY_STRING.="&callerID_last4=$XXXX"; - $local_web_callerID_QUERY_STRING.="&callerID_Time=$row[6]"; - $local_web_callerID_QUERY_STRING.="&callerID_Canaleta=$row[1]"; - $local_web_callerID_QUERY_STRING.="&callerID_uniqueID=$row[0]"; - $local_web_callerID_QUERY_STRING.="&callerID_phone_ext=$row[5]"; - $local_web_callerID_QUERY_STRING.="&callerID_server_ip=$row[2]"; - $local_web_callerID_QUERY_STRING.="&callerID_extension=$row[4]"; - $local_web_callerID_QUERY_STRING.="&callerID_inbound_number=$row[8]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_a=$row[9]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_b=$row[10]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_c=$row[11]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_d=$row[12]"; - $local_web_callerID_QUERY_STRING.="&callerID_comment_e=$row[13]"; - echo "COSTUME - \n"; - - echo "
O Número Marcou: $row[8]
Notas: $row[9]|$row[10]|$row[11]|$row[12]|$row[13]|
\n"; - echo "HANGUP - \n"; - echo "EMITA A MEU VOICEMAIL\n"; - echo "
\n"; - - - $stmt="UPDATE live_inbound set acknowledged='Y' where server_ip = '$server_ip' and uniqueid = '$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - - } - - - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/live_exten_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/live_exten_check.php deleted file mode 100644 index f839e3cf..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/live_exten_check.php +++ /dev/null @@ -1,263 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Verificação Viva Da Extensão"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -echo "DateTime: $NOW_TIME|"; -echo "UnixTime: $StarTtime|"; - -$stmt="SELECT count(*) FROM parked_channels where server_ip = '$server_ip';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -echo "$row[0]|"; - - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten é inválido ou protocolo $protocol é inválido\n"; - exit; - } - else - { - $stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$channels_list = mysql_num_rows($rslt);} - echo "$channels_list|"; - $loop_count=0; - while ($channels_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - $CanaletaA[$loop_count] = "$row[0]"; - $CanaletaB[$loop_count] = "$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - $counter=0; - while($loop_count > $counter) - { - $counter++; - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$CanaletaA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$CanaletaA[$counter]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$CanaletaB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $row[0]|"; - } - else - { - $stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$CanaletaB[$counter]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$trunk_count = mysql_num_rows($rslt);} - if ($trunk_count>0) - { - $row=mysql_fetch_row($rslt); - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $row[0]|"; - } - else - { - echo "Conversation: $counter ~"; - echo "CanaletaA: $CanaletaA[$counter] ~"; - echo "CanaletaB: $CanaletaB[$counter] ~"; - echo "CanaletaBtrunk: $CanaletaA[$counter]|"; - } - } - } - } - } - -echo "\n"; - -### check for live_inbound entry -$stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext = '$exten' and acknowledged='N';"; - if ($format=='debug') {echo "\n";} -$rslt=mysql_query($stmt, $link); -if ($rslt) {$channels_list = mysql_num_rows($rslt);} - if ($channels_list>0) - { - $row=mysql_fetch_row($rslt); - $LIuniqueid = "$row[0]"; - $LIchannel = "$row[1]"; - $LIcallerid = "$row[3]"; - $LIdatetime = "$row[6]"; - echo "$LIuniqueid|$LIchannel|$LIcallerid|$LIdatetime|$row[8]|$row[9]|$row[10]|$row[11]|$row[12]|$row[13]|"; - if ($format=='debug') {echo "\n";} - } - -echo "\n"; - - -### if favorites are present do a lookup to see if any are active -if ($favorites_count > 0) - { - $favorites = explode(',',$favorites_list); - $h=0; - $favs_print=''; - while ($favorites_count > $h) - { - $fav_extension = explode('/',$favorites[$h]); - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$favorites[$h]%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $favs_print .= "$fav_extension[1]: $row[0] ~"; - $h++; - } - echo "$favs_print\n"; - } - -if ($format=='debug') {echo "\n";} - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/manager_send.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/manager_send.php deleted file mode 100644 index 55983aff..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/manager_send.php +++ /dev/null @@ -1,882 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectVD','HangupConfDial') -### - $queryCID - ('CN012345678901234567',...) -### - $format - ('text','debug') -### - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $exten - ('1234','913125551212',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $filename - ('20050406-125623_44444',...) -### - $extenName - ('phone100',...) -### - $parkedby - ('phone100',...) -### - $extrachannel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) -### - $auto_dial_level - ('0','1','1.1',...) -### - $campaign - ('CLOSER','TESTCAMP',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('1234',...) -### - $seconds - ('32',...) -### - $outbound_cid - ('3125551212','0000000000',...) -### - $agent_log_id - ('123456',...) -### - $call_server_ip - ('10.10.10.15',...) -### - $CalLCID - ('VD01234567890123456',...) -### - -# changes -# 50401-1002 First build of script, Hangup function only -# 50404-1045 Redirect basic function enabled -# 50406-1522 Monitor basic function enabled -# 50407-1647 Monitor and StopMonitor full functions enabled -# 50422-1120 basic Originate function enabled -# 50428-1451 basic SysCIDOriginate function enabled for checking voicemail -# 50502-1539 basic RedirectName and RedirectNameVmail added -# 50503-1227 added session_name checking for extra security -# 50523-1341 added Conference call start/stop recording -# 50523-1421 added OriginateName and OriginateNameVmail for local calls -# 50524-1602 added RedirectToPark and RedirectFromPark -# 50531-1203 added RedirecXtra for dual channel redirection -# 50630-1100 script changed to not use HTTP login vars, user/pass instead -# 50804-1148 Added RedirectVD for VICIDIAL blind redirection with logging -# 50815-1204 Added NEXTAVAILABLE to RedirectXtra function -# 50903-2343 Added HangupConfDial function to hangup in-dial channels in conf -# 50913-1057 Added outbound_cid set if present to originate call -# 51020-1556 Added agent_log_id framework for detailed agent activity logging -# 51118-1204 Fixed Blind transfer bug from VICIDIAL when in manual dial mode -# 51129-1014 Added ability to accept calls from other VICIDIAL servers -# 51129-1253 Fixed Hangups of other agents channels in VICIDIAL AD -# 60310-2022 Fixed NEXTAVAILABLE bug in leave-3way-call redirect function -# - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### These are variable assignments for PHP globals off -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$queryCID=$_GET["queryCID"]; if (!$queryCID) {$queryCID=$_POST["queryCID"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$filename=$_GET["filename"]; if (!$filename) {$filename=$_POST["filename"];} -$extenName=$_GET["extenName"]; if (!$extenName) {$extenName=$_POST["extenName"];} -$parkedby=$_GET["parkedby"]; if (!$parkedby) {$parkedby=$_POST["parkedby"];} -$extrachannel=$_GET["extrachannel"]; if (!$extrachannel) {$extrachannel=$_POST["extrachannel"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$secondS=$_GET["secondS"]; if (!$secondS) {$secondS=$_POST["secondS"];} -$outbound_cid=$_GET["outbound_cid"]; if (!$outbound_cid) {$outbound_cid=$_POST["outbound_cid"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$call_server_ip=$_GET["call_server_ip"]; if (!$call_server_ip) {$call_server_ip=$_POST["call_server_ip"];} -$CalLCID=$_GET["CalLCID"]; if (!$CalLCID) {$CalLCID=$_POST["CalLCID"];} - -# default optional vars if not set -if (!$ACTION) {$ACTION="Originate";} -if (!$format) {$format="alert";} -if (!$ext_priority) {$ext_priority="1";} - - -$version = '0.0.22'; -$build = '60310-2022'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!$query_date) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "O Gerente Emite: "; -if ($ACTION=="Originate") {echo "Originate";} -if ($ACTION=="Redirect") {echo "Redirect";} -if ($ACTION=="RedirectName") {echo "RedirectName";} -if ($ACTION=="Hangup") {echo "Hangup";} -if ($ACTION=="Command") {echo "Command";} -if ($ACTION==99999) {echo "AJUDA";} -echo "\n"; -echo "\n"; -echo "\n"; -} - - - - - -###################### -# ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls -###################### -if ($ACTION=="SysCIDOriginate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<1) ) - { - echo "Exten $exten é inválido or queryCID $queryCID é inválido, Originate comando não introduzido\n"; - } - else - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando emitido para Exten $exten Canaleta $channel em $server_ip\n"; - } -} - - - -###################### -# ACTION=Originate, OriginateName, OriginateNameVmail - insert Originate Manager statement -###################### -if ($ACTION=="OriginateName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nOriginateName Action não emitido\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="OriginateNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nOriginateNameVmail Action não emitido\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Originate"; - } - } -} - -if ($ACTION=="Originate") -{ - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) - { - echo "Exten $exten é inválido or queryCID $queryCID é inválido, Originate comando não introduzido\n"; - } - else - { - if (strlen($outbound_cid)>1) - {$outCID = "\"$queryCID\" <$outbound_cid>";} - else - {$outCID = "$queryCID";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Originate comando emitido para Exten $exten Canaleta $channel em $server_ip\n"; - } -} - - - -###################### -# ACTION=HangupConfDial - find the Local channel that is in the conference and needs to be hung up -###################### -if ($ACTION=="HangupConfDial") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "conference $exten é inválido or ext_context $ext_context or queryCID $queryCID é inválido, Hangup comando não introduzido\n"; - } - else - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $hangup_channel_prefix = "$local_DEF$exten$local_AMP$ext_context"; - - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row > 0) - { - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - $channel=$rowx[0]; - $ACTION="Hangup"; - $queryCID = eregi_replace("^.","G",$queryCID); - } - } -} - - - -###################### -# ACTION=Hangup - insert Hangup Manager statement -###################### -if ($ACTION=="Hangup") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) ) - { - $channel_live=0; - echo "Canaleta $channel é inválido or queryCID $queryCID é inválido, Hangup comando não introduzido\n"; - } - else - { - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - -# $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# if ($row[0]==0) -# { -# $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; -# if ($format=='debug') {echo "\n";} -# $rslt=mysql_query($stmt, $link); -# $rowx=mysql_fetch_row($rslt); -# if ($rowx[0]==0) -# { -# $channel_live=0; -# echo "Channel $channel is not live on $call_server_ip, Hangup command not inserted\n"; -# } -# } - if ( ($auto_dial_level > 0) and (strlen($CalLCID)>2) and (strlen($exten)>2) and ($secondS > 4)) - { - $stmt="SELECT count(*) FROM vicidial_auto_calls where channel='$channel' and callerid='$CalLCID';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - echo "Call $CalLCID $channel não está vivo em $call_server_ip, Checking Live Canaleta...\n"; - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel' and extension LIKE \"%$exten\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $channel_live=0; - echo "Canaleta $channel não está vivo em $call_server_ip, Hangup comando não introduzido $rowx[0]\n$stmt\n"; - } - else - { - echo "$stmt\n"; - } - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Hangup','$queryCID','Channel: $channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - echo "Hangup comando emitido para Canaleta $channel em $call_server_ip\n"; - } - } -} - - - -###################### -# ACTION=Redirect, RedirectName, RedirectNameVmail, RedirectToPark, RedirectFromPark, RedirectVD -# - insert Redirect Manager statement using extensions name -###################### -if ($ACTION=="RedirectVD") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($campaign)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($uniqueid)<2) or (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "auto_dial_level $auto_dial_level deve ser ajustado\n"; - echo "campaign $campaign deve ser ajustado\n"; - echo "uniqueid $uniqueid deve ser ajustado\n"; - echo "lead_id $lead_id deve ser ajustado\n"; - echo "\nRedirectVD Action não emitido\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level < 1) - { - $stmt = "UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectToPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "parkedby $parkedby deve ser ajustado\n"; - echo "\nRedirectToPark Action não emitido\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','','$extenName','$parkedby','$NOW_TIME');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectFromPark") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirectFromPark Action não emitido\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $ACTION="Redirect"; - } -} - -if ($ACTION=="RedirectName") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirectName Action não emitido\n"; - } - else - { - $stmt="SELECT dialplan_number FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = $row[0]; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectNameVmail") -{ - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "extenName $extenName deve ser ajustado\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirectNameVmail Action não emitido\n"; - } - else - { - $stmt="SELECT voicemail_id FROM phones where server_ip = '$server_ip' and extension='$extenName';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $name_count = mysql_num_rows($rslt); - if ($name_count>0) - { - $row=mysql_fetch_row($rslt); - $exten = "$exten$row[0]"; - $ACTION="Redirect"; - } - } -} - -if ($ACTION=="RedirectXtra") -{ - if ($channel=="$extrachannel") - {$ACTION="Redirect";} - else - { - $row=''; $rowx=''; - $channel_liveX=1; - $channel_liveY=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) ) - { - $channel_liveX=0; - $channel_liveY=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "ExtraCanaleta $extrachannel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirect Action não emitido\n"; - } - else - { - if ($exten == "NEXTAVAILABLE") - { - $stmt="SELECT conf_exten FROM conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 3) - { - $stmt="UPDATE conferences set extension='$user' where server_ip='$server_ip' and conf_exten='$row[0]';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $exten = $row[0]; - } - else - { - $channel_liveX=0; - echo "Não pode encontrar a conferência vazia em $server_ip, Redirect comando não introduzido\n"; - } - } - - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - - $stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveX=0; - echo "Canaleta $channel não está vivo em $call_server_ip, Redirect comando não introduzido\n"; - } - } - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_liveY=0; - echo "Canaleta $channel não está vivo em $server_ip, Redirect comando não introduzido\n"; - } - } - if ( ($channel_liveX==1) && ($channel_liveY==1) ) - { - if ( ($server_ip=="$call_server_ip") or (strlen($call_server_ip)<7) ) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','ExtraChannel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando emitido para Canaleta $channel and \nExtraCanaleta $extrachannel\n to $exten em $server_ip\n"; - } - else - { - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$exten"; - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $extrachannel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "RedirectXtra comando emitido para Canaleta $channel em $call_server_ip and \nExtraCanaleta $extrachannel\n to $exten em $server_ip\n"; - } - } - else - { - if ($channel_liveX==1) - {$ACTION="Redirect"; $server_ip = $call_server_ip;} - if ($channel_liveY==1) - {$ACTION="Redirect"; $channel=$extrachannel;} - - } - } - } -} - - -if ($ACTION=="Redirect") -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) - { - $channel_live=0; - echo "Uma destas variáveis é inválido:\n"; - echo "Canaleta $channel deve ser mais grande de 2 caráteres\n"; - echo "queryCID $queryCID deve ser mais grande de 14 caráteres\n"; - echo "exten $exten deve ser ajustado\n"; - echo "ext_context $ext_context deve ser ajustado\n"; - echo "ext_priority $ext_priority deve ser ajustado\n"; - echo "\nRedirect Action não emitido\n"; - } - else - { - if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canaleta $channel não está vivo em $server_ip, Redirect comando não introduzido\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','CallerID: $queryCID','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "Redirect comando emitido para Canaleta $channel em $server_ip\n"; - } - } -} - - - -###################### -# ACTION=Monitor or Stop Monitor - insert Monitor/StopMonitor Manager statement to start recording on a channel -###################### -if ( ($ACTION=="Monitor") || ($ACTION=="StopMonitor") ) -{ - if ($ACTION=="StopMonitor") - {$SQLfile = "";} - else - {$SQLfile = "File: $filename";} - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canaleta $channel é inválido or queryCID $queryCID é inválido or filename: $filename é inválido, $ACTION comando não introduzido\n"; - } - else - { - $stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0]==0) - { - $stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$channel';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $rowx=mysql_fetch_row($rslt); - if ($rowx[0]==0) - { - $channel_live=0; - echo "Canaleta $channel não está vivo em $server_ip, $ACTION comando não introduzido\n"; - } - } - if ($channel_live==1) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','$ACTION','$queryCID','Channel: $channel','$SQLfile','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($ACTION=="Monitor") - { - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - } - echo "$ACTION comando emitido para Canaleta $channel em $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n"; - } - } -} - - - - - - -###################### -# ACTION=MonitorConf or StopMonitorConf - insert Monitor/StopMonitor Manager statement to start recording on a conference -###################### -if ( ($ACTION=="MonitorConf") || ($ACTION=="StopMonitorConf") ) -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15) ) - { - $channel_live=0; - echo "Canaleta $channel é inválido or exten $exten é inválido or filename: $filename é inválido, $ACTION comando não introduzido\n"; - } - else - { - - if ($ACTION=="MonitorConf") - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename')"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="SELECT recording_id FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - } - else - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rec_count = mysql_num_rows($rslt); - if ($rec_count>0) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename'"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - # find and hang up all recordings going em in this conference # and extension = '$exten' - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - # $rec_count = intval(mysql_num_rows($rslt) / 2); - $rec_count = mysql_num_rows($rslt); - $h=0; - while ($rec_count>$h) - { - $rowx=mysql_fetch_row($rslt); - $HUchannel[$h] = $rowx[0]; - $h++; - } - $i=0; - while ($h>$i) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $i++; - } - - } - echo "$ACTION comando emitido para Canaleta $channel em $server_ip\nFilename: $filename\nRecorDing_ID: $recording_id\n A GRAVAÇÃO DURARÁ ATÉ 60 MINUTOS\n"; - } -} - - - - - - - - - - - - -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -if ($format=='debug') {echo "\n";} -if ($format=='debug') {echo "\n\n\n";} - -exit; - -?> - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/park_calls_display.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/park_calls_display.php deleted file mode 100644 index ab87a35d..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/park_calls_display.php +++ /dev/null @@ -1,136 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Exposição Estacionada Das Chamadas"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($exten)<1) or (strlen($protocol)<3) ) - { - $channel_live=0; - echo "Exten $exten é inválido ou protocolo $protocol é inválido\n"; - exit; - } - else - { - ##### print parked calls from the parked_channels table - $stmt="SELECT * from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $park_calls_count = mysql_num_rows($rslt); - echo "$park_calls_count\n"; - $loop_count=0; - while ($park_calls_count>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0] ~$row[2] ~$row[3] ~$row[4] ~$row[5]|"; - } - echo "\n"; - } - - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/vdc_db_query.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/vdc_db_query.php deleted file mode 100644 index 3147dc73..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/vdc_db_query.php +++ /dev/null @@ -1,1289 +0,0 @@ - LICENSE: GPLv2 -### -### This script is designed purely to send whether the meetme conference has live channels connected and which they are -### This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table -### -### required variables: -### - $server_ip -### - $session_name -### - $user -### - $pass -### optional variables: -### - $format - ('text','debug') -### - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs') -### - $stage - ('start','finish') -### - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') -### - $conf_exten - ('8600011',...) -### - $exten - ('123test',...) -### - $ext_context - ('default','demo',...) -### - $ext_priority - ('1','2',...) -### - $campaign - ('testcamp',...) -### - $dial_timeout - ('60','26',...) -### - $dial_prefix - ('9','8',...) -### - $campaign_cid - ('3125551212','0000000000',...) -### - $MDnextCID - ('M06301413000000002',...) -### - $uniqueid - ('1120232758.2406800',...) -### - $lead_id - ('36524',...) -### - $list_id - ('101','123456',...) -### - $length_in_sec - ('12',...) -### - $phone_code - ('1',...) -### - $phone_number - ('3125551212',...) -### - $channel - ('Zap/12-1',...) -### - $start_epoch - ('1120236911',...) -### - $vendor_lead_code - ('1234test',...) -### - $title - ('Mr.',...) -### - $first_name - ('Bob',...) -### - $middle_initial - ('L',...) -### - $last_name - ('Wilson',...) -### - $address1 - ('1324 Main St.',...) -### - $address2 - ('Apt. 12',...) -### - $address3 - ('co Robert Wilson',...) -### - $city - ('Chicago',...) -### - $state - ('IL',...) -### - $province - ('NA',...) -### - $postal_code - ('60054',...) -### - $country_code - ('USA',...) -### - $gender - ('M',...) -### - $date_of_birth - ('1970-01-01',...) -### - $alt_phone - ('3125551213',...) -### - $email - ('bob@bob.com',...) -### - $security_phrase - ('Hello',...) -### - $comments - ('Good Customer',...) -### - $auto_dial_level - ('0','1','1.2',...) -### - $VDstop_rec_after_each_call - ('0','1') -### - $conf_silent_prefix - ('7','8','',...) -### - $extension - ('123','user123','25-1',...) -### - $protocol - ('Zap','SIP','IAX2',...) -### - $user_abb - ('1234','6666',...) -### - $preview - ('YES','NO',...) -### - $called_count - ('0','1','2',...) -### - $agent_log_id - ('123456',...) -### - $agent_log - ('NO',...) -### - $favorites_list - (",'cc160','cc100'",...) -### - -# changes -# 50629-1044 First build of script -# 50630-1422 Added manual dial action and MD channel lookup -# 50701-1451 Added dial log for start and end of vicidial calls -# 50705-1239 Added call disposition update -# 50804-1627 Fixed updateDispo to update vicidial_log entry -# 50816-1605 Added VDADpause/ready for auto dialing -# 50816-1811 Added basic autodial call pickup functions -# 50817-1005 Altered logging functions to accomodate auto_dialing -# 50818-1305 Added stop-all-recordings-after-each-vicidial-call option -# 50818-1411 Added hangup of agent phone after Logout -# 50901-1315 Fixed CLOSER IN-GROUP Web Form bug -# 50902-1507 Fixed CLOSER log length_in_sec bug -# 50902-1730 Added functions for manual preview dialing and revert -# 50913-1214 Added agent random update to leadupdate -# 51020-1421 Added agent_log_id framework for detailed agent activity logging -# 51021-1717 Allows for multi-line comments (changes \n to !N in database) -# 51111-1046 Added vicidial_agent_log lead_id earlier for manual dial -# 51121-1445 Altered echo statements for several small PHP speed optimizations -# 51122-1328 Fixed UserLogout issue not removing conference reservation -# 51129-1012 Added ability to accept calls from other VICIDIAL servers -# 51129-1729 Changed manual dial to use the '/n' flag for calls -# 51221-1154 Added SCRIPT id lookup and sending to vicidial.php for display -# 60105-1059 Added Updating of astguiclient favorites in the DB -# 60208-1617 Added dtmf buttons output per call -# 60213-1521 Added closer_campaigns update to vicidial_users -# 60215-1036 Added Callback date-time entry into vicidial_callbacks table -# - -$version = '0.0.26'; -$build = '60215-1036'; - - -require("dbconnect.php"); - -#require_once("htglobalize.php"); - -### If you have globals turned off uncomment these lines -$user=$_GET["user"]; if (!$user) {$user=$_POST["user"];} -$pass=$_GET["pass"]; if (!$pass) {$pass=$_POST["pass"];} -$server_ip=$_GET["server_ip"]; if (!$server_ip) {$server_ip=$_POST["server_ip"];} -$session_name=$_GET["session_name"]; if (!$session_name) {$session_name=$_POST["session_name"];} -$format=$_GET["format"]; if (!$format) {$format=$_POST["format"];} -$ACTION=$_GET["ACTION"]; if (!$ACTION) {$ACTION=$_POST["ACTION"];} -$stage=$_GET["stage"]; if (!$stage) {$stage=$_POST["stage"];} -$closer_choice=$_GET["closer_choice"]; if (!$closer_choice) {$closer_choice=$_POST["closer_choice"];} -$conf_exten=$_GET["conf_exten"]; if (!$conf_exten) {$conf_exten=$_POST["conf_exten"];} -$exten=$_GET["exten"]; if (!$exten) {$exten=$_POST["exten"];} -$ext_context=$_GET["ext_context"]; if (!$ext_context) {$ext_context=$_POST["ext_context"];} -$ext_priority=$_GET["ext_priority"]; if (!$ext_priority) {$ext_priority=$_POST["ext_priority"];} -$campaign=$_GET["campaign"]; if (!$campaign) {$campaign=$_POST["campaign"];} -$dial_timeout=$_GET["dial_timeout"]; if (!$dial_timeout) {$dial_timeout=$_POST["dial_timeout"];} -$dial_prefix=$_GET["dial_prefix"]; if (!$dial_prefix) {$dial_prefix=$_POST["dial_prefix"];} -$campaign_cid=$_GET["campaign_cid"]; if (!$campaign_cid) {$campaign_cid=$_POST["campaign_cid"];} -$MDnextCID=$_GET["MDnextCID"]; if (!$MDnextCID) {$MDnextCID=$_POST["MDnextCID"];} -$uniqueid=$_GET["uniqueid"]; if (!$uniqueid) {$uniqueid=$_POST["uniqueid"];} -$lead_id=$_GET["lead_id"]; if (!$lead_id) {$lead_id=$_POST["lead_id"];} -$list_id=$_GET["list_id"]; if (!$list_id) {$list_id=$_POST["list_id"];} -$length_in_sec=$_GET["length_in_sec"]; if (!$length_in_sec) {$length_in_sec=$_POST["length_in_sec"];} -$phone_code=$_GET["phone_code"]; if (!$phone_code) {$phone_code=$_POST["phone_code"];} -$phone_number=$_GET["phone_number"]; if (!$phone_number) {$phone_number=$_POST["phone_number"];} -$channel=$_GET["channel"]; if (!$channel) {$channel=$_POST["channel"];} -$start_epoch=$_GET["start_epoch"]; if (!$start_epoch) {$start_epoch=$_POST["start_epoch"];} -$dispo_choice=$_GET["dispo_choice"]; if (!$dispo_choice) {$dispo_choice=$_POST["dispo_choice"];} -$vendor_lead_code=$_GET["vendor_lead_code"]; if (!$vendor_lead_code) {$vendor_lead_code=$_POST["vendor_lead_code"];} -$title=$_GET["title"]; if (!$title) {$title=$_POST["title"];} -$first_name=$_GET["first_name"]; if (!$first_name) {$first_name=$_POST["first_name"];} -$middle_initial=$_GET["middle_initial"]; if (!$middle_initial) {$middle_initial=$_POST["middle_initial"];} -$last_name=$_GET["last_name"]; if (!$last_name) {$last_name=$_POST["last_name"];} -$address1=$_GET["address1"]; if (!$address1) {$address1=$_POST["address1"];} -$address2=$_GET["address2"]; if (!$address2) {$address2=$_POST["address2"];} -$address3=$_GET["address3"]; if (!$address3) {$address3=$_POST["address3"];} -$city=$_GET["city"]; if (!$city) {$city=$_POST["city"];} -$state=$_GET["state"]; if (!$state) {$state=$_POST["state"];} -$province=$_GET["province"]; if (!$province) {$province=$_POST["province"];} -$postal_code=$_GET["postal_code"]; if (!$postal_code) {$postal_code=$_POST["postal_code"];} -$country_code=$_GET["country_code"]; if (!$country_code) {$country_code=$_POST["country_code"];} -$gender=$_GET["gender"]; if (!$gender) {$gender=$_POST["gender"];} -$date_of_birth=$_GET["date_of_birth"]; if (!$date_of_birth) {$date_of_birth=$_POST["date_of_birth"];} -$alt_phone=$_GET["alt_phone"]; if (!$alt_phone) {$alt_phone=$_POST["alt_phone"];} -$email=$_GET["email"]; if (!$email) {$email=$_POST["email"];} -$security_phrase=$_GET["security_phrase"]; if (!$security_phrase) {$security_phrase=$_POST["security_phrase"];} -$comments=$_GET["comments"]; if (!$comments) {$comments=$_POST["comments"];} -$auto_dial_level=$_GET["auto_dial_level"]; if (!$auto_dial_level) {$auto_dial_level=$_POST["auto_dial_level"];} -$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"]; if (!$VDstop_rec_after_each_call) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} -$conf_silent_prefix=$_GET["conf_silent_prefix"]; if (!$conf_silent_prefix) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} -$extension=$_GET["extension"]; if (!$extension) {$extension=$_POST["extension"];} -$protocol=$_GET["protocol"]; if (!$protocol) {$protocol=$_POST["protocol"];} -$user_abb=$_GET["user_abb"]; if (!$user_abb) {$user_abb=$_POST["user_abb"];} -$preview=$_GET["preview"]; if (!$preview) {$preview=$_POST["preview"];} -$called_count=$_GET["called_count"]; if (!$called_count) {$called_count=$_POST["called_count"];} -$agent_log_id=$_GET["agent_log_id"]; if (!$agent_log_id) {$agent_log_id=$_POST["agent_log_id"];} -$agent_log=$_GET["agent_log"]; if (!$agent_log) {$agent_log=$_POST["agent_log"];} -$favorites_list=$_GET["favorites_list"]; if (!$favorites_list) {$favorites_list=$_POST["favorites_list"];} -$CallBackDatETimE=$_GET["CallBackDatETimE"]; if (!$CallBackDatETimE) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} -$recipient=$_GET["recipient"]; if (!$recipient) {$recipient=$_POST["recipient"];} - - -# default optional vars if not set -if (!$format) {$format="text";} -if ($format == 'debug') {$DB=1;} -if (!$ACTION) {$ACTION="refresh";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$CIDdate = date("mdHis"); -if (!$query_date) {$query_date = $NOW_DATE;} -$MT[0]=''; - -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) -{ -echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; -exit; -} -else -{ - -if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } -else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } -} - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDiaL Certificado Da Pergunta Da Base de dados"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - -################################################################################ -### regCLOSER - update the vicidial_live_agents table to reflect the closer -### inbound choices made upon login -################################################################################ -if ($ACTION == 'regCLOSER') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($closer_choice)<1) || (strlen($user)<1) ) - { - $channel_live=0; - echo "Escolha Do Grupo $closer_choice é inválido\n"; - exit; - } - else - { - if ($closer_choice == "MGRLOCK") - { - $stmt="SELECT closer_campaigns FROM vicidial_users where user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $closer_choice =$row[0]; - - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="UPDATE vicidial_live_agents set closer_campaigns='$closer_choice' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_users set closer_campaigns='$closer_choice' where user='$user';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Closer In Escolha Do Grupo $closer_choice foi registado a user $user\n"; -} - - -################################################################################ -### manDiaLnextCALL - for manual VICIDiaL dialing this will grab the next lead -### in the campaign, reserve it, send data back to client and -### place the call by inserting into vicidial_manager -################################################################################ -if ($ACTION == 'manDiaLnextCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) ) - { - $channel_live=0; - echo "FUNIL VAZIO\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context é inválido\n"; - exit; - } - else - { - ### grab the next lead in the hopper for this campaign and reserve it for the user - $stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by hopper_id LIMIT 1"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - ##### grab the lead_id of the reserved user in vicidial_hopper - $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $hopper_leadID_ct = mysql_num_rows($rslt); - if ($hopper_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - } - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - $called_count++; - - ### flag the lead as called and change it's status to INCHAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', called_since_last_reset='Y', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### delete the lead from the hopper - $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - ### if preview dialing, do not send the call - if ( (strlen($preview)<1) || ($preview == 'NO') ) - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $MqueryCID . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - } - else - { - echo "FUNIL VAZIO\n"; - } - } -} - - -################################################################################ -### manDiaLskip - for manual VICIDiaL dialing this skips the lead that was -### previewed in the step above and puts it back in orig status -################################################################################ -if ($ACTION == 'manDiaLskip') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($stage)<1) || (strlen($called_count)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "LEAD NOT REVERTED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context é inválido\n"; - exit; - } - else - { - $called_count = ($called_count - 1); - ### flag the lead as called and change it's status to INCHAMADA - $stmt = "UPDATE vicidial_list set status='$stage', called_count='$called_count',user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - - echo "LEAD REVERTED\n"; - } -} - - -################################################################################ -### manDiaLonly - for manual VICIDiaL dialing this sends the call that was -### previewed in the step above -################################################################################ -if ($ACTION == 'manDiaLonly') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) || (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - $channel_live=0; - echo "CHAMADA NOT PLACED\n"; - echo "Conf Exten $conf_exten or campaign $campaign or ext_context $ext_context é inválido\n"; - exit; - } - else - { - ### prepare variables to place manual call from VICIDiaL - $CCID_on=0; $CCID=''; - $local_DEF = 'Local/'; - $local_AMP = '@'; - $Local_out_prefix = '9'; - $Local_dial_timeout = '60'; - $Local_persist = '/n'; - if ($dial_timeout > 4) {$Local_dial_timeout = $dial_timeout;} - $Local_dial_timeout = ($Local_dial_timeout * 1000); - if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} - if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} - - # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL - $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} - - ### insert the call action into the vicidial_manager table to initiate the call - # $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Local_out_prefix$phone_code$phone_number','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - echo "$MqueryCID\n"; - } -} - - -################################################################################ -### manDiaLlookCALL - for manual VICIDiaL dialing this will attempt to look up -### the trunk channel that the call was placed on -################################################################################ -if ($ACTION == 'manDiaLlookCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; -if (strlen($MDnextCID)<18) - { - echo "NO\n"; - echo "MDnextCID $MDnextCID é inválido\n"; - exit; - } -else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT uniqueid,channel FROM vicidial_manager where callerid='$MDnextCID' and server_ip='$server_ip' and status='UPDATED' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $uniqueid =$row[0]; - $channel =$row[1]; - echo "$uniqueid\n$channel"; - - $wait_sec=0; - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "NO\n"; - } - } -} - - - -################################################################################ -### manDiaLlogCALL - for manual VICIDiaL logging of calls places record in -### vicidial_log and then sends process to call_log entry -################################################################################ -if ($ACTION == 'manDiaLlogCaLL') -{ - $MT[0]=''; - $row=''; $rowx=''; - -if ($stage == "start") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) - { - echo "REGISTRO NÃO ENTRADO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign é inválido\n"; - exit; - } - else - { - ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "VICIDiaL_LOG Introduzido: $uniqueid|$channel|$NOW_TIME\n"; - echo "$StarTtime\n"; - } - else - { - echo "REGISTRO NÃO ENTRADO\n"; - } - - # ##### insert log into call_log for manual VICIDiaL call - # $stmt = "INSERT INTO call_log (uniqueid,channel,server_ip,extension,number_dialed,caller_code,start_time,start_epoch) values('$uniqueid','$channel','$server_ip','$exten','$phone_code$phone_number','MD $user $lead_id','$NOW_TIME','$StarTtime')"; - # if ($DB) {echo "$stmt\n";} - # $rslt=mysql_query($stmt, $link); - # $affected_rows = mysql_affected_rows($link); - - # if ($affected_rows > 0) - # { - # echo "CHAMADA_LOG Introduzido: $uniqueid|$channel|$NOW_TIME"; - # } - # else - # { - # echo "REGISTRO NÃO ENTRADO\n"; - # } - } - } - -if ($stage == "end") - { - if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) ) - { - echo "REGISTRO NÃO ENTRADO\n"; - echo "uniqueid $uniqueid or lead_id: $lead_id é inválido\n"; - exit; - } - else - { - if ($start_epoch < 1000) - { - if (eregi("CLOSER",$campaign)) - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user';"; - } - else - { - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; - } - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VM_mancall_ct = mysql_num_rows($rslt); - if ($VM_mancall_ct > 0) - { - $row=mysql_fetch_row($rslt); - $start_epoch =$row[0]; - $length_in_sec = ($StarTtime - $start_epoch); - } - else - { - $length_in_sec = 0; - } - } - else {$length_in_sec = ($StarTtime - $start_epoch);} - - if (eregi("CLOSER",$campaign)) - { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - if ($auto_dial_level > 0) - { - ### delete call record from vicidial_auto_calls - $stmt = "DELETE from vicidial_auto_calls where uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - ##### look for the channel in the UPDATED vicidial_manager record of the call initiation - $stmt="UPDATE vicidial_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' where uniqueid='$uniqueid' and lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - - if ($affected_rows > 0) - { - echo "$uniqueid\n$channel\n"; - } - else - { - echo "REGISTRO NÃO ENTRADO\n\n"; - } - } - - echo $VDstop_rec_after_each_call . '|' . $extension . '|' . $conf_silent_prefix . '|' . $conf_exten . '|' . $user_abb . "|\n"; - - ##### if VICIDiaL call and hangup_after_each_call activated, find all recording - ##### channels and hang them up while entering info into recording_log and - ##### returning filename/recordingID - if ($VDstop_rec_after_each_call == 1) - { - $local_DEF = 'Local/'; - $local_AMP = '@'; - $total_rec=0; - $loop_count=0; - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and extension = '$conf_exten' order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$rec_list = mysql_num_rows($rslt);} - while ($rec_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - if (preg_match("/Local\/$conf_silent_prefix$conf_exten\@/i",$row[0])) - { - $rec_channels[$total_rec] = "$row[0]"; - $total_rec++; - } - if ($format=='debug') {echo "\n";} - $loop_count++; - } - - $total_recFN=0; - $loop_count=0; - $filename=$MT; # not necessary : and cmd_line_f LIKE \"%_$user_abb\" - $stmt="SELECT cmd_line_f FROM vicidial_manager where server_ip='$server_ip' and action='Originate' and cmd_line_b = 'Channel: $local_DEF$conf_silent_prefix$conf_exten$local_AMP$ext_context' order by entry_date desc limit $total_rec;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$recFN_list = mysql_num_rows($rslt);} - while ($recFN_list>$loop_count) - { - $row=mysql_fetch_row($rslt); - $filename[$total_recFN] = preg_replace("/Callerid: /i","",$row[0]); - if ($format=='debug') {echo "\n";} - $total_recFN++; - $loop_count++; - } - - $loop_count=0; - while($loop_count < $total_rec) - { - if (strlen($rec_channels[$loop_count])>5) - { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "REC_STOP|$rec_channels[$loop_count]|$filename[$loop_count]|"; - if (strlen($filename)>2) - { - $stmt="SELECT recording_id,start_epoch FROM recording_log where filename='$filename[$loop_count]'"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) {$fn_count = mysql_num_rows($rslt);} - if ($fn_count) - { - $row=mysql_fetch_row($rslt); - $recording_id = $row[0]; - $start_time = $row[1]; - - $length_in_sec = ($StarTtime - $start_time); - $length_in_min = ($length_in_sec / 60); - $length_in_min = sprintf("%8.2f", $length_in_min); - - $stmt="UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where filename='$filename[$loop_count]' and end_epoch is NULL;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - echo "$recording_id|$length_in_min|"; - } - else {echo "||";} - } - else {echo "||";} - echo "\n"; - } - $loop_count++; - } - } - - - $talk_sec=0; - $StarTtime = date("U"); - $stmt = "select talk_epoch,talk_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $talk_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',talk_epoch='$StarTtime',dispo_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } -} - - -################################################################################ -### VDADcheckINCOMING - for auto-dial VICIDiaL dialing this will check for calls -### in the vicidial_live_agents table in QUEUE status, then -### lookup the lead info and pass it back to vicidial.php -################################################################################ -if ($ACTION == 'VDADcheckINCOMING') -{ - $MT[0]=''; - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) - { - $channel_live=0; - echo "0\n"; - echo "Campanha $campaign é inválido\n"; - exit; - } - else - { - ### grab the call and lead info from the vicidial_live_agents table - $stmt = "SELECT lead_id,uniqueid,callerid,channel,call_server_ip FROM vicidial_live_agents where server_ip = '$server_ip' and user='$user' and campaign_id='$campaign' and status='QUEUE';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $queue_leadID_ct = mysql_num_rows($rslt); - - if ($queue_leadID_ct > 0) - { - $row=mysql_fetch_row($rslt); - $lead_id =$row[0]; - $uniqueid =$row[1]; - $callerid =$row[2]; - $channel =$row[3]; - $call_server_ip =$row[4]; - if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} - echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; - - ### update the agent status to INCHAMADA in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT * FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - # $lead_id = trim("$row[0]"); - $dispo = trim("$row[3]"); - $tsr = trim("$row[4]"); - $vendor_id = trim("$row[5]"); - $list_id = trim("$row[7]"); - $gmt_offset_now = trim("$row[8]"); - $phone_code = trim("$row[10]"); - $phone_number = trim("$row[11]"); - $title = trim("$row[12]"); - $first_name = trim("$row[13]"); - $middle_initial = trim("$row[14]"); - $last_name = trim("$row[15]"); - $address1 = trim("$row[16]"); - $address2 = trim("$row[17]"); - $address3 = trim("$row[18]"); - $city = trim("$row[19]"); - $state = trim("$row[20]"); - $province = trim("$row[21]"); - $postal_code = trim("$row[22]"); - $country_code = trim("$row[23]"); - $gender = trim("$row[24]"); - $date_of_birth = trim("$row[25]"); - $alt_phone = trim("$row[26]"); - $email = trim("$row[27]"); - $security = trim("$row[28]"); - $comments = trim("$row[29]"); - $called_count = trim("$row[30]"); - } - - ### update the lead status to INCHAMADA - $stmt = "UPDATE vicidial_list set status='INCALL', user='$user' where lead_id='$lead_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - ### update the log status to INCHAMADA - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - if (eregi("CLOSER",$campaign)) - { - ### update the vicidial_closer_log user to INCHAMADA - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - - $stmt = "select campaign_id from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDAC_cid_ct = mysql_num_rows($rslt); - if ($list_lead_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; - } - - $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDL_cid_ct = mysql_num_rows($rslt); - if ($VDL_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_front_VDlog =$row[0]; - } - - $stmt = "select * from vicidial_inbound_groups where group_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_group_name = $row[1]; - $VDCL_group_color = $row[2]; - $VDCL_group_web = $row[4]; - $VDCL_fronter_display = $row[7]; - $VDCL_ingroup_script = $row[8]; - $VDCL_get_call_launch = $row[9]; - $VDCL_xferconf_a_dtmf = $row[10]; - $VDCL_xferconf_a_number = $row[11]; - $VDCL_xferconf_b_dtmf = $row[12]; - $VDCL_xferconf_b_number = $row[13]; - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_ingroup_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - } - - ### if web form is set then send em to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - - $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDU_cid_ct = mysql_num_rows($rslt); - if ($VDU_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $fronter_full_name = $row[0]; - echo $fronter_full_name . '|' . $tsr . "\n"; - } - else {echo '|' . $tsr . "\n";} - } - else - { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDIG_cid_ct = mysql_num_rows($rslt); - if ($VDIG_cid_ct > 0) - { - $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n|\n"; - } - - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $LeaD_InfO = $callerid . "\n"; - $LeaD_InfO .= $lead_id . "\n"; - $LeaD_InfO .= $dispo . "\n"; - $LeaD_InfO .= $tsr . "\n"; - $LeaD_InfO .= $vendor_id . "\n"; - $LeaD_InfO .= $list_id . "\n"; - $LeaD_InfO .= $gmt_offset_now . "\n"; - $LeaD_InfO .= $phone_code . "\n"; - $LeaD_InfO .= $phone_number . "\n"; - $LeaD_InfO .= $title . "\n"; - $LeaD_InfO .= $first_name . "\n"; - $LeaD_InfO .= $middle_initial . "\n"; - $LeaD_InfO .= $last_name . "\n"; - $LeaD_InfO .= $address1 . "\n"; - $LeaD_InfO .= $address2 . "\n"; - $LeaD_InfO .= $address3 . "\n"; - $LeaD_InfO .= $city . "\n"; - $LeaD_InfO .= $state . "\n"; - $LeaD_InfO .= $province . "\n"; - $LeaD_InfO .= $postal_code . "\n"; - $LeaD_InfO .= $country_code . "\n"; - $LeaD_InfO .= $gender . "\n"; - $LeaD_InfO .= $date_of_birth . "\n"; - $LeaD_InfO .= $alt_phone . "\n"; - $LeaD_InfO .= $email . "\n"; - $LeaD_InfO .= $security . "\n"; - $LeaD_InfO .= $comments . "\n"; - $LeaD_InfO .= $called_count . "\n"; - - echo $LeaD_InfO; - - - - $wait_sec=0; - $StarTtime = date("U"); - $stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $wait_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - echo "0\n"; - # echo "No calls in QUEUE for $user em $server_ip\n"; - exit; - } - } -} - - -################################################################################ -### userLOGout - Logs the user out of VICIDiaL client, deleting db records and -### inserting into vicidial_user_log -################################################################################ -if ($ACTION == 'userLOGout') -{ - $MT[0]=''; - $row=''; $rowx=''; -if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) - { - echo "NO\n"; - echo "campaign $campaign or conf_exten $conf_exten é inválido\n"; - exit; - } -else - { - ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vul_insert = mysql_affected_rows($link); - - ##### Remove the reservation em the vicidial_conferences meetme room - $stmt="UPDATE vicidial_conferences set extension='' where server_ip='$server_ip' and conf_exten='$conf_exten';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vc_remove = mysql_affected_rows($link); - - ##### Delete the vicidial_live_agents record for this session - $stmt="DELETE from vicidial_live_agents where server_ip='$server_ip' and user ='$user';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $vla_delete = mysql_affected_rows($link); - - ##### Delete the web_client_sessions - $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $wcs_delete = mysql_affected_rows($link); - - ##### Hangup the client phone - $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$extension%\" order by channel desc;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($rslt) - { - $row=mysql_fetch_row($rslt); - $agent_channel = "$row[0]"; - if ($format=='debug') {echo "\n";} - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH123459$StarTtime','Channel: $agent_channel','','','','','','','','','');"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; - } -} - - -################################################################################ -### updateDISPO - update the vicidial_list table to reflect the agent choice of -### call disposition for that leand -################################################################################ -if ($ACTION == 'updateDISPO') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($dispo_choice)<1) || (strlen($lead_id)<1) ) - { - echo "Dispo Choice $dispo or lead_id $lead_id é inválido\n"; - exit; - } - else - { - $stmt="UPDATE vicidial_list set status='$dispo_choice', user='$user' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by uniqueid desc limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - - $dispo_sec=0; - $StarTtime = date("U"); - $stmt = "select dispo_epoch,dispo_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $dispo_sec = (($StarTtime - $row[0]) + $row[1]); - } - $stmt="UPDATE vicidial_agent_log set dispo_sec='$dispo_sec',dispo_epoch='$StarTtime',status='$dispo_choice' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - - ### CHAMADABACK ENTRY - if ( ($dispo_choice == 'CBHVELHO') and (strlen($CallBackDatETimE)>10) ) - { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - } - - echo 'Lead ' . $lead_id . ' foi mudado a ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; -} - -################################################################################ -### updateLEAD - update the vicidial_list table to reflect the values that are -### in the agents screen at time of call hangup -################################################################################ -if ($ACTION == 'updateLEAD') -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($phone_number)<1) || (strlen($lead_id)<1) ) - { - echo "phone_number $phone_number or lead_id $lead_id é inválido\n"; - exit; - } - else - { - $comments = eregi_replace("\r",'',$comments); - $comments = eregi_replace("\n",'!N',$comments); - - $stmt="UPDATE vicidial_list set vendor_lead_code='$vendor_lead_code', title='$title', first_name='$first_name', middle_initial='$middle_initial', last_name='$last_name', address1='$address1', address2='$address2', address3='$address3', city='$city', state='$state', province='$province', postal_code='$postal_code', country_code='$country_code', gender='$gender', date_of_birth='$date_of_birth', alt_phone='$alt_phone', email='$email', security_phrase='$security_phrase', comments='$comments' where lead_id='$lead_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - } - echo "Lead $lead_id a informação foi atualizada\n"; -} - - -################################################################################ -### VDADpause - update the vicidial_live_agents table to show that the agent is -### or ready now active and ready to take calls -################################################################################ -if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) -{ - $MT[0]=''; - $row=''; $rowx=''; - if ( (strlen($stage)<2) || (strlen($server_ip)<1) ) - { - echo "stage $stage é inválido\n"; - exit; - } - else - { - $random = (rand(1000000, 9999999) + 10000000); - $stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - - if ($agent_log == 'NO') - {$donothing=1;} - else - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $VDpr_ct = mysql_num_rows($rslt); - if ($VDpr_ct > 0) - { - $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - } - if ($ACTION == 'VDADready') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - if ($ACTION == 'VDADpause') - { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - } - echo 'Agent ' . $user . ' está agora no status ' . $stage . "\n"; -} - - -################################################################################ -### UpdatEFavoritEs - update the astguiclient favorites list for this extension -################################################################################ -if ($ACTION == 'UpdatEFavoritEs') -{ - $row=''; $rowx=''; - $channel_live=1; - if ( (strlen($favorites_list)<1) || (strlen($user)<1) || (strlen($exten)<1) ) - { - echo "favorites list $favorites_list é inválido\n"; - exit; - } - else - { - $stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - - if ($row[0] > 0) - { - $stmt="UPDATE phone_favorites set extensions_list=\"$favorites_list\" where extension='$exten' and server_ip='$server_ip';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - else - { - $stmt="INSERT INTO phone_favorites values('$exten','$server_ip',\"$favorites_list\");"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - } - } - echo "Favorites list has been updated to $favorites_list for $exten\n"; -} - - - - -if ($format=='debug') -{ -$ENDtime = date("U"); -$RUNtime = ($ENDtime - $StarTtime); -echo "\n"; -echo "\n\n\n"; -} - -exit; - -?> diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/vicidial.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/vicidial.php deleted file mode 100644 index 1aaab983..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/vicidial.php +++ /dev/null @@ -1,4633 +0,0 @@ - LICENSE: GPLv2 -### -### make sure you have added a user to the vicidial_users MySQL table with at least -### user_level 1 or greater to access this page. Also, you need to have the login -### and pass of a phone listed in the asterisk.phones table. The page grabs the -### server info and other details from this login and pass. -### -### This script works best with Firefox or Mozilla, but will run for a couple -### hours on Internet Explorer before the memory leaks cause a crash. -### -### Other scripts that this application depends on: -### - vdc_db_query.php: Updates information in the database -### - manager_send.php: Sends manager actions to the DB for execution -### -### CHANGES -### 50607-1426 - First Build of VICIDIAL web client basic login process finished -### 50628-1620 - Added some basic formatting and worked on process flow -### 50628-1715 - Startup variables mapped to javascript variables -### 50629-1303 - Added Login Closer in-groups selection box and vla update -### 50629-1530 - Rough layout for customer info form section and button links -### 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -### 50701-1450 - Added vicidial_log entries on dial and hangup -### 50701-1634 - Added Logout function -### 50705-1259 - Added call disposition functionality -### 50705-1432 - Added lead info DB update function -### 50705-1658 - Added web form functionality -### 50706-1043 - Added call park and pickup functions -### 50706-1234 - Added Start/Stop Recording functionality -### 50706-1614 - Added conference channels display option -### 50711-1333 - Removed call check redundancy and fixed a span bug -### 50727-1424 - Added customer channel and participant present sensing/alerts -### 50804-1057 - Added SendDTMF function and reconfigured the transfer span -### 50804-1224 - Added Local and Internal Closer transfer functions -### 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -### 50804-1808 - Added button images for left buttons -### 50815-1151 - Added 3Way calling functions to Transfer-conf frame -### 50815-1602 - Added images and buttons for xfer functions -### 50816-1813 - Added basic autodial outbound call pickup functions -### 50817-1113 - Fixes to auto_dialing call receipt -### 50817-1234 - Added inbound call receipt capability -### 50817-1541 - Added customer time display -### 50817-1541 - Added customer time display -### 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -### 50818-1703 - Added pretty login section -### 50825-1200 - Modified form field lengths, added double-click dispositions -### 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -### 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -### 50903-0904 - Added preview-lead code for manual dialing -### 50904-0016 - Added ability to hangup manual dials before pickup -### 50906-1319 - Added override for filters on xfer calls, fixed login display bug -### 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -### 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -### 50913-1212 - Added campaign_cid to 3rd party calls -### 50923-1546 - Modified to work with language translation -### 50926-1656 - Added campaign pull-down at login of active campaigns -### 50928-1633 - Added manual dial alternate number dial option -### 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -### 51004-1656 - Fixed recording filename bug and new Spanish translation -### 51020-1103 - Added campaign-specific recording control abilities -### 51020-1352 - Added Basic vicidial_agent_log framework -### 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -### 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -### 51110-1432 - Fixed non-standard http port issue -### 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -### 51118-1305 - Activate multi-line comments from $multi_line_comments var -### 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -### 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -### 51129-1010 - Added ability to accept calls from other VICIDIAL servers -### 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -### 51208-1732 - Created user-first login that looks for default phone info -### 51219-1526 - Added variable framework for campaign and in-group scripts -### 51221-1200 - Added SCRIPT tab, layout and functionality -### 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -### 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -### 51229-1028 - Added checks on web_form_address to allow for var in the DB value -### 60117-1312 - Added Transfer-conf frame toggle on button press -### 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -### 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -### 60213-1210 - Added ability to sort routing of calls by user_level -### 60214-0932 - Initial Callback calendar display framework -### 60214-1407 - Added ability to minimize the dispo screen to see info below -### 60215-1104 - Added ANYONE scheduled callbacks functionality -### - -require("dbconnect.php"); - -$DB=$_GET['DB']; if (!$DB) {$DB=$_POST["DB"];} -$phone_login=$_GET['phone_login']; if (!$phone_login) {$phone_login=$_POST["phone_login"];} - if (!$phone_login) {$phone_login=$_GET["pl"];} -$phone_pass=$_GET['phone_pass']; if (!$phone_pass) {$phone_pass=$_POST["phone_pass"];} - if (!$phone_pass) {$phone_pass=$_GET["pp"];} -$VD_login=$_GET['VD_login']; if (!$VD_login) {$VD_login=$_POST["VD_login"];} -$VD_pass=$_GET['VD_pass']; if (!$VD_pass) {$VD_pass=$_POST["VD_pass"];} -$VD_campaign=$_GET['VD_campaign']; if (!$VD_campaign) {$VD_campaign=$_POST["VD_campaign"];} - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = eregi_replace(" ",'',$VD_campaign); -$relogin=$_GET['relogin']; if (!$relogin) {$relogin=$_POST["relogin"];} - -$forever_stop=0; - -$version = '1.1.66'; -$build = '60215-1104'; - -if ($force_logout) -{ - echo "Você tem registrado agora para fora. Obrigado\n"; - exit; -} - -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); - $past_month_date = date("Y-m-d H:i:s",$month_old); - -$random = (rand(1000000, 9999999) + 10000000); - -$conf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$manual_dial_preview = '1'; # Allow preview lead option when manual dial -$HKuser_level = '5'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_alt_phone = '1'; # allow manual dial users to call alt phone number -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen - -$US='_'; -$CL=':'; -$AT='@'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = eregi_replace('vicidial.php','',$agcPAGE); - -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo "\n"; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) -{ -$camp_form_code = "\n"; -} -else -{ -$camp_form_code = "\n"; -} - - - -if ($relogin == 'YES') -{ -echo "Web client de VICISELETOR: Re-Início de uma sessão\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Re-Início de uma sessão
 
Início de uma sessão Do Telefone:
Senha Do Telefone:
Início de uma sessão Do Usuário:
Senha Do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} - -if ($user_login_first == 1) -{ - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo "Web client de VICISELETOR: Início de uma sessão Da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

Início de uma sessão Do Usuário

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão Da Campanha
 
Início de uma sessão Do Usuário:
Senha Do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - echo "Web client de VICISELETOR: Início de uma sessão\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão
 
Início de uma sessão Do Telefone:
Senha Do Telefone:
Início de uma sessão Do Usuário:
Senha Do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - - } - } -} - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) -{ -echo "Web client de VICISELETOR: Início de uma sessão Do Telefone\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; -echo "
\n"; -echo "\n"; -echo "


"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Início de uma sessão Do Telefone
 
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; -exit; -} -else -{ -$fp = fopen ("./vicidial_auth_entries.txt", "a"); -$VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if($auth>0) - { - $login=strtoupper($VD_login); - $password=strtoupper($VD_pass); - ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups from vicidial_users where user='$VD_login' and pass='$VD_pass'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - $user_level=$row[1]; - $VU_hotkeys_active=$row[2]; - $VU_agent_choose_ingroups=$row[3]; - fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;} - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - if ($TEST_all_statuses > 0) {$selectableSQL = '';} - else {$selectableSQL = "selectable='Y' and";} - $VARstatuses=''; - $VARstatusnames=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 50;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysql_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $statuses[$i] =$row[0]; - $status_names[$i] =$row[1]; - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $i++; - $j++; - } - $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysql_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysql_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - if (eregi("CLOSER", $VD_campaign)) - { - $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' order by group_id limit 20;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $closer_ct = mysql_num_rows($rslt); - $INgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysql_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - } - - ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $status_A = $row[0]; - $status_B = $row[1]; - $status_C = $row[2]; - $status_D = $row[3]; - $status_E = $row[4]; - $park_ext = $row[5]; - $park_file_name = $row[6]; - $web_form_address = $row[7]; - $allow_closers = $row[8]; - $auto_dial_level = $row[9]; - $dial_timeout = $row[10]; - $dial_prefix = $row[11]; - $campaign_cid = $row[12]; - $campaign_vdad_exten = $row[13]; - $campaign_rec_exten = $row[14]; - $campaign_recording = $row[15]; - $campaign_rec_filename = $row[16]; - $campaign_script = $row[17]; - $get_call_launch = $row[18]; - $campaign_am_message_exten = $row[19]; - $xferconf_a_dtmf = $row[20]; - $xferconf_a_number = $row[21]; - $xferconf_b_dtmf = $row[22]; - $xferconf_b_number = $row[23]; - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - print "\n"; - - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "A campanha nao ativa, tenta por favor outra vez
"; - } - } - else - { - fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n"); - fclose($fp); - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = "O início de uma sessão incorreto, tenta por favor outra vez
"; - } - } - if ($VDloginDISPLAY) - { - echo "Web client de VICISELETOR: Início de uma sessão Da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

$VDdisplayMESSAGE

"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão Da Campanha
 
Início de uma sessão Do Usuário:
Senha Do Usuário:
Campanha: $camp_form_code

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -$authphone=0; -$stmt="SELECT count(*) from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$authphone=$row[0]; -if (!$authphone) - { - echo "Web client de VICISELETOR: Início de uma sessão Do Telefone Error\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Início de uma sessão Error
 
Pesaroso, seus início de uma sessão do telefone e senha não seja:
 
Início de uma sessão Do Telefone:
Senha Do Telefone:

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - echo "Web client de VICISELETOR\n"; - $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - $SIP_user = "$protocol/$extension"; - - $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $asterisk_version=$row[0]; - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - print "\n"; - } - print "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If closers are allowed em this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - print "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - print "\n"; - } - - - $session_ext = eregi_replace("[^a-z0-9]", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - if ( (eregi("CLOSER", $VD_campaign)) || ($campaign_leads_to_call > 0) ) - { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {print "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT conf_exten FROM vicidial_conferences where server_ip = '$server_ip' and ((extension='') or (extension is null)) LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $free_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $free_conf_ct) - { - $row=mysql_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - $stmt="UPDATE vicidial_conferences set extension='$SIP_user' where server_ip='$server_ip' and conf_exten='$session_id';"; - $rslt=mysql_query($stmt, $link); - print "\n"; - - } - - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - # print "You have logged in as user: $VD_login em phone: $SIP_user à campanha: $VD_campaign
\n"; - $VICIDiaL_is_logged_in=1; - - ### use manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - ### insert a NOVO record to the vicidial_manager table to be processed - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if ($auto_dial_level > 0) - { - print "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - print "\n"; - - if (eregi("CLOSER", $VD_campaign)) - { - print "\n"; - } - } - else - { - print "\n"; - - - - } - } - else - { - echo "Web client de VICISELETOR: VICISELETOR Início de uma sessão Da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Pesaroso, não há nenhuma ligação no funil para esta campanha\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Início de uma sessão: \n
"; - echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo "Web client de VICISELETOR: VICISELETOR Início de uma sessão Da Campanha\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n";echo "\n"; echo "
English Español Français Deutsch Italiano Português Ελληνικά
\n"; - echo "Sorry, there are no available sessions\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "Início de uma sessão: \n
"; - echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; - echo "
\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $affected_rows = mysql_affected_rows($link); - $agent_log_id = mysql_insert_id(); - print "\n"; - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysql_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysql_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = rawurlencode($row[1]); - $MMscripttext[$e] = rawurlencode($row[2]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - $MMscripttexts = substr("$MMscripttexts", 0, -1); - - } -} - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; - -$Cmonths = Array('January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) -{ -if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - -$CCAL_OUT .= ""; - -if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} -$CINC++; -} - -$CCAL_OUT .= "
"; - -$CYyear = $Cyear; -$Cmonth= ($Cmon + $CINC); -if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); -$CfirstdayARY = getdate($Cstart); -#echo "|$Cmon|$Cmonth|$CINC|\n"; -$CPRNTDAY = date("Y-m", $Cstart); - -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; -$CCAL_OUT .= ""; - -foreach($Cdays as $Cday) -{ - $CDCLR="#ffffff"; -$CCAL_OUT .= ""; -} - -for( $Ccount=0;$Ccount<(6*7);$Ccount++) -{ - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="#CCCCCC"; - $CBL = ''; - $CEL = ''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - $CBL = ""; - $CEL = ""; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } -} -$CCAL_OUT .= ""; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "$Cday"; -$CCAL_OUT .= "
"; -$CCAL_OUT .= "
 "; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
"; - $CCAL_OUT .= "
"; -$CCAL_OUT .= "
"; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - - - -\n"; - - -?> - -
- - -
- - - -LOGOUT\n"; ?> -
-
- - - - - - - - -
VICISELETORSCRIPT   LIVE     sessão ID: Vive A Chamada
-
- - - - -

VICISELETOR
-
- - - - -
- - Transferência - Conferência
- MAIS PRÓXIMO INTERNO - LOCAL MAIS PRÓXIMO - CODE - Linha De Xfer Do Hangup - Hangup Ambas as Linhas - -
- - Número a chamar-se   - segundos   - channel - - OVERRIDE   - D1 - D2 -
- - Seletor Com Cliente - Seletor Do Cliente Do Parque - CHAMADA DA LICENÇA 3-WAY - Transferência Da Cortina Do Seletor - Blind Transfer VMail Message -
-
-
- - - - -
Ligação Dispositioned Como:

- -
-
-
- - - - - - - -
Chaves Quentes Da Disposição: - Quando ativo, pressione simplesmente a chave de teclado para a:
- - - - - -
-
- - -
Noone está em sua sessão:
- OK -
-
- - -
O cliente pendurou acima:
- OK -
-
- - -

LOGOUT
-
- - -
-
- - -
 
-
- - -
Todas as mudanças feitas ao cliente que a informação abaixo neste tempo não será comitted, você devem mudar a informação do cliente antes de você hangup a chamada.
-
- - -
CHAMADA DA DISPOSIÇÃO :       minimize
- Extremidade-$$$-CHAME A Seleção Da Disposição -
- PARE DE CHAMAR-SE
- RESTAURAÇÃO | - SUBMETA -



  -
-
- - - -
Selecione uma data da rechamada :
- - - Selecione uma data abaixo   -     - Hour: -   - Minutes: -   - -  
- - Comentários dos CB:

- - SUBMETA

- - -

  -
-
- - -
SELEÇÃO DE GRUPO INBOUND MAIS PRÓXIMA
- Seleção De Grupo Inbound Mais próxima -
- CHAMADA MISTURADA(outbound ativado)
- RESTAURAÇÃO | - SUBMETA -



  -
-
- - - - - - - - - - - -
TRANSFERÊNCIA VIVA DA CHAMADA
Canaleta a ser transferida: Canaleta
Extensões:
Menu Das Extensões
-
- Emita à extensão selecionada

- Emita à caixa selecionada do vmail

- Emita a este número:


- REFRESQUE


- Para trás à janela principal

-
Conferências:
(estale sobre um número abaixo para emitir a uma conferência)
Emita minha canaleta demasiado
Menu Das Conferências
-
- - - - -
VICISELETOR SCRIPT
-
- - - - - - - - - - - - - - - - - -
STATUS:
-
-Número Seguinte Do Seletor
- INSPECÇÃO PRÉVIA DA LIGAÇÃO
";} -if ( ($manual_dial_alt_phone) and ($auto_dial_level==0) ) - {echo " ALT DO TELEFONE
";} - - -?> -LIMA DE GRAVAÇÃO:
-
-
-ID REGISTRO:
-
- -Comece Gravar
-
-Formulário Da Correia fotorreceptora
-
-Chamada Do Parque
-Transferência - Conferência
-
-Cliente Do Hangup
-
-Emita DTMF
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n";} -else - {echo "\n";} -?> - -
segundos:   Canaleta:   Tempo De Cust:
Informação Do Cliente:
Título:   Primeiramente:   Mi:  Último:
Endereço1:
Endereço2:   Endereço3:
Cidade:   Estado:   PostCode:
Província:   Vendedor Id:
Telefone:   DialCode:   Alt. Telefone:
Mostra:   Email:
Comentários:
- -
-


  - -
- - - - -
Versão do correia-cliente de VICISELETOR:     CONFIGURAÇÃO:               Usuário:              
-Mostre a informação da canaleta da chamada de conferência
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -CHAVES QUENTES INATIVAS - -
- - - -
- - - - -
- - - - - - - - - - - - diff --git a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/voicemail_check.php b/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/voicemail_check.php deleted file mode 100644 index bcf92fcf..00000000 --- a/agc_1-X/trunk/LANG_agc/LANG_agc/agc_pt/voicemail_check.php +++ /dev/null @@ -1,130 +0,0 @@ - 0;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth)) - { - echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; - exit; - } - else - { - - if( ( (strlen($server_ip)<6) or (!$server_ip) ) or ( (strlen($session_name)<12) or (!$session_name) ) ) - { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; - } - else - { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if(!$SNauth) - { - echo "Inválido session_name: |$session_name|$server_ip|\n"; - exit; - } - else - { - # do nothing for now - } - } - } - -if ($format=='debug') -{ -echo "\n"; -echo "\n"; -echo "\n"; -echo "Verificação De Voicemail"; -echo "\n"; -echo "\n"; -echo "\n"; -} - - $MT[0]=''; - $row=''; $rowx=''; - if (strlen($vmail_box)<1) - { - $channel_live=0; - echo "caixa do voicemail $vmail_box é inválido\n"; - exit; - } - else - { - $stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - $vmails_list = mysql_num_rows($rslt); - $loop_count=0; - while ($vmails_list>$loop_count) - { - $loop_count++; - $row=mysql_fetch_row($rslt); - echo "$row[0]|$row[1]"; - if ($format=='debug') {echo "\n";} - } - } - - -if ($format=='debug') - { - $ENDtime = date("U"); - $RUNtime = ($ENDtime - $StarTtime); - echo "\n"; - echo "\n\n\n"; - } - -exit; - -?>