Vicidial Agent API Error?

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Vicidial Agent API Error?

Postby developerdan » Wed Jul 25, 2018 3:24 am

Hi Folks,
I have a vicidial server running a custom screen for the agents that uses the agent API to manage most of the call behaviour.
Its been working for a year no problem but after a recent update to vicidial there seems to be a bug that has crept in.
I have been trying to track it down but as far as i can tell its something internal to VD.
I have logging on that shows the VD responses at each step so I know its getting to VD and VD believes its completed each step.

So the the bug itself:
The agent chooses to pause in our custom script but when they return to the VD agent screen they arent paused.

The script is doing the following in order :
Pause (comes back ok)
Disposition (comes back ok)
Pause Code (comes back ok)

Now the last one, pause code, according to the documentation should error if the agent isnt in pause at that time but VD says ok.
As far as I can tell the problem isnt in the api.php its somewhere else but before I dive into that code I was hoping someone might have seen this before and be able to say "oh you just do that".

If the agents pause and dispo through the agent interface it all works fine. So its something specific the API does or is doing.

Not sure what information is relevant as this is so specific but the agent screen uses javascript to hit a php script our side and then we use curl to hit the VD api.

As I say this has been working until a recent update in VD but im not ruling out it being something we have done. Though everything else works fine.

Any help would be greatly appreciated,
Dan
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby blackbird2306 » Wed Jul 25, 2018 4:51 am

What is your vicidial version and build now and what was it before you updated? Perhaps you made some customizations, which were deleted by updating vicidial. There is a api log report, which could be very useful to find out what happens.
Reports --> Admin Utilities --> API Log Report --> also check Show URLs, slower
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Vicidial Agent API Error?

Postby developerdan » Wed Jul 25, 2018 5:17 am

The mystery deepens (possibly.. im not sure if this is normal behaviour without something to compare it to).

I have turned on debug in the VD api (nice that thats a feature!) and i also forced a delay between each api call I send to VD so that I can see the updates in the DB to the live agent.

I noticed that when I send the hangup the agent (in live agents) gets "paused" (which i assume is normal) though I noticed external_hangup wasn't set to 1 (unless it updated faster than I could refresh ?).

After that it runs external_pause and I saw pause!epoch get set into the external_pause field (again i assume thats normal) but this didn't get removed (i assume because the agent is already status "paused" ?).

