API for Agent Screen

All installation and configuration problems and questions

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

API for Agent Screen

Postby antuan » Sun May 01, 2016 11:42 am

Hello!!!!

I would like you to tell me if there exist api wich I can see lead_id or phone_number that has come to agent from the predictive dialer?

Thankssssss
Vicibox 11.0.1 from ViciBox_v11.x86_64-11.0.1.iso | VERSION: 2.14-906a - BUILD: 240214-2120 | Asterisk 16.30.0-vici | Cluster Servers | SVN: 3804| DB Schema: 1707 | No Digium/Sangoma Hardware | No Extra Software After Installation
antuan
 
Posts: 53
Joined: Mon Mar 21, 2016 6:10 pm

Re: API for Agent Screen

Postby antuan » Sun May 01, 2016 3:17 pm

My problem should be solved by this fuction

st_get_agent_active_lead
http://192.168.1.100/agc/api.php?
source=api_admin&user=6666&pass=123qwe456&function=st_get_agent_active_lead&value=876543&vendor_id=207

my question is whats means value=876543 and vendor_id=207 and where i can find them.
Vicibox 11.0.1 from ViciBox_v11.x86_64-11.0.1.iso | VERSION: 2.14-906a - BUILD: 240214-2120 | Asterisk 16.30.0-vici | Cluster Servers | SVN: 3804| DB Schema: 1707 | No Digium/Sangoma Hardware | No Extra Software After Installation
antuan
 
Posts: 53
Joined: Mon Mar 21, 2016 6:10 pm

Re: API for Agent Screen

Postby mflorell » Sun May 01, 2016 3:42 pm

You are actually looking for the Non-agent API, since this does not affect the logged-in agent screen,
http://vicidial.org/docs/NON-AGENT_API.txt

Here's the function you want:

--------------------------------------------------------------------------------
agent_status - real-time status of one agent user

NOTE: api user for this function must have user_level set to 7 or higher and "view reports" enabled

REQUIRED FIELDS-
source - description of what originated the API call (maximum 20 characters)
agent_user - 2-20 characters, use only for one agent status

SETTINGS FIELDS-
stage - the format of the exported data: csv, tab, pipe(default)
header - include a header(YES) or not(NO). This is optional, default is not to include a header

Example URL strings for API calls:
http://server/vicidial/non_agent_api.ph ... header=YES

Example responses:
ERROR: agent_status USER DOES NOT HAVE PERMISSION TO GET AGENT INFO - 6666|0
ERROR: agent_status INVALID SEARCH PARAMETERS - 6666||
ERROR: agent_status AGENT NOT FOUND - 6666||
ERROR: agent_status AGENT NOT LOGGED IN - 6666||

A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format:
status,call_id,lead_id,campaign_id,calls_today,full_name,user_group,user_level,pause_code,real_time_sub_status,phone_number,vendor_lead_code,session_id
INCALL,M4050908070000012345,12345,TESTCAMP,1,Test Agent,AGENTS,3,LOGIN,,7275551212,123456,8600051
INCALL|M4181606420000000104|104|TESTBLND|1|Admin|ADMIN|9|BRK2|DEAD|3125551212|123457|8600051
PAUSED||105|TESTBLND|1|Admin|ADMIN|9||PREVIEW|9545551212|123458|8600052

NOTE: real_time_sub_status field can consist of: DEAD, DISPO, 3-WAY, PARK, RING, PREVIEW or it can be empty
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: API for Agent Screen

Postby antuan » Sun May 01, 2016 5:03 pm

mflorell thanksssssssssssss!!!!!!!
Vicibox 11.0.1 from ViciBox_v11.x86_64-11.0.1.iso | VERSION: 2.14-906a - BUILD: 240214-2120 | Asterisk 16.30.0-vici | Cluster Servers | SVN: 3804| DB Schema: 1707 | No Digium/Sangoma Hardware | No Extra Software After Installation
antuan
 
Posts: 53
Joined: Mon Mar 21, 2016 6:10 pm

Re: API for Agent Screen

Postby antuan » Mon May 02, 2016 4:38 am

Does the API agent_status exist in sql query?

I run the query

SELECT extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and vicidial_users.user_hide_realtime='0' and vicidial_live_agents.campaign_id IN('500','') order by full_name desc,status desc,last_call_time desc;

but it did not show the line is DEAD or DISPO...

Can you help me to find the right query.

The API agent_status you have got has nice informations!!!!!
status,callerid,lead_id,campaign_id,calls_today,full_name,user_group,user_level
INCALL,M5021300530000000082,82,500,38,Stadar User,AGENTS,1,ANDIAL,DEAD,XXXXXXXXXX,XXXXXXXXX,8600051

Please i want it SQL QUERY
I would apretiate if you could help me

Thanksssssssssss :)
Vicibox 11.0.1 from ViciBox_v11.x86_64-11.0.1.iso | VERSION: 2.14-906a - BUILD: 240214-2120 | Asterisk 16.30.0-vici | Cluster Servers | SVN: 3804| DB Schema: 1707 | No Digium/Sangoma Hardware | No Extra Software After Installation
antuan
 
Posts: 53
Joined: Mon Mar 21, 2016 6:10 pm

Re: API for Agent Screen

Postby mflorell » Mon May 02, 2016 5:43 am

It's all there in the code, and it's not a single SQL query that provides that information, it's multiple SQL queries based upon what other values are.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: Majestic-12 [Bot] and 113 guests