Page 1 of 1

Agent only callback screen empty

PostPosted: Fri Jun 03, 2011 8:42 am
by dspaan
Last week we had an agent who saw the LIVE callback link blinking but when clicking it, it would show an empty callbacks page. After using the 'remove callbacks older then 7 days' link the problem would be solved.

Now we have another agent with the same problem but i don't want to remove callbacks older then 7 days because there are some important callbacks for that agent older then that period.

What could be causing this?
What can i do?

PostPosted: Fri Jun 03, 2011 9:02 am
by mflorell
Any firefox error console errors?

Any mysql errors in the agc directory on the web server?

PostPosted: Fri Jun 03, 2011 9:42 am
by dspaan
The Firefox Error conosole says:

Image

The latest entry i see in vicidial_mysql_errors.txt is:

$
2011-06-01 08:18:27|vdc_db_query|00300|1062|Duplicate entry '1306927106.49941' for key 'PRIMARY'|UPDATE call_log set uniqueid='1306927106.$


This is from two days ago

PostPosted: Fri Jun 03, 2011 2:49 pm
by mflorell
very interesting error, could you post the few lines around that when you do a view source in Firefox?

PostPosted: Fri Jun 03, 2011 2:52 pm
by dspaan
Can you be a bit more clear on that, where should i do view source?

This happens only for 1 agent and doesn't matter where she logs in. Also tried with IE and Opera.

PostPosted: Fri Jun 03, 2011 4:46 pm
by mflorell
If it happens again, right-click on the vicidial.php page in your web browser, go to "View Source" and scroll down to the line mentioned in the Firefox Error Console. Then copy and paste from 10 lines above that line to 10 lines below that line.

PostPosted: Fri Jun 03, 2011 7:21 pm
by dspaan
Here it is:

Code: Select all
                  while (loop_ct < CB_calls)
                     {
                     loop_ct++;
                     loop_s = loop_ct.toString();
                     if (loop_s.match(/1$|3$|5$|7$|9$/))
                        {var row_color = '#DDDDFF';}
                     else
                        {var row_color = '#CCCCFF';}
                     var conv_ct = (loop_ct + conv_start);
                     var call_array = all_CBs_array[conv_ct].split(" ~");
                     var CB_name = call_array[0] + " " + call_array[1];
                     var CB_phone = call_array[2];
                     var CB_id = call_array[3];
                     var CB_lead_id = call_array[4];
                     var CB_campaign = call_array[5];
                     var CB_status = call_array[6];
                     var CB_lastcall_time = call_array[7];
                     var CB_callback_time = call_array[8];
                     var CB_comments = call_array[9];
                     var CB_comments_ten = CB_comments;
                     if (CB_comments_ten.length > 10)
                        {
                        CB_comments_ten = CB_comments_ten.substr(0,10);
                        CB_comments_ten = CB_comments_ten + '...';
                        }
                            CB_HTML = CB_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_callback_time + "</td><td align=\"right\"><font class=\"log_text\">" + CB_phone + "</td><td align=\"right\"><font class=\"log_text\">" + CB_comments_ten + " - <a href=\"#\" onclick=\"VieWLeaDInfO('" + CB_lead_id + "','" + CB_id + "');return false;\">INFO</a></font></td><td align=\"right\"><font class=\"log_text\">" + CB_name + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_status + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_campaign + "</font></td><td align=\"right\"><font class=\"log_text\">" + CB_lastcall_time + "&nbsp;</font></td><td align=\"right\"><font class=\"log_text\"><a href=\"#\" onclick=\"new_callback_call('" + CB_id + "','" + CB_lead_id + "','MAIN');return false;\">DIAL</a>&nbsp;</font></td><td align=\"right\"><font class=\"log_text\"><a href=\"#\" onclick=\"new_callback_call('" + CB_id + "','" + CB_lead_id + "','ALT');return false;\">ALT</a>&nbsp;</font></td></tr>";
                     }
                  CB_HTML = CB_HTML + "</table>";
                  document.getElementById("CallBacKsLisT").innerHTML = CB_HTML;
                  }
               }
            delete xmlhttp;
            }
         }
      }


// ################################################################################
// closes callback list screen
   function alert_box(temp_message)
      {
      document.getElementById("AlertBoxContent").innerHTML = temp_message;

      showDiv('AlertBox');

      document.alert_form.alert_button.focus();
      }

PostPosted: Fri Jun 03, 2011 9:44 pm
by mflorell
Can you point to which line is 2619?