Then the disposition was sent through and that seemed to go through ok (lead was dispo'd and VD said ok).

Then the pause code was sent through and watching the db table the agent went from paused to ready.
Im not sure if this was the disposition or the pause_code that triggered this. It looks like pause_code but then I dont know what VD is doing in the background.
Again the return from the api was success for the pause code.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby developerdan » Wed Jul 25, 2018 5:22 am

blackbird2306 wrote:What is your vicidial version and build now and what was it before you updated? Perhaps you made some customizations, which were deleted by updating vicidial. There is a api log report, which could be very useful to find out what happens.
Reports --> Admin Utilities --> API Log Report --> also check Show URLs, slower


We havent customised any VD code other than some links in the admin section to point to custom php scripts.
From the logs everything looks like its working (which is why it seems like a bug somewhere).
As well as those VD logs I also have custom logging to log exactly what was sent to and from the API and they both tally up.

The VD version now is almost the latest (i have compared some files manually, like api.php and there havent been updates so its the latest in that sense).
The previous VD version was really old, maybe a year out of date (and we needed to update for the GDPR changes).
The actual VD version now is :
VERSION: 2.14-667a
BUILD: 180331-1715
According to the admin panel.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby blackbird2306 » Wed Jul 25, 2018 5:45 am

Please answer first:
blackbird2306 wrote:What is your vicidial version and build now and what was it before you updated?

It is not easy to follow your explanations. Provide us with the right order and full url you send through agent api, so that we can reproduce your situation. Maybe there is a bug.
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Vicidial Agent API Error?

Postby developerdan » Wed Jul 25, 2018 6:01 am

blackbird2306 wrote:Please answer first:
blackbird2306 wrote:What is your vicidial version and build now and what was it before you updated?

It is not easy to follow your explanations. Provide us with the right order and full url you send through agent api, so that we can reproduce your situation. Maybe there is a bug.


All the below urls start:
Code: Select all
https://test-vd/agc/api.php?user=****&pass=****&source=testapi


So the agents work in this order :

1. Update the lead Details :
Code: Select all
&agent_user=100&function=update_fields&title=&first_name=&middle_initial=&last_name=&email=&alt_phone=&comments=&address1=*****&address2=&address3=&city=******&province=*****&postal_code=*****


Response :
SUCCESS: update_fields lead updated -
Code: Select all
*********|100|11920578|address1="*****",address2="",address3="",alt_phone="",city="******",comments="",email="",first_name="",last_name="",middle_initial="",postal_code="******",province="*******",title=""


2. Hangup the call
Code: Select all
&agent_user=100&function=external_hangup&value=1


Response :
Code: Select all
SUCCESS: external_hangup function set - 1|100


3. Agent selected pause after dispo (so we send a pause first) :
Code: Select all
&agent_user=100&function=external_pause&value=PAUSE


Response :
Code: Select all
SUCCESS: external_pause function set - PAUSE|1532513668|100


4. Set the disposition
Code: Select all
&agent_user=100&function=external_status&value=N


Response :
Code: Select all
SUCCESS: external_status function set - N|100


5. Set the pause code
Code: Select all
&agent_user=100&function=pause_code&value=BREAK


Response:
Code: Select all
SUCCESS: pause_code function sent - 100



After this the page closes and on the main VD screen the agent is then ready again.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby blackbird2306 » Wed Jul 25, 2018 6:07 am

blackbird2306 wrote:Please answer first:
blackbird2306 wrote:What is your vicidial version and build now and what was it before you updated?
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Vicidial Agent API Error?

Postby developerdan » Wed Jul 25, 2018 6:11 am

blackbird2306 wrote:
blackbird2306 wrote:Please answer first:
blackbird2306 wrote:What is your vicidial version and build now and what was it before you updated?


Im afraid I dont know the version it was on before (unless there is a log you know of ?)

The version now is :
VERSION: 2.14-667a
BUILD: 180331-1715
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby mflorell » Wed Jul 25, 2018 7:06 am

A little over a year ago we completely rewrote the pausing code in the agent screen to greatly reduce the possibility of agents entering a state where they had a call but the agent screen was on pause without a way to handle the call. It's possible that change has affected how you used to use the API. Have you enabled Agent Screen Debug Logging on your system?
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Vicidial Agent API Error?

Postby developerdan » Wed Jul 25, 2018 7:08 am

mflorell wrote:A little over a year ago we completely rewrote the pausing code in the agent screen to greatly reduce the possibility of agents entering a state where they had a call but the agent screen was on pause without a way to handle the call. It's possible that change has affected how you used to use the API. Have you enabled Agent Screen Debug Logging on your system?


We have not, is that the same as sending format=debug to the API ?

Also im happy to change how we interact with the API to make it work if thats possible?
(if it is, is it just the order of commands?)
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby developerdan » Wed Jul 25, 2018 7:16 am

I found the logging (sorry should have poked around a bit more!)

Not sure the best way to send it through here though.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby developerdan » Wed Jul 25, 2018 7:28 am

This was the best I could do as [table] tags aren't enabled :)

Code: Select all
+----------------------+---------------------+---------------------+------------+----------------------+-------------------------------------+------------+------------------------------------------------------------------------+
| USER                 | SCREEN DATE         | DB DATE             | RUN TIME   | SCRIPT               | ACTION                              | LEAD_ID    | STAGE                                                                  |
+----------------------+---------------------+---------------------+------------+----------------------+-------------------------------------+------------+------------------------------------------------------------------------+
| 100                  | 2018-07-25 13:11:41 | 2018-07-25 13:11:42 | 1.00926    | vdc_db_query.php     | userLOGout                          | 0          | NORMAL 2.14-345 180228-0726                                            |
| 100                  | 2018-07-25 13:11:38 | 2018-07-25 13:11:40 | 0          | vicidial.php         | api_pause                           | 0          | 1|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:38 | 2018-07-25 13:11:40 | 0          | vicidial.php         | safe_pause_CFAI                     | 0          | 0|2 PAUSED                                                             |
| 100                  | 2018-07-25 13:11:40 | 2018-07-25 13:11:40 | 0.00839200 | conf_exten_check.php | refresh                             | 0          | PAUSED|4685876                                                         |
| 100                  | 2018-07-25 13:11:40 | 2018-07-25 13:11:40 | 0.006439   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:37 | 2018-07-25 13:11:39 | 0          | vicidial.php         | api_pause                           | 0          | 1|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:39 | 2018-07-25 13:11:39 | 0.006632   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:39 | 2018-07-25 13:11:39 | 0.008497   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685876                                                         |
| 100                  | 2018-07-25 13:11:37 | 2018-07-25 13:11:39 | 0          | vicidial.php         | safe_pause_CFAI                     | 0          | 0|3 PAUSED                                                             |
| 100                  | 2018-07-25 13:11:36 | 2018-07-25 13:11:38 | 0          | vicidial.php         | api_pause                           | 0          | 1|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:38 | 2018-07-25 13:11:38 | 0.008861   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685876                                                         |
| 100                  | 2018-07-25 13:11:38 | 2018-07-25 13:11:38 | 0.007477   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:36 | 2018-07-25 13:11:38 | 0          | vicidial.php         | safe_pause_CFAI                     | 0          | 0|4 PAUSED                                                             |
| 100                  | 2018-07-25 13:11:37 | 2018-07-25 13:11:37 | 0.006399   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:37 | 2018-07-25 13:11:37 | 0.007752   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685876                                                         |
| 100                  | 2018-07-25 13:11:35 | 2018-07-25 13:11:37 | 0          | vicidial.php         | safe_pause_CFAI                     | 0          | 0|5 PAUSED                                                             |
| 100                  | 2018-07-25 13:11:35 | 2018-07-25 13:11:37 | 0          | vicidial.php         | api_pause                           | 0          | 1|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:35 | 2018-07-25 13:11:37 | 0          | vicidial.php         | PauseCodeSelect_submit              | 0          | 2|Break                                                                |
| 100                  | 2018-07-25 13:11:36 | 2018-07-25 13:11:36 | 0.00784299 | vdc_db_query.php     | PauseCodeSubmit                     | 0          | 0|0||4685876|Break|                                                    |
| 100                  | 2018-07-25 13:11:34 | 2018-07-25 13:11:36 | 0          | vicidial.php         | AutoDial_ReSume_PauSe               | 0          | 1|VDADpause                                                            |
| 100                  | 2018-07-25 13:11:34 | 2018-07-25 13:11:36 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:36 | 2018-07-25 13:11:36 | 0.007773   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685876                                                         |
| 100                  | 2018-07-25 13:11:36 | 2018-07-25 13:11:36 | 0.006319   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:35 | 2018-07-25 13:11:35 | 0.007445   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:35 | 2018-07-25 13:11:35 | 0.009735   | conf_exten_check.php | refresh                             | 0          | READY|4685875                                                          |
| 100                  | 2018-07-25 13:11:33 | 2018-07-25 13:11:35 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:35 | 2018-07-25 13:11:35 | 0.007889   | vdc_db_query.php     | VDADpause                           | 0          | PAUSED|NEW_ID|4685876|                                                 |
| 100                  | 2018-07-25 13:11:32 | 2018-07-25 13:11:34 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:34 | 2018-07-25 13:11:34 | 0.00848    | conf_exten_check.php | refresh                             | 0          | READY|4685875                                                          |
| 100                  | 2018-07-25 13:11:34 | 2018-07-25 13:11:34 | 0.00622    | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:33 | 2018-07-25 13:11:33 | 0.00627    | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:33 | 2018-07-25 13:11:33 | 0.008172   | conf_exten_check.php | refresh                             | 0          | READY|4685875                                                          |
| 100                  | 2018-07-25 13:11:31 | 2018-07-25 13:11:33 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:30 | 2018-07-25 13:11:32 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:32 | 2018-07-25 13:11:32 | 0.008689   | conf_exten_check.php | refresh                             | 0          | READY|4685875                                                          |
| 100                  | 2018-07-25 13:11:32 | 2018-07-25 13:11:32 | 0.006567   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:31 | 2018-07-25 13:11:31 | 0.006232   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:31 | 2018-07-25 13:11:31 | 0.00802    | conf_exten_check.php | refresh                             | 0          | READY|4685875                                                          |
| 100                  | 2018-07-25 13:11:28 | 2018-07-25 13:11:31 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:26 | 2018-07-25 13:11:30 | 0          | vicidial.php         | EAcommentsBoxhide                   | 0          | 3|undefined                                                            |
| 100                  | 2018-07-25 13:11:26 | 2018-07-25 13:11:30 | 0          | vicidial.php         | CBcommentsBoxhide                   | 0          | 2|                                                                     |
| 100                  | 2018-07-25 13:11:30 | 2018-07-25 13:11:30 | 0.00791    | vdc_db_query.php     | VDADready                           | 0          | READY|NEW_ID|4685875|                                                  |
| 100                  | 2018-07-25 13:11:26 | 2018-07-25 13:11:30 | 0          | vicidial.php         | api_status                          | 0          | 1|N                                                                    |
| 100                  | 2018-07-25 13:11:26 | 2018-07-25 13:11:30 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532520684 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-25 13:11:30 | 2018-07-25 13:11:30 | 0.007867   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685874                                                         |
| 100                  | 2018-07-25 13:11:28 | 2018-07-25 13:11:28 | 0.006026   | vdc_db_query.php     | RUNurls                             | 0          | dispo                                                                  |
| 100                  | 2018-07-25 13:11:28 | 2018-07-25 13:11:28 | 0.017481   | vdc_db_query.php     | updateDISPO                         | 11920578   | TESTCAMP|OUT|N|                                                        |
| 100                  | 2018-07-25 13:11:28 | 2018-07-25 13:11:28 | 0.009378   | vdc_db_query.php     | CalLBacKCounT                       | 0          | TESTCAMP|0|0                                                           |
| 100                  | 2018-07-25 13:11:28 | 2018-07-25 13:11:28 | 0.008285   | vdc_db_query.php     | ManagerChatsCheck                   | 0          | 0||0                                                                   |
| 100                  | 2018-07-25 13:11:24 | 2018-07-25 13:11:28 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532520684                                                     |
| 100                  | 2018-07-25 13:11:28 | 2018-07-25 13:11:28 | 0.007747   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:26 | 2018-07-25 13:11:26 | 0.007362   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:20 | 2018-07-25 13:11:24 | 0          | vicidial.php         | api_hangup                          | 0          | 0|1                                                                    |
| 100                  | 2018-07-25 13:11:24 | 2018-07-25 13:11:24 | 0.008977   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:24 | 2018-07-25 13:11:24 | 0.00875    | vdc_db_query.php     | updateLEAD                          | 11920578   | 0|1|18662832|0                                                         |
| 100                  | 2018-07-25 13:11:22 | 2018-07-25 13:11:22 | 0.00775    | conf_exten_check.php | refresh                             | 0          | INCALL|4685873                                                         |
| 100                  | 2018-07-25 13:11:22 | 2018-07-25 13:11:22 | 0.007932   | vdc_db_query.php     | UpdateFields                        | 11920578   |                                                                        |
| 100                  | 2018-07-25 13:11:22 | 2018-07-25 13:11:22 | 0.007134   | manager_send.php     | Hangup                              | 0          | CALLHANGUP IAX2/127.0.0.1:40569-7137 192.168.9.153                     |
| 100                  | 2018-07-25 13:11:22 | 2018-07-25 13:11:22 | 0.007843   | manager_send.php     | Hangup                              | 0          |  Local/8600051@default-3dcf,1 192.168.9.153                            |
| 100                  | 2018-07-25 13:11:22 | 2018-07-25 13:11:22 | 0.03909    | vdc_db_query.php     | manDiaLlogCaLL                      | 11920578   | end                                                                    |
| 100                  | 2018-07-25 13:11:20 | 2018-07-25 13:11:20 | 0.007666   | conf_exten_check.php | refresh                             | 0          | INCALL|4685873                                                         |
| 100                  | 2018-07-25 13:11:18 | 2018-07-25 13:11:18 | 0.008228   | conf_exten_check.php | refresh                             | 0          | INCALL|4685873                                                         |
| 100                  | 2018-07-25 13:11:15 | 2018-07-25 13:11:15 | 0.006979   | vdc_db_query.php     | Log_Webform_Click                   | 11920578   | webform1                                                               |
| 100                  | 2018-07-25 13:11:15 | 2018-07-25 13:11:15 | 0.007921   | conf_exten_check.php | refresh                             | 0          | INCALL|4685873                                                         |
| 100                  | 2018-07-25 13:11:14 | 2018-07-25 13:11:14 | 0.009504   | conf_exten_check.php | refresh                             | 0          | INCALL|4685873                                                         |
| 100                  | 2018-07-25 13:11:14 | 2018-07-25 13:11:14 | 0.008186   | vdc_db_query.php     | manDiaLlookCaLL                     | 11920578   |                                                                        |
| 100                  | 2018-07-25 13:11:12 | 2018-07-25 13:11:14 | 0          | vicidial.php         | conf_send_recordingAUTO             | 0          | 0|MonitorConf 8600051    YES                                           |
| 100                  | 2018-07-25 13:11:14 | 2018-07-25 13:11:14 | 0.017092   | vdc_db_query.php     | manDiaLlogCaLL                      | 11920578   | start                                                                  |
| 100                  | 2018-07-25 13:11:13 | 2018-07-25 13:11:13 | 0.00721    | manager_send.php     | MonitorConf                         | 11920578   | MonitorConf                                                            |
| 100                  | 2018-07-25 13:11:11 | 2018-07-25 13:11:13 | 0          | vicidial.php         | NeWManuaLDiaLCalLSubmiT             | 0          | 0|NOW                                                                  |
| 100                  | 2018-07-25 13:11:13 | 2018-07-25 13:11:13 | 0.010114   | conf_exten_check.php | refresh                             | 0          | INCALL|4685873                                                         |
| 100                  | 2018-07-25 13:11:13 | 2018-07-25 13:11:13 | 0.008099   | vdc_db_query.php     | manDiaLlookCaLL                     | 11920578   |                                                                        |
| 100                  | 2018-07-25 13:11:12 | 2018-07-25 13:11:12 | 0.00830800 | vdc_db_query.php     | update_settings                     | 0          |                                                                        |
| 100                  | 2018-07-25 13:11:12 | 2018-07-25 13:11:12 | 0.016683   | vdc_db_query.php     | manDiaLnextCaLL                     | 11920578   | lookup|4685873|PAUSED|MANUAL_DIALNOW|8200123456|                       |
| 100                  | 2018-07-25 13:11:12 | 2018-07-25 13:11:12 | 0.007574   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:11 | 2018-07-25 13:11:11 | 0.007854   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:10 | 2018-07-25 13:11:10 | 0.007891   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:08 | 2018-07-25 13:11:08 | 0.007691   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:06 | 2018-07-25 13:11:06 | 0.00802399 | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:05 | 2018-07-25 13:11:05 | 0.00803199 | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:02 | 2018-07-25 13:11:04 | 0          | vicidial.php         | NeWManuaLDiaLCalL                   | 0          | 0|NO                                                                   |
| 100                  | 2018-07-25 13:11:04 | 2018-07-25 13:11:04 | 0.007785   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:03 | 2018-07-25 13:11:03 | 0.007618   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:02 | 2018-07-25 13:11:02 | 0.007731   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:01 | 2018-07-25 13:11:01 | 0.00910099 | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:11:00 | 2018-07-25 13:11:00 | 0.007491   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:10:59 | 2018-07-25 13:10:59 | 0.007765   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
| 100                  | 2018-07-25 13:10:57 | 2018-07-25 13:10:58 | 0          | vicidial.php         | LOGIN                               | 0          | 0|2.14-560c 180405-0913 /agc/vicidial.php                              |
| 100                  | 2018-07-25 13:10:58 | 2018-07-25 13:10:58 | 0.007755   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685873                                                         |
+----------------------+---------------------+---------------------+------------+----------------------+-------------------------------------+------------+------------------------------------------------------------------------+
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby developerdan » Wed Jul 25, 2018 7:47 am

Unfortunately I don't know if this is normal or not.

What appears to be odd is the pause on the live actions table never clears until the agent is readied again at the end.
This seems to appear in these logs too as "0|PAUSE!1532520684 ALREADY-RECEIVED" like its trying to re-pause the agent.

I can also see, after we send the disposition request and its processed, the ready is happening in vdc_db_query.php but i'm not sure whats sending the VDADready signal.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby developerdan » Thu Jul 26, 2018 5:19 am

Hey folks,
Im pretty keen to get this working again asap so is there anything i can do temporarily to fix this until a proper update or fix is released?
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby blackbird2306 » Thu Jul 26, 2018 8:30 am

As far as I can see in your logs the problem could have something to do with a persistent bug in the new check_for_auto_incoming process, which should fix pause-while-call-coming-in issues. I refer to my previous post (don't forget to read until the end):
http://vicidial.org/VICIDIALforum/viewtopic.php?f=4&t=38094

Matt fixed this bug with revision 2937, but there was a typing error I made, so he was too fast (EDIT: and the fix was not complete)!

@Matt please change it by deleting the 1, then it should be OK:

from
agent_log_id = AutoDial_ReSume_PauSe("VDADpause",'','','','','1','','YES');
to
agent_log_id = AutoDial_ReSume_PauSe("VDADpause",'','','','','','','YES');
Last edited by blackbird2306 on Thu Jul 26, 2018 8:50 am, edited 1 time in total.
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Vicidial Agent API Error?

Postby developerdan » Thu Jul 26, 2018 8:35 am

Hi Blackbird,
Sorry im a little confused.
Is this fix already in place in the repository?
If so I could just update the server to the latest tonight and fix the issue, happy days.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby blackbird2306 » Thu Jul 26, 2018 8:55 am

It was a bit of misunderstanding. We thought we had fixed it, but there was a "1" too much, which I have realized after he had changed it on 2nd. March this year. So updating won't help unless Matt will change the code. But you can try to change it yourself by reading the other post...
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Vicidial Agent API Error?

Postby developerdan » Thu Jul 26, 2018 9:18 am

Hi Blackbird,
Thanks for the info.
I have run a test on the test server but this hasnt fixed the issue.

The agent still comes out ready after the pause_code is sent.

Here is the new debug log

Code: Select all
+----------------------+---------------------+---------------------+------------+----------------------+-------------------------------------+------------+------------------------------------------------------------------------+
| USER                 | SCREEN DATE         | DB DATE             | RUN TIME   | SCRIPT               | ACTION                              | LEAD_ID    | STAGE                                                                  |
+----------------------+---------------------+---------------------+------------+----------------------+-------------------------------------+------------+------------------------------------------------------------------------+
| 100                  | 2018-07-26 15:17:06 | 2018-07-26 15:17:07 | 1.009682   | vdc_db_query.php     | userLOGout                          | 0          | NORMAL 2.14-345 180228-0726                                            |
| 100                  | 2018-07-26 15:17:04 | 2018-07-26 15:17:06 | 0          | vicidial.php         | api_pause                           | 0          | 1|PAUSE!1532614614 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-26 15:17:04 | 2018-07-26 15:17:06 | 0          | vicidial.php         | safe_pause_CFAI                     | 0          | 0|4 PAUSED                                                             |
| 100                  | 2018-07-26 15:17:06 | 2018-07-26 15:17:06 | 0.009378   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685892                                                         |
| 100                  | 2018-07-26 15:17:06 | 2018-07-26 15:17:06 | 0.007557   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-26 15:17:05 | 2018-07-26 15:17:05 | 0.008397   | vdc_db_query.php     | PauseCodeSubmit                     | 0          | 0|0||4685892|Break|                                                    |
| 100                  | 2018-07-26 15:17:05 | 2018-07-26 15:17:05 | 0.006545   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-26 15:17:05 | 2018-07-26 15:17:05 | 0.008227   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685892                                                         |
| 100                  | 2018-07-26 15:17:03 | 2018-07-26 15:17:05 | 0          | vicidial.php         | safe_pause_CFAI                     | 0          | 0|5 PAUSED                                                             |
| 100                  | 2018-07-26 15:17:03 | 2018-07-26 15:17:05 | 0          | vicidial.php         | api_pause                           | 0          | 1|PAUSE!1532614614 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-26 15:17:03 | 2018-07-26 15:17:05 | 0          | vicidial.php         | PauseCodeSelect_submit              | 0          | 2|Break                                                                |
| 100                  | 2018-07-26 15:17:02 | 2018-07-26 15:17:04 | 0          | vicidial.php         | AutoDial_ReSume_PauSe               | 0          | 1|VDADpause                                                            |
| 100                  | 2018-07-26 15:17:02 | 2018-07-26 15:17:04 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532614614 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-26 15:17:04 | 2018-07-26 15:17:04 | 0.009084   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685892                                                         |
| 100                  | 2018-07-26 15:17:04 | 2018-07-26 15:17:04 | 0.00653    | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-26 15:17:03 | 2018-07-26 15:17:03 | 0.00754    | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-26 15:17:01 | 2018-07-26 15:17:03 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532614614 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-26 15:17:03 | 2018-07-26 15:17:03 | 0.0093     | conf_exten_check.php | refresh                             | 0          | READY|4685891                                                          |
| 100                  | 2018-07-26 15:17:03 | 2018-07-26 15:17:03 | 0.008215   | vdc_db_query.php     | VDADpause                           | 0          | PAUSED|NEW_ID|4685892|                                                 |
| 100                  | 2018-07-26 15:17:00 | 2018-07-26 15:17:02 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532614614 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-26 15:17:02 | 2018-07-26 15:17:02 | 0.007922   | conf_exten_check.php | refresh                             | 0          | READY|4685891                                                          |
| 100                  | 2018-07-26 15:17:02 | 2018-07-26 15:17:02 | 0.00668    | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-26 15:17:01 | 2018-07-26 15:17:01 | 0.004122   | vdc_db_query.php     | VDADcheckINCOMING                   | 0          |                                                                        |
| 100                  | 2018-07-26 15:17:01 | 2018-07-26 15:17:01 | 0.005749   | conf_exten_check.php | refresh                             | 0          | READY|4685891                                                          |
| 100                  | 2018-07-26 15:16:58 | 2018-07-26 15:17:01 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532614614 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-26 15:17:00 | 2018-07-26 15:17:00 | 0.009018   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685890                                                         |
| 100                  | 2018-07-26 15:16:56 | 2018-07-26 15:17:00 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532614614 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-26 15:16:56 | 2018-07-26 15:17:00 | 0          | vicidial.php         | api_status                          | 0          | 1|N                                                                    |
| 100                  | 2018-07-26 15:16:56 | 2018-07-26 15:17:00 | 0          | vicidial.php         | CBcommentsBoxhide                   | 0          | 2|                                                                     |
| 100                  | 2018-07-26 15:16:56 | 2018-07-26 15:17:00 | 0          | vicidial.php         | EAcommentsBoxhide                   | 0          | 3|undefined                                                            |
| 100                  | 2018-07-26 15:17:00 | 2018-07-26 15:17:00 | 0.0099     | vdc_db_query.php     | VDADready                           | 0          | READY|NEW_ID|4685891|                                                  |
| 100                  | 2018-07-26 15:16:58 | 2018-07-26 15:16:58 | 0.006685   | vdc_db_query.php     | RUNurls                             | 0          | dispo                                                                  |
| 100                  | 2018-07-26 15:16:58 | 2018-07-26 15:16:58 | 0.011783   | vdc_db_query.php     | updateDISPO                         | 11920578   | TESTCAMP|OUT|N|                                                        |
| 100                  | 2018-07-26 15:16:58 | 2018-07-26 15:16:58 | 0.007806   | vdc_db_query.php     | CalLBacKCounT                       | 0          | TESTCAMP|0|0                                                           |
| 100                  | 2018-07-26 15:16:58 | 2018-07-26 15:16:58 | 0.006385   | vdc_db_query.php     | ManagerChatsCheck                   | 0          | 0||0                                                                   |
| 100                  | 2018-07-26 15:16:54 | 2018-07-26 15:16:58 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532614614 ALREADY-RECEIVED                                    |
| 100                  | 2018-07-26 15:16:58 | 2018-07-26 15:16:58 | 0.007335   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:52 | 2018-07-26 15:16:56 | 0          | vicidial.php         | api_pause                           | 0          | 0|PAUSE!1532614614                                                     |
| 100                  | 2018-07-26 15:16:56 | 2018-07-26 15:16:56 | 0.009071   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:54 | 2018-07-26 15:16:54 | 0.00741    | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:48 | 2018-07-26 15:16:52 | 0          | vicidial.php         | api_hangup                          | 0          | 0|1                                                                    |
| 100                  | 2018-07-26 15:16:52 | 2018-07-26 15:16:52 | 0.007815   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:52 | 2018-07-26 15:16:52 | 0.007847   | vdc_db_query.php     | updateLEAD                          | 11920578   | 0|1|12019595|0                                                         |
| 100                  | 2018-07-26 15:16:50 | 2018-07-26 15:16:50 | 0.007074   | vdc_db_query.php     | UpdateFields                        | 11920578   |                                                                        |
| 100                  | 2018-07-26 15:16:50 | 2018-07-26 15:16:50 | 0.007452   | conf_exten_check.php | refresh                             | 0          | INCALL|4685889                                                         |
| 100                  | 2018-07-26 15:16:50 | 2018-07-26 15:16:50 | 0.006366   | manager_send.php     | Hangup                              | 0          | CALLHANGUP IAX2/127.0.0.1:40569-1143 192.168.9.153                     |
| 100                  | 2018-07-26 15:16:50 | 2018-07-26 15:16:50 | 0.00882    | manager_send.php     | Hangup                              | 0          |  Local/8600051@default-33bd,1 192.168.9.153                            |
| 100                  | 2018-07-26 15:16:50 | 2018-07-26 15:16:50 | 0.034461   | vdc_db_query.php     | manDiaLlogCaLL                      | 11920578   | end                                                                    |
| 100                  | 2018-07-26 15:16:48 | 2018-07-26 15:16:48 | 0.007552   | conf_exten_check.php | refresh                             | 0          | INCALL|4685889                                                         |
| 100                  | 2018-07-26 15:16:47 | 2018-07-26 15:16:47 | 0.007833   | conf_exten_check.php | refresh                             | 0          | INCALL|4685889                                                         |
| 100                  | 2018-07-26 15:16:44 | 2018-07-26 15:16:44 | 0.007494   | conf_exten_check.php | refresh                             | 0          | INCALL|4685889                                                         |
| 100                  | 2018-07-26 15:16:43 | 2018-07-26 15:16:43 | 0.00774    | conf_exten_check.php | refresh                             | 0          | INCALL|4685889                                                         |
| 100                  | 2018-07-26 15:16:41 | 2018-07-26 15:16:43 | 0          | vicidial.php         | conf_send_recordingAUTO             | 0          | 0|MonitorConf 8600051    YES                                           |
| 100                  | 2018-07-26 15:16:43 | 2018-07-26 15:16:43 | 0.00648100 | vdc_db_query.php     | Log_Webform_Click                   | 11920578   | webform1                                                               |
| 100                  | 2018-07-26 15:16:42 | 2018-07-26 15:16:42 | 0.009497   | vdc_db_query.php     | manDiaLlogCaLL                      | 11920578   | start                                                                  |
| 100                  | 2018-07-26 15:16:42 | 2018-07-26 15:16:42 | 0.00765    | manager_send.php     | MonitorConf                         | 11920578   | MonitorConf                                                            |
| 100                  | 2018-07-26 15:16:42 | 2018-07-26 15:16:42 | 0.009309   | vdc_db_query.php     | manDiaLlookCaLL                     | 11920578   |                                                                        |
| 100                  | 2018-07-26 15:16:42 | 2018-07-26 15:16:42 | 0.010426   | conf_exten_check.php | refresh                             | 0          | INCALL|4685889                                                         |
| 100                  | 2018-07-26 15:16:40 | 2018-07-26 15:16:42 | 0          | vicidial.php         | NeWManuaLDiaLCalLSubmiT             | 0          | 0|NOW                                                                  |
| 100                  | 2018-07-26 15:16:41 | 2018-07-26 15:16:41 | 0.018033   | vdc_db_query.php     | manDiaLnextCaLL                     | 11920578   | lookup|4685889|PAUSED|MANUAL_DIALNOW|8200123456|                       |
| 100                  | 2018-07-26 15:16:41 | 2018-07-26 15:16:41 | 0.008269   | vdc_db_query.php     | update_settings                     | 0          |                                                                        |
| 100                  | 2018-07-26 15:16:41 | 2018-07-26 15:16:41 | 0.007806   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:40 | 2018-07-26 15:16:40 | 0.007521   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:37 | 2018-07-26 15:16:39 | 0          | vicidial.php         | NeWManuaLDiaLCalL                   | 0          | 0|NO                                                                   |
| 100                  | 2018-07-26 15:16:39 | 2018-07-26 15:16:39 | 0.007776   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:38 | 2018-07-26 15:16:38 | 0.007583   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:37 | 2018-07-26 15:16:37 | 0.007952   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:36 | 2018-07-26 15:16:36 | 0.007855   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:35 | 2018-07-26 15:16:35 | 0.007416   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:34 | 2018-07-26 15:16:34 | 0.007425   | conf_exten_check.php | refresh                             | 0          | PAUSED|4685889                                                         |
| 100                  | 2018-07-26 15:16:33 | 2018-07-26 15:16:34 | 0          | vicidial.php         | LOGIN                               | 0          | 0|2.14-560c 180405-0913 /agc/vicidial.php                              |
+----------------------+---------------------+---------------------+------------+----------------------+-------------------------------------+------------+------------------------------------------------------------------------+
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby blackbird2306 » Thu Jul 26, 2018 6:03 pm

I have tested it, but I cannot replicate your problem. What is your dial method in campaign settings? And what is the value in "Manual Auto Next Seconds" in your campaign settings (is it disabled with 0)?

Other settings you can play with for testing:
Agent Pause Codes Active
Auto Pause Pre-Call Work
Auto Resume Pre-Call Work
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Vicidial Agent API Error?

Postby developerdan » Fri Jul 27, 2018 3:17 am

Hi Blackbird,
I have tried varying the dial method. The live dialler is run on auto dial and uses ratio.
I am running on manual for testing.
if the agents don't use the custom screen it pauses them fine.
The exact svn number (just realised i hadn't posted that sorry!) is 2962.

Its only a couple of months since it was updated but I could upgrade them to the latest just to rule that out?
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby developerdan » Fri Jul 27, 2018 7:04 am

Hi Folks,
I have updated the test server to 3009 with db version 1549.
Also removed any custom patches (they were just minor UI tweaks but I thought it best to be sage) and I still get the same issue.

Im not really sure what to try next so any help / suggestions would be appreciated.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby mflorell » Fri Jul 27, 2018 7:49 pm

Blackbird, I just fixed that typo in svn/trunk :)
revision 3010
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Vicidial Agent API Error?

Postby developerdan » Mon Jul 30, 2018 5:19 am

Unfortunately this hasn't fixed this API issue.
I'm not sure the API issue is related to the other thread.

Is there any more debug i can output that would be useful for you guys ?
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby williamconley » Mon Jul 30, 2018 6:10 am

If I recall, these commands are forwarded to the agent's screen session. Then they are executed by the agent's screen, not php or perl server-side. So you'll need to debug the agent screen (Javascript console) to see what's going wrong.

Usually turns out to be a chase scenario in AJAX where the results of a request are not yet available (because ... AJAX is asynchronous) when an attempt is made to use those results (that's a pure generalization of 90% of the problems that involve AJAX but aren't resolved in 15 minutes).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Vicidial Agent API Error?

Postby developerdan » Mon Jul 30, 2018 6:23 am

williamconley wrote:If I recall, these commands are forwarded to the agent's screen session. Then they are executed by the agent's screen, not php or perl server-side. So you'll need to debug the agent screen (Javascript console) to see what's going wrong.

Usually turns out to be a chase scenario in AJAX where the results of a request are not yet available (because ... AJAX is asynchronous) when an attempt is made to use those results (that's a pure generalization of 90% of the problems that involve AJAX but aren't resolved in 15 minutes).


So when say http://server/agc/api.php?source=test&u ... us&value=A
is hit its actually winding its way back into the agents' screen javascript ?

If thats the case I will see if i can see anything odd.
Is there anything specific I should be looking for ?
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby williamconley » Mon Jul 30, 2018 6:36 am

The agent screen will receive the "do this" in an AJAX response, then be expected to ... "do this" in javascript, which will generate yet another AJAX request. Since this is all asynchronous, it's kind of convoluted.

In longer technobabble: Vicidial says "hey, you got anything for me?" and then sets a watchdog script to execute the response, whenever it arrives. When the response arrives via an ajax return, the request is processed by javascript, and if it's something that requires communication with the server (which it pretty much always is ...) then the javascript has to generate yet another AJAX request, this time "do this!" and await a confirmation response, then make whatever change internally is necessary to acknowledge that "success" response. Timing is very important during all of this.

Happy Hunting 8-)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Vicidial Agent API Error?

Postby developerdan » Mon Jul 30, 2018 7:08 am

williamconley wrote:The agent screen will receive the "do this" in an AJAX response, then be expected to ... "do this" in javascript, which will generate yet another AJAX request. Since this is all asynchronous, it's kind of convoluted.

In longer technobabble: Vicidial says "hey, you got anything for me?" and then sets a watchdog script to execute the response, whenever it arrives. When the response arrives via an ajax return, the request is processed by javascript, and if it's something that requires communication with the server (which it pretty much always is ...) then the javascript has to generate yet another AJAX request, this time "do this!" and await a confirmation response, then make whatever change internally is necessary to acknowledge that "success" response. Timing is very important during all of this.

Happy Hunting 8-)


