Page 1 of 1

Questions about using vicidial_live_agents

PostPosted: Wed Mar 15, 2017 8:14 am
by mgiessler
Hello,

with help of the
CRM_EXAMPLE_SKIN.txt
and the APIs
Use the APIs:
AGENT_API.txt
NON-AGENT_API.txt

I (think) learned and understand how to communicate with VICIdial an out web-bases customer site.
It works fine, but our agents and myself are not happy with the recommended sleep(2) between executing API functions.
So in the AGENT_API there are two examples of querying the API functions in mysql.

update vicidial_live_agents set external_hangup=1 where user='1000';
update vicidial_live_agents set external_status='A' where user='1000';

In case i want to tell vicidial
To hangup the call, disposition it and then pause the agent ido the following code:

http://server/agc/api.php?source=test&u ... alue=PAUSE
sleep(2);
http://server/agc/api.php?source=test&u ... alue=BREAK
sleep(2);
http://server/agc/api.php?source=test&u ... up&value=1
sleep(2);
http://server/agc/api.php?source=test&u ... us&value=A
sleep(2);

Now i want to do it within an mysql query:
Single Querys
update vicidial_live_agents set external_pause=1 where user='1000';
update vicidial_live_agents set pause_code='BREAK' where user='1000';
update vicidial_live_agents set external_hangup=1 where user='1000';
update vicidial_live_agents set external_status='A' where user='1000';

Or can i do it like this:
update vicidial_live_agents set
external_pause=1,
pause_code='BREAK'
set external_hangup=1
external_status='A'
where user='1000';

Another thing is that i use the NON-Agent-API to get the Agent Status (PAUSED, DISPO, INCALL, ...) (polled every second)
Am I right i can do a Query LIKE this to get all agents with their current status?
select status from vicidial_live_agents;

thank you for you help and comments

Re: Questions about using vicidial_live_agents

PostPosted: Wed Mar 15, 2017 9:00 am
by mflorell
You'll just have to see how it works for your system and agents. Those recommendations are for safe best results, and there are issues that can happen if you try to send actions too quickly.

Re: Questions about using vicidial_live_agents

PostPosted: Wed Mar 15, 2017 9:23 am
by mgiessler
Hello Mr. Florell,

thanks for the quick response :-)
I have tried with no sleep, sleep(1) sleep(2).
Tests have shown hat no sleep leads to conflicts, i.e pause_code could net be set, because "Agent is not paused" at the request moment.
Working with the api, bind http://... works 100% safe with sleep(1) 98% sleep(1) an 50% with no sleep in code.
So working with sleep is in my opion always a good idea in our use-case.

What about the Database queries?
Am I correct when "fireing" these separately?

best regards

Re: Questions about using vicidial_live_agents

PostPosted: Wed Mar 15, 2017 9:31 am
by mflorell
As for using the DB queries directly, they don't have any safeguards like the API has, so you'll just have to see if they cause any issues for how you have your system set up.