Session_Id for blind_monitor with NON-AGENT_API

All installation and configuration problems and questions

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

Session_Id for blind_monitor with NON-AGENT_API

Postby pokiboum » Wed Dec 23, 2015 10:02 pm

Hi everyone,

I spent lot of time reading all the manual to use NON-AGENT_API and looking in google informations about vicidial API because i'm making a little JAVA program to manage my agents.

I would like to use the blind_monitor function but I have a problem to find the session_id of the agent connected I would like to listen.

Does it exist a way to get the session_id of all agents connected with a command ? I can see the session_id of them in Real Time Report but i would like to have a way to "extract it" to use it my program.

Thanks you for your help !
pokiboum
 
Posts: 8
Joined: Wed Dec 23, 2015 9:36 pm

Re: Session_Id for blind_monitor with NON-AGENT_API

Postby mflorell » Wed Dec 23, 2015 10:23 pm

After looking into this, it looks like there is nothing other than the real-time report that will show the session id of all agents logged into the system.

This looks like a good candidate for a new feature. Please create a new Issue Tracker ticket for this(with a more in-depth description) and link it in this forum post.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Session_Id for blind_monitor with NON-AGENT_API

Postby williamconley » Wed Dec 23, 2015 10:53 pm

Or skip the api and just query the live agents table directly. Would be a good api function, though (for those not wanting to give direct db access to someone who must have this information).
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: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Session_Id for blind_monitor with NON-AGENT_API

Postby pokiboum » Sat Dec 26, 2015 6:26 am

Hi, I found a little solution for my issue, maybe it can help someone :

I found it in AGENT_API ( instead of NON-AGENT_API ) : you have a function "recording", it sends a recording start/stop signal or status of agent recording, the option STATUS of this function displays results of active recording and agent session information, we don't care about it BUT it provide the SessionId in the answer :)

Exemple :
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=recording&value=STATUS


Result possible :
- ERROR: no user found - 6666
- ERROR: agent_user is not logged in - 6666
- NOTICE: not recording - 6666|||||192.168.1.5|8600051|PAUSED
- NOTICE: recording active - 6666|121242|20120810-012008__6666_|192.168.1.5|2012-08-10 01:20:10|192.168.1.5|8600051|PAUSED

So if the user in logged in, you just have to take the 7th parameter of the result and it's the SessionId of the user ( in the exemple : 8600051 )

rtfm : http://www.vicidial.org/docs/AGENT_API.txt
pokiboum
 
Posts: 8
Joined: Wed Dec 23, 2015 9:36 pm

Re: Session_Id for blind_monitor with NON-AGENT_API

Postby mflorell » Sat Dec 26, 2015 8:32 am

Good eye for spotting that one!

Although it still won't give you a list of logged-in agents, which would be a very useful and simple function to add.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Session_Id for blind_monitor with NON-AGENT_API

Postby mflorell » Sat Dec 26, 2015 10:02 am

I just added the "session_id" field to the existing "agent_status" Non-Agent API function.

I also went ahead and added a new "logged_in_agents" Non-Agent API function:


--------------------------------------------------------------------------------
logged_in_agents - list of agents that are logged in to the system

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)

OPTIONAL FIELDS-
campaigns - pipe-delimited list of campaigns to get status information for "TESTCAMP|INBOUND", default is all campaigns shown
user_groups - pipe-delimited list of user groups to get status information for "ADMIN|AGENTS", default is all user groups shown
show_sub_status - show agent sub-status and pause_code, requires log lookup, (YES|NO) default is NO

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: logged_in_agents USER DOES NOT HAVE PERMISSION TO GET AGENT INFO - 6666|0
ERROR: logged_in_agents NO LOGGED IN AGENTS

A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format:
user|campaign_id|session_id|status|lead_id|callerid|calls_today|full_name|user_group|user_level
6666|TESTCAMP|8600051|PAUSED|1079409||1|Admin|ADMIN|9

user,campaign_id,session_id,status,lead_id,callerid,calls_today,full_name,user_group,user_level,pause_code,sub_status
6666,TESTCAMP,8600051,INCALL,1079409,M2260919190001079409,1,Admin,ADMIN,9,LOGIN,DEAD
4545,TESTCAMP,8600052,PAUSED,0,,0,4545,MIKESGROUP,8,LOGIN,

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: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: No registered users and 130 guests