Interesting!
Unless im mistaken its never getting a pause.
After dispo there is no entry for vdc_db_query being hit with anything relating to pause until it gets to VDADready (which looks like an unpause if anything).
Just before that there is a conf_exten_check that has this response :

Code: Select all
DateTime: 2018-07-30 13:00:27|UnixTime: 1532952027|Logged-in: N|CampCalls: N|Status: PAUSED|DiaLCalls: N|APIHanguP: 0|APIStatuS: ::::::::::|APIPausE: PAUSE!1532952022|APIDiaL: |DEADcall: 0|InGroupChange: 0||||APIFields: 0|APIFieldsData: |APITimerAction: |APITimerMessage: |APITimerSeconds: -1|APIdtmf: |APItransferconf: |APIpark: |APITimerDestination: |APIManualDialQueue: 0|APIRecording: |APIPaUseCodE: BREAK|WaitinGChats: N|WaitinGEmails: N|LivEAgentCommentS: |LeadIDSwitch: 0|DEADxfer: 0
1|SIP/cc200-00000006 ~


But it seems like its not processing that anywhere.
Hopefully this makes some sense. Im not that familiar with how this is meant to work, code wise, so im fumbling about a little bit .
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby williamconley » Mon Jul 30, 2018 7:15 am

First watch the ajax response in something that Works. Then watch it in something that doesn't. You may need to add some debug lines in the agent screen. Don't try to do this with a live call or real data. Just stick to the single command during a controlled scenario. Learning to debug the agent screen is all about the javascript (which can freak out many php/perl/mysqsl coders).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Vicidial Agent API Error?