PostPosted: Sat Jun 04, 2011 8:24 am
by dspaan
I tried to make that line bold but couldn't because of the code tags. But this is the line:
var CB_comments_ten = CB_comments;

PostPosted: Sat Jun 04, 2011 10:09 am
by mflorell
Very interesting, I cannot seem to duplicate this. Would you be able to post the vicidial_callbacks records assigned to the user when this happens?

PostPosted: Sat Jun 04, 2011 10:22 am
by dspaan
This is so weird, last night i logged in under her account and i couldn't see the callbacks list, when i login right now it works again?????

Could a nightly job have fixed this? Here is a view of crontab:

### remove old vicidial logs and asterisk logs more than 2 days old
28 0 * * * /usr/bin/find /var/log/astguiclient -maxdepth 1 -type f -mtime +2 -print | xargs rm -f
29 0 * * * /usr/bin/find /var/log/asterisk -maxdepth 3 -type f -mtime +2 -print | xargs rm -f
30 0 * * * /usr/bin/find / -maxdepth 1 -name "screenlog.0*" -mtime +4 -print | xargs rm -f
### fix the vicidial_agent_log once every hour and the full day run at night
33 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl
50 0 * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --last-24hours
## uncomment below if using QueueMetrics
#*/5 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --only-qm-live-call-check

### updater for VICIDIAL hopper
* * * * * /usr/share/astguiclient/AST_VDhopper.pl -q

### adjust the GMT offset for the leads in the vicidial_list table
1 1,7 * * * /usr/share/astguiclient/ADMIN_adjust_GMTnow_on_leads.pl --debug --postal-code-gmt

### optimize the database tables within the asterisk database
3 1 * * * /usr/share/astguiclient/AST_DB_optimize.pl

### VICIDIAL agent time log weekly summary report generation
2 0 * * 0 /usr/share/astguiclient/AST_agent_week.pl

### roll logs monthly on high-volume dialing systems
#30 1 1 * * /usr/share/astguiclient/ADMIN_archive_log_tables.pl

## uncomment below if using Vtiger
"/tmp/crontab.XXXX3FT5Ot" 70L, 3572C
### recording mixing/compressing/ftping scripts
#0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl --MIX
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_VDonly.pl
1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58 * * * * /usr/share/astguiclient/AST_CRON_audio_2_compress.pl --MP3
2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59 * * * * /usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --MP3

### nightly backup
0 1 * * * /usr/share/astguiclient/ADMIN_backup.pl --ftp-transfer

### kill Hangup script for Asterisk updaters
* * * * * /usr/share/astguiclient/AST_manager_kill_hung_congested.pl

### updater for voicemail
* * * * * /usr/share/astguiclient/AST_vm_update.pl

### updater for conference validator
* * * * * /usr/share/astguiclient/AST_conf_update.pl

### flush queue DB table every hour for entries older than 1 hour
11 * * * * /usr/share/astguiclient/AST_flush_DBqueue.pl -q

### reset several temporary-info tables in the database
2 1 * * * /usr/share/astguiclient/AST_reset_mysql_vars.pl

### remove old recordings more than 7 days old
23 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +7 -print | xargs rm -f

### Reboot nightly to manage asterisk issues and memory leaks - uncomment if issues arise
#30 6 * * * /sbin/reboot

### remove text to speech file more than 4 days old
#20 0 * * * /usr/bin/find /var/lib/asterisk/sounds/tts/ -maxdepth 2 -type f -mtime +4 -print | xargs rm -f


What do you want to see exactly when you say vicidial_callbacks records?

You mean an export of the database or a screenshot of the callback holds for that user?

PostPosted: Sat Jun 04, 2011 10:51 am
by mflorell
I don't see the callback purge script in there, so the vicidial_callbacks records should not have been altered.

PostPosted: Mon Jun 06, 2011 8:39 am
by dspaan
I was mistaken. The problem is still there. It turned out the callbacks problem was only happening on one specific campaign for that agent.

Now another agent has the same problem but on a different campaign.
I made an export for both agent-campaign specific entries in the vicidial_callbacks table. See attached files.

http://dl.dropbox.com/u/31501844/Vicidi ... survey.sql

http://dl.dropbox.com/u/31501844/Vicidi ... survey.sql

http://dl.dropbox.com/u/31501844/Vicidi ... survey.csv

http://dl.dropbox.com/u/31501844/Vicidi ... health.csv

PostPosted: Wed Jun 08, 2011 1:31 pm
by dspaan
Update:

Our supervisor manually changed most of the specific callbacks for one of those agents to a future date and i clicked the 'remove live callbacks older then 7 days for this user' link and now it works again for that agent on that specific campaign. So there is a work-around but still unclear what causes this.

PostPosted: Tue Jan 17, 2012 9:18 am
by dspaan
Hi Matt,

One year later and and a few SVN updates later this problem is occuring again. It's happening to two agents on one campaign. But the other agents don't have this problem on the same campaign.

This is pretty big problem. Do you have any clues on how to proceed with this?

Re: Agent only callback screen empty

PostPosted: Tue Oct 23, 2012 4:05 pm
by ljsiri
I had the same issue recently and I found this post but was not answered yet. So, i continued my research.
Just for test, i deleted all the callbacks from one of the agents that had that issue. It worked but it wasn't a solution at all.

Digging on the vicidial_callbacks table, i found out that the callback comments field had an illegal character in one of the rows.
After removing that character the agent was able to see the whole callback list.

Hope this can help any of you. It worked for me twice. :wink:

Re: Agent only callback screen empty

PostPosted: Thu Oct 25, 2012 4:42 am
by dspaan
Thanks for posting your solution! :D What was the illegal character in your case?

Re: Agent only callback screen empty

PostPosted: Fri Nov 23, 2012 4:15 pm
by ljsiri
Can't remember exactly what was the character. But it was one of these:
$ (Dollar sign)
& (ampersand)
" (double quote)
' (single quote)
< (less than)
> (greater than)

They are troublesome with PHP/HTML codes. And that could cause the issue loading the Callback list.

Re: Agent only callback screen empty

PostPosted: Fri Nov 23, 2012 5:30 pm
by williamconley
You should do two things:

1) Considering taht you are using a fairly old version, you should upgrade to the latest SVN (Using the SVN howto in the Vicidial Wiki above). Then test to see if this resolved the issue.

2) If this did not resolve the issue, consider posting it to the Vicidial Issue Tracker (and be specific and the duplication of the error and how you fixed your specific break).

Re: Agent only callback screen empty

PostPosted: Wed Oct 23, 2013 4:00 am
by Rudolfmdlt
Hi Guys,

This is still an issue for me and I am running SVN 2020.

I am using this MySQL statement to catch the dodgy comments (thought it might be useful):
SELECT * FROM `vicidial_callbacks` WHERE `comments` REGEXP '[$&\"\'<>]'

What I want to know is, what characters are really not allowed? Single quotes surely are okay? What else is okay or not okay? What is the best way to catch double quotes and any other illegal characters.

Thanks for your time,

Rudolf

Re: Agent only callback screen empty

PostPosted: Wed Oct 23, 2013 7:14 am
by DomeDan
You could try adding:
Code: Select all
$comments = preg_replace("/[^- \_0-9a-zA-Z,\.:]/","",$comments);
to vdc_db_query.php in the "if ($non_latin < 1)" statement where there is other preg_replace or ereg_replace functions for user/pass etc

I tried it and it removes all characters except those specified in the preg_replace fuctions, on update, not or read from database.
But I have no problem displaying <,>,&,'," or $ in the comment field so I dont understand why you need this

the original topic is regarding the callback comments, what comments do you have problem with?
explain your problem and show us examples of the data and errors

Re: Agent only callback screen empty

PostPosted: Wed Oct 23, 2013 10:27 am
by Rudolfmdlt
Hi DomeDan,

The issue is hard to find as every time it happens 100 agents can't get to their call backs and we need to fix it ASAP.

I exported the callbacks table to CSV and found three entries that looked like this: won’t

That should be "won't" and in phpMyAdmin it displays as won't, but in excel it displays like the above. even in Notepad++the text displays fine.

Anyway, removing that fixed issues for half the agents. The other thing that just fixed another batch was "\r\n".
Code: Select all
UPDATE  `vicidial_callbacks` SET  `comments` = REPLACE(  `comments` ,  '\r\n',  '_' )

Now most agents have their callbacks back.

I don't know whether my "fixing" has actually done something that I am not aware of - cause and affect don't seem to correclate - but I would think that Vici is mature enough a product to properly escape and handle most character inputs. I think it is something unique to how this call centers does comments or how the browser enters the data?

What is the best way to debug this? I have looked through the apache2 error logs - no complaints. The agents use Internet Explorer.

Regards,

Rudolf

Re: Agent only callback screen empty

PostPosted: Wed Oct 23, 2013 10:55 am
by Rudolfmdlt
I can confirm that all my agents are able to view their callbacks because of:

Code: Select all
UPDATE  `vicidial_callbacks` SET  `comments` = REPLACE(  `comments` ,  '\r\n',  '_' )


Has any one else had any issues with carriage return characters? The agents are using Internet Explorer 8.

Rudolf

Re: Agent only callback screen empty

PostPosted: Wed Oct 23, 2013 1:11 pm
by dspaan
For me the problem never happened with multiple agents at the same time. It was always just a single agent. I have no idea what would be causing this, since you have a rather large impact i suggest you contact vicidial support.

Re: Agent only callback screen empty

PostPosted: Wed Oct 23, 2013 3:39 pm
by Rudolfmdlt
I'll check if I can reproduce it and report back.

Re: Agent only callback screen empty

PostPosted: Thu Oct 24, 2013 6:00 am
by DomeDan
There is code that removes \n, \r, " ' ; and /so it should not exist in the database in the first place
vdc_db_query.php:
Code: Select all
      $comments = preg_replace("/\r/i",'',$comments);
      $comments = preg_replace("/\n/i",'!N',$comments);
...
  ### CALLBACK ENTRY
  if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) )
    {
    $comments = preg_replace('/"/i','',$comments);
    $comments = preg_replace("/'/i",'',$comments);
    $comments = preg_replace('/;/i','',$comments);
    $comments = preg_replace("/\\\\/i",' ',$comments);

Are you sure that your agc folder was updated? check the build and version on agc/vicidial.php
has the agent interface been modified?
is the system setting: "Use Non-Latin:" set to 1 ?


And switch to firefox and see it that helps

Re: Agent only callback screen empty

PostPosted: Tue Oct 29, 2013 9:03 am
by shermster
I'm working with Rudolfmdlt on this issue. DomeDan you are correct that the following code is in vdc_db_query.php:

Code: Select all
      $comments = preg_replace("/\r/i",'',$comments);
      $comments = preg_replace("/\n/i",'!N',$comments);


The problem however occurs when comments are entered into the comments field in the QC module. In that code qc_modify_lead.php the callback comments are escaped using mysqli_real_escape_string but there is no substitution of carriage returns. I stand to be corrected but I also think the comments field in the agent interface is a 'text' type while in the QC module is a 'textarea'

Re: Agent only callback screen empty

PostPosted: Tue Oct 29, 2013 9:35 am
by DomeDan
Oh, never used the QC stuff.
try to add the preg_replace and if it helps then you've founds the issue!

Then the issue can be solved with either stripping the bad characters or make the interface handle bad characters.

Re: Agent only callback screen empty

PostPosted: Wed Oct 30, 2013 9:59 am
by shermster
I've added the preg_replace commands in the qc_modify_lead.php page and it seems to have fixed the issue.

Re: Agent only callback screen empty

PostPosted: Thu Oct 31, 2013 5:22 am
by mflorell
If you made some code changes please post to the Issue Tracker.

Re: Agent only callback screen empty

PostPosted: Sun Nov 03, 2013 9:12 pm
by williamconley
Yes, the purpose of the mysqli_real_escape is to make it possible to store everything ... but this is not helpful for php at all. If a bad character gets in the field in the table, it would be necessary to have php strip out any bad characters. I thought we used the same scrubbers as the original scripts when we built it, but then again we built it a while ago. Vicidial has changed.

Do you have any mods to the comments field that may have allowed "special" characters in? (would be good to know ... but the cleaner should catch them in any event!)

Re: Agent only callback screen empty

PostPosted: Mon Nov 04, 2013 7:30 am
by DomeDan
the new-line stripping has been in the vdc_db_query.php file since vicidial started using svn:
2006-07-07 23:25 mattf restructuring of files 6 - install script will not function at this point
+ $comments = eregi_replace("\r",'',$comments);
+ $comments = eregi_replace("\n",'!N',$comments);

I don't know if those changes made the problem go away, hopefully shermster will shed some light on it.
and btw eregi is changed to preg later on.

Re: Agent only callback screen empty

PostPosted: Thu Nov 14, 2013 5:48 am
by Rudolfmdlt
Hi Guys,

I've been on leave, jumping in a bit late here, does this issue still need to be reported on the bug tracker/Mantis?

This is what we have done to fix the issue:

Code: Select all
vi /srv/www/htdocs/vicidial/qc/qc_modify_lead.php

Code: Select all
 
 539                 $comments = preg_replace("/\r/i",'',$comments);
 540                 $comments = preg_replace("/\n/i",';  ',$comments);


Regards,

Rudolf