Postby developerdan » Mon Jul 30, 2018 7:17 am

williamconley wrote:First watch the ajax response in something that Works. Then watch it in something that doesn't. You may need to add some debug lines in the agent screen. Don't try to do this with a live call or real data. Just stick to the single command during a controlled scenario. Learning to debug the agent screen is all about the javascript (which can freak out many php/perl/mysqsl coders).


Ah ok I was under the impression I could use the devtools in chrome.

I will start dumping and see what I can find.

Thanks for your help :)
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby developerdan » Mon Jul 30, 2018 7:32 am

One last thing, Just ran a very quick compare between the two processes.

Its very clear there is an ajax request missing in the API version.
The VDADpause isnt being sent when using the API pause.

I cant yet see why, but do you know what tells the agent screen to pause, i have been assuming something within the live agent table but comparing that between the two processes is a little tricky as it updates so fast.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby developerdan » Mon Jul 30, 2018 7:57 am

Looking at the way the UI does the pause and dispo.
It looks like it calls disposition first then pause.
According to the agent api docs its meant to be pause then dispo then pausecode.

If I change my order to dispo then call pause then pausecode it does put the agent in pause but they are live briefly as well meaning they could get hit with a call in between.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby blackbird2306 » Mon Jul 30, 2018 10:19 am

Ok I`ve looked deeper in the code. My first question: Are you debugging your problem on a test environment without real live calls or do you test it on real production. It is important that you have a real "LIVE CALL" (you can see it on agent panel at right side on the top) when you are using the API. If not then VD_live_customer_call variable will be "0" and the "document.vicidial_form.DispoSelectStop.checked=true;" code will never be executed. Another very important thing is the right order of you API calls. This is the right order:
1. make sure it's a "live call"
1. send external_pause before hangup (otherwise VD_live_customer_call variable is "0")
2. then send external_hangup
3. then send external_status

And now I have a small fix for testing purposes. Just to see, if we are on the right track. Change code in "vicidial.php" (newest revision 3010) about line 5932:
add the green line:
if (APIPausE_array[0]=='PAUSE')
{
if (VD_live_customer_call==1)
{
// set to pause on next dispo
document.vicidial_form.DispoSelectStop.checked=true;
// alert("Setting dispo to PAUSE");
temp_APIPausE_message='PAUSE-DISPO-SET';
}
else
{
document.vicidial_form.DispoSelectStop.checked=true;
if (AutoDialReady==1)
{
if (auto_dial_level != '0')
{
AutoDialWaiting = 0;
AutoDial_ReSume_PauSe("VDADpause");
temp_APIPausE_message='PAUSE-SET';
}
VICIDiaL_pause_calling = 1;
}

Please test this test fix and give us feedback!
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Vicidial Agent API Error?

Postby developerdan » Mon Jul 30, 2018 10:29 am

blackbird2306 wrote:Ok I`ve looked deeper in the code. My first question: Are you debugging your problem on a test environment without real live calls or do you test it on real production. It is important that you have a real "LIVE CALL" (you can see it on agent panel at right side on the top) when you are using the API. If not then VD_live_customer_call variable will be "0" and the "document.vicidial_form.DispoSelectStop.checked=true;" code will never be executed. Another very important thing is the right order of you API calls. This is the right order:
1. make sure it's a "live call"
1. send external_pause before hangup (otherwise VD_live_customer_call variable is "0")
2. then send external_hangup
3. then send external_status


I will go away and give that a try but just wanted to answer your questions / ask a couple of my own:
I am using a test server but its setup to call through to music on hold in asterisk. So as far as vicidial is concerned this is a live call and VD behaves as such.
If I need to I can make live calls (and the same issue happens on my mobile for example).

1. send external_pause before hangup (otherwise VD_live_customer_call variable is "0")

Has this always been the case/ is this actually a hard requirement now ?
The agent screen forces you to hangup before pausing.
I can rewrite the custom code to do that but its a major flow change (and what happens if the customer hangs up before the agent sends a pause?)

This custom code was written a little while ago but it did work, the order was :
  • hangup
  • pause (if selected)
  • dispo
  • pausecode (if pause selected)

and that worked fine (it was built to emulate the agent screens order as well).
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby williamconley » Mon Jul 30, 2018 1:01 pm

developerdan wrote:Ah ok I was under the impression I could use the devtools in chrome.

I will start dumping and see what I can find.

Thanks for your help :)

lol: That's a good place to watch the javascript in action. Same thing applies in Firefox and IE. There are also some debugging options inserted for this purpose directly into the code, but sometimes you have to add your own code to dump to the console and see if anything was lost. You sound like you may enjoy this as much as we do. 8-)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Vicidial Agent API Error?

Postby developerdan » Tue Jul 31, 2018 9:49 am

Im not sure if this is even an answer-able question (and I have been staring at this code for so long im questioning if im making any sense...) but...
  • as per my previous post, what is the correct order for the API calls?
  • Should I just copy what the agent screen is doing (disposition then pause?!) ? (It seems like I will get calls through and it negates the whole point of pause after dispo-ing in the first place?)
  • As far as I can tell the API isnt setting something to tell to the agent interface to send the pause signal. (i.e. AutoDial_ReSume_PauSe isnt being called because something isnt being returned in the vdc_conf_check.php call which is set by api.php).
    Im struggling to see what the correct signal/s are meant to be for this specific use case. I dont want to set the wrong flags and have it break under a different circumstance.

So thinking out loud here... (maybe someone will see something or I will) :
From the vicidial.php page I need AutoDial_ReSume_PauSe("VDADpause") to be called.
I can see this is called from :
  • line ~13785(DispoSelect_submit)
  • ~18054 (start_all_refresh)
  • ~ 5948 (check_for_conf_calls)
  • ~11199 (check_for_auto_incoming)
  • ~13059(PauseCodeSelectContent_create)
(*NOTE i only highlighted the ones I think I could hit, the others are for settings/features not turned on).

Out of those, I am not 100% sure which the API should get picked up in. possibly the check_for commands functions or DispoSelect?

Any help or pointers here would be superb!
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby developerdan » Tue Jul 31, 2018 9:52 am

Also, someone just pointed out, it does look like the agent is paused (*briefly until after dispo) so is it possible the problem is with another bit of code making us go live when it shouldn't ?
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby blackbird2306 » Tue Jul 31, 2018 11:16 am

Again it's important that you are on a real live call and I doubt, whether you are really on a live call with MOH extension. Just watch for VD_live_customer_call variable (debug on console) is it really 1? I have noticed that "pause after dispo" (Next Call Pause) function only works in API call, when you are on a live call (VD_live_customer_call variable is 1). If you hangup first (VD_live_customer_call variable is then 0) and afterwards send the pause command through the api it will not work.

So if you want to pause after the dispo then this is the right order:
1. send pause (during live call to flag Next Call Pause; it is ok when customer hangs up first)
2. send hangup
3. send external status

If you only want to hangup and dispo the call (and be READY right after disposing):
1. send hangup (this will pause agent status until you have sent the external_status)
2. send external status

I can rewrite the custom code to do that but its a major flow change (and what happens if the customer hangs up before the agent sends a pause?)

The "VD_live_customer_call variable" stays at "1", so you are still able to send pause command before hangup!

Did you change the part by adding "document.vicidial_form.DispoSelectStop.checked=true;" line at the right place?
Last edited by blackbird2306 on Tue Jul 31, 2018 11:24 am, edited 1 time in total.
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Vicidial Agent API Error?

Postby developerdan » Tue Jul 31, 2018 11:22 am

blackbird2306 wrote:Again it's important that you are on a real live call and I doubt, whether you are really on a live call with MOH extension. Just watch for VD_live_customer_call variable (debug on console) is it really 1? I noticed that "pause after dispo" (Next Call Pause) function only works in API call when you are on a live call (VD_live_customer_call variable is 1). If you hangup first (VD_live_customer_call variable is then 0) and afterwards send the pause command through the api it will not work.


Its definitely a live call. As I said this not only happens on the live server but also if I dont use the music on hold number it happens for my mobile as well.

What you are saying about pause must come before hangup makes me think that is where the problem is.
In the agents screen you HAVE to hangup before dispo, so the API should (and used to) be ok with this.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Re: Vicidial Agent API Error?

Postby blackbird2306 » Tue Jul 31, 2018 11:27 am

If you make the change about line 5932 by adding the line, then it will also work with your actual configuration without the right order! Just try it out!
Last edited by blackbird2306 on Tue Jul 31, 2018 11:29 am, edited 1 time in total.
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Vicidial Agent API Error?

Postby developerdan » Tue Jul 31, 2018 11:28 am

blackbird2306 wrote:Did you change the part by adding "document.vicidial_form.DispoSelectStop.checked=true;" line at the right place?


I somehow missed that suggestion entirely.
That does work!

Will that affect any other flows though ?
Obviously I dont want people pausing when they dont want to.
developerdan
 
Posts: 37
Joined: Thu Apr 18, 2013 3:53 am

Next

Return to Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 119 guests