non_agent_api.php not sending password and session id

All installation and configuration problems and questions

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

non_agent_api.php not sending password and session id

Postby vijaymuddu » Tue Feb 20, 2018 9:11 am

Hi

I am facing problem where non_agent_api.php is not sending password and session id in the output, below is the output of api

Dispose url
"VARhttp://server-ip/index.php/api/dailer/dashboard/1?user=--A--user--B--&pass=&campaign=--A--campaign--B--&source=--A--list_id--B--&DIALER_CAMPAIGN=--A--campaign--B--&DIALER_SERVER=--A--server_ip--B--&session=--A--session_id--B—"

Values i am getting is as below

"http://server-ip/index.php/api/dailer/dashboard/1?user=akshays&pass=&campaign=RARCL&source=&DIALER_CAMPAIGN=RARCL&DIALER_SERVER=144.24.121.131&session=--A--session_id--B%E4%80%80"

Can any body suggest how can i fix it
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby blackbird2306 » Tue Feb 20, 2018 12:07 pm

I believe you mean "Dispo Call URL" or "Start Call URL" in campaign setting and not non_agent_api? The password variable (--A--pass--B--) is missing and in your session_id variable there is "--B—" at the end and not "--B--". Try this:
Code: Select all
VARhttp://server-ip/index.php/api/dailer/dashboard/1?user=--A--user--B--&pass=--A--pass--B--&campaign=--A--campaign--B--&source=--A--list_id--B--&DIALER_CAMPAIGN=--A--campaign--B--&DIALER_SERVER=--A--server_ip--B--&session=--A--session_id--B--

But also your url "http://server-ip/index.php/api/dailer/dashboard/1?..." seems to be wrong. It should be something like "http://server-ip/api/dailer/dashboard/1/index.php?..."
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: non_agent_api.php not sending password and session id

Postby vijaymuddu » Tue Feb 20, 2018 1:29 pm

Hi Blackbird

Thanks for replying. my issue has been resolved now i am getting password and session id

Also i want to know which is stable version or trunk which can be used in production
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby blackbird2306 » Tue Feb 20, 2018 7:20 pm

All versions are stable in production environment and your version too. Updates will create new features and fix some bugs. It's always recommended to upgrade at certain intervals, but it's not a must. Upgrading is easy, look here: http://www.vicidial.org/VICIDIALforum/viewtopic.php?t=16326
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: non_agent_api.php not sending password and session id

Postby vijaymuddu » Wed Feb 21, 2018 3:13 am

Hi Blackbird

can you correct me what mistake i am doing in this below dispose url

"VARhttp://server/index.php/api/customer/callinfo/1?lead_id=--A--lead_id--B--&agent=--A--user--B--&uniqueid=--A--uniqueid--B--&phone=--A--phone_number--B--&recordingid=--A--recording_id--B--&filename=--A--recording_filename--B--&StarTtime=--A--StarTtime--B--&start_epoch=--A--epoch--B--&comments=--A--comments--B--&status=--A--status--B--&length=--A--length--B--"

I am not getting recording_id ,recording_filename , Starttime, length when call is disposed and above dispose url is placed in campaign settings

Please can you check
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby blackbird2306 » Wed Feb 21, 2018 5:31 am

It's not possible to use recording_filename and recording_id in "Dispo Call Url", because the recording file is not known until a couple of minutes after the call has finished and cron has started / processed. What do you mean with "--A--StarTtime--B--" and "--A--length--B--" ? If you refer to recording file, then this is for the reasons mentioned not possible.
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: non_agent_api.php not sending password and session id

Postby vijaymuddu » Wed Feb 21, 2018 8:21 am

"--A--StarTtime--B--" and "--A--length--B--", here i mean to say call start time and call length/duration

How can i get recording file details from api

Is there any other way to get recording file url
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby mflorell » Wed Feb 21, 2018 10:22 am

Take a look at the "recording_lookup" function in the non-agent API:
http://vicidial.org/docs/NON-AGENT_API.txt

You would have to do the lookup several minutes after the call ends though to get the final URL of the recording.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: non_agent_api.php not sending password and session id

Postby blackbird2306 » Wed Feb 21, 2018 12:23 pm

Call length in seconds: --A--talk_time--B--
For call start time there is no variable, but it's easy to calculate this in unix time:
start_time = (--A--epoch--B--) - (--A--talk_time--B--) (start time (unix) = subtracting talk_time from epoch (it's trigger now time))

And for "recording_lookup" function in the non-agent API use --A--uniqueid--B-- from Dispo Call Url
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: non_agent_api.php not sending password and session id

Postby vijaymuddu » Thu Feb 22, 2018 1:49 pm

Hi Blackbird,

i tried to set parameters as mentioned by you but i am not getting uniqueid

Below is the output from dispo-url

"144.24.1.131 - - [21/Feb/2018:17:32:20 +0530] "GET /agc/vdc_call_url_test.php?lead_id=29&agent=blessonr&uniqueid=&phone=9869078136&recordingid=63&filename=20180221-173202_9869078136&start_epoch=1519214540&comments=&status=--A--status--B--&length=--A--length--B-- HTTP/1.0" 200 26 "-" "-"
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby blackbird2306 » Thu Feb 22, 2018 6:34 pm

For me it's ok. I tested --A--uniqueid--B-- and it will be populated. What is in your Dispo Call Url exactly now? It's not necessary to use "vdc_call_url_test.php". For debug purposes: Reports --> Admin Utilities (bottom) --> URL Log Report --> now you can see the called url with parameters and also the response
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: non_agent_api.php not sending password and session id

Postby vijaymuddu » Thu Feb 22, 2018 9:58 pm

Dispo url is as mentioned below

"VARhttp://crm-server-ip/index.php/api/customer/callinfo/1?lead_id=--A--lead_id--B--&agent=--A--user--B--&uniqueid=--A--uniqueid--B--&phone=--A--phone_number--B--&recordingid=--A--recording_id--B--&filename=--A--recording_filename--B--&StarTtime=--A--StarTtime--B--&start_epoch=--A--epoch--B--&comments=--A--comments--B--&status=--A--status--B--&length=--A--length--B--"
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby vijaymuddu » Thu Feb 22, 2018 10:19 pm

I am using below dispo url

Code: Select all
VARhttp://crm-server=ip/index.php/api/customer/callinfo/1?lead_id=--A--lead_id--B--&agent=--A--user--B--&uniqueid=--A--uniqueid--B&phone=--A--phone_number--B--&recordingid=--A--recording_id--B--&filename=--A--recording_filename--B--&start_epoch=--A--epoch--B--&comments=--A--comments--B--&status=--A--status--B--&length=--A--length--B--



Also i looked in the Admin panel for dispo url it only shows unique id for the first call but later called on same number doesn't show unique id below is the dispo url status

Code: Select all
http://144.24.1.131/agc/vdc_call_url_test.php?lead_id=28&agent=akshays&uniqueid=1519300849.207&phone=9920646569&recordingid=66&filename=20180222-173049_99206465
 
 http://144.24.1.131/agc/vdc_call_url_test.php?lead_id=28&agent=akshays&uniqueid=&phone=9920646569&recordingid=67&filename=20180222-173452_9920646569
 http://144.24.1.131/agc/vdc_call_url_test.php?lead_id=28&agent=akshays&uniqueid=&phone=9920646569&recordingid=68&filename=20180222-174238_9920646569
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby blackbird2306 » Fri Feb 23, 2018 10:35 am

Your Dispo URL is still wrong !
1. you have "uniqueid=--A--uniqueid--B" , but it should be "uniqueid=--A--uniqueid--B--"
2. you have still "--A--length--B--" (this one is not available), but the right one is "--A--talk_time--B--"
Try this:
Code: Select all
VARhttp://crm-server=ip/index.php/api/customer/callinfo/1?lead_id=--A--lead_id--B--&agent=--A--user--B--&uniqueid=--A--uniqueid--B--&phone=--A--phone_number--B--&recordingid=--A--recording_id--B--&filename=--A--recording_filename--B--&start_epoch=--A--epoch--B--&comments=--A--comments--B--&status=--A--status--B--&length=--A--talk_time--B--

By the way don't post things related to this problem in another post (double post)! http://www.vicidial.org/VICIDIALforum/viewtopic.php?f=4&t=38068
Last edited by blackbird2306 on Fri Feb 23, 2018 10:57 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: non_agent_api.php not sending password and session id

Postby blackbird2306 » Fri Feb 23, 2018 10:55 am

I found another wrong variable in your Dispo URL: "--A--status--B--" is also not defined. Do you mean the DISPO Status e.g. "B" (busy)? Then use "--A--dispo--B--" (dispo status e.g. A,B) or "--A--dispo_name--B--" (full dispo description e.g. Answering Machine).
Updated final Dispo URL:
Code: Select all
VARhttp://crm-server=ip/index.php/api/customer/callinfo/1?lead_id=--A--lead_id--B--&agent=--A--user--B--&uniqueid=--A--uniqueid--B--&phone=--A--phone_number--B--&recordingid=--A--recording_id--B--&filename=--A--recording_filename--B--&start_epoch=--A--epoch--B--&comments=--A--comments--B--&status=--A--dispo--B--&length=--A--talk_time--B--
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: non_agent_api.php not sending password and session id

Postby vijaymuddu » Fri Feb 23, 2018 2:38 pm

Hi Blackbird,
I tried to use the dispo url as shared by you, but still no-luck still not getting unique id, below is the out put in admin utils URL log report

Code: Select all
 
                    |                     |              |          | 4258_8850348681&start_epoch=1519413411&comments=&status=CBCP&length=232          |                                                                                  |
|                    | 2018-02-24 00:47:48 | dispo        | 0        | http://crm-server/loan-crm/index.php/api/customer/callinfo/1?lead_id= | Sat, 24 Feb 2018 00:47:48 +0530|PHP ERROR: Type=8 - Message=Undefined variable:  |
|                      |                     |              |          | 27&agent=akshays&uniqueid=&phone=8850348681&recordingid=101&filename=20180224-00 | DB - Line=193 - File=/var/www/html/agc/functions.php                             |
|                      |                     |              |          | 4723_8850348681&start_epoch=1519413468&comments=&status=CBCA&length=23           |                                                                                  |
|                      | 2018-02-24 00:48:26 | dispo        | 0        | http://crm-server/index.php/api/customer/callinfo/1?lead_id= | Sat, 24 Feb 2018 00:48:26 +0530|PHP ERROR: Type=8 - Message=Undefined variable:  |
|                      |                     |              |          | 27&agent=akshays&uniqueid=&phone=8850348681&recordingid=102&filename=20180224-00 | DB - Line=193 - File=/var/www/html/agc/functions.php                             |
|                      |                     |              |          | 4800_8850348681&start_epoch=1519413506&comments=&status=CBCA&length=24           |                                                                                  |
|                      | 2018-02-24 00:49:04 | dispo        | 0        | http://crm-server/index.php/api/customer/callinfo/1?lead_id= | Sat, 24 Feb 2018 00:49:04 +0530|PHP ERROR: Type=8 - Message=Undefined variable:  |
|                      |                     |              |          | 27&agent=akshays&uniqueid=&phone=8850348681&recordingid=103&filename=20180224-00 | DB - Line=193 - File=/var/www/html/agc/functions.php                             |
|                      |                     |              |          | 4840_8850348681&start_epoch=1519413544&comments=&status=CBCP&length=22           |                                                                                  |
+----------------------+---------------------+--------------+----------+----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+                                                                                                                                                           
                           

Getting below error on dispo's
"PHP ERROR: Type=8 - Message=Undefined variable: DB - Line=193 - File=/var/www/html/agc/functions.php"

can it be database issue
I also tried Checked out latest revision 2928. but not working, cant get unique id in dispo call url
But i can see unique id in call_log table for all calls, some function is not able to fetch unique id

Can i rollback to 2.12 which is stable as i can see in your signature,if yes then how can i roll back from 2,14 to 2.12 which trunk to pull
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby blackbird2306 » Fri Feb 23, 2018 7:22 pm

This PHP error is normally not very important. It's only NOTICE that debug variable is not defined. But your linux version is Centos, which means your installation method could be from scratch (manual)? Maybe you missed something during this process. We should know, whether the uniqueid is "only" missing in your Dispo Call Url process or uniqueid is also mssind in system.
1. Make some calls with missing uniqueid in dispo call url
2. Report --> Admin Utilities --> Carrier Log Report --> is there uniqueid for all calls / post output
3. Again: please post us exactly what is in your final dispo call url (copy / paste)
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: non_agent_api.php not sending password and session id

Postby vijaymuddu » Fri Feb 23, 2018 11:59 pm

i made 3 outbound calls with no unique id in dispo url , below is the output of Admin utils > carrier report, unique id is shown in report

Code: Select all
UNIQUE ID            | CALL DATE           | SERVER IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | ANSWERED TIME | SIP CODE | SIP HANGUP REASON              | PHONE NUMBER |


Code: Select all
1519446451.162       | 2018-02-24 09:58:05 | 144.24.1.131    | 27        | 16           | ANSWER      | Local/8600051@default-00000037;1         | 34        | 23            |        0 |                                |              |
| 1519446503.167       | 2018-02-24 09:58:45 | 144.24.1.131    | 27        | 16           | ANSWER      | Local/8600051@default-00000039;1         | 22        | 17            |        0 |                                |              |
| 1519446539.172       | 2018-02-24 09:59:18 | 144.24.1.131    | 27        | 16           | ANSWER      | Local/8600051@default-0000003b;1         | 19        | 11            |        0 |                                |              |
+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+----------+--------------------------------+--------------+
                                                                                                                                                                             

Dispo url used for above calls was as below
Code: Select all
"VARhttp://crm-server/index.php/api/customer/callinfo/1?lead_id=--A--lead_id--B--&agent=--A--user--B--&phone=--A--phone_number--B--&recordingid=--A--recording_id--B--&filename=--A--recording_filename--B--&start_epoch=--A--epoch--B--&comments=--A--comments--B--&status=--A--dispo--B--&length=--A--talk_time--B--"


Url report out is as below
Code: Select all
http://crm-server=ip/index.php/api/customer/callinfo/1?lead_id=27&agent=akshays&phone=8850348681&recordingid=106&filename=20180224-095858_8850348681&start_epoch=1519446560&comments=&status=LMCN&length=20

PHP ERROR: Type=8 - Message=Undefined variable:DB - Line=193 - File=/var/www/html/agc/functions.php


Also tried with adding unique id in dispo url but not luck

Code: Select all
VARhttp://crm-server=ip/index.php/api/customer/callinfo/1?lead_id=--A--lead_id--B--&agent=--A--user--B--&uniqueid=--A--uniqueid--B--&phone=--A--phone_number--B--&recordingid=--A--recording_id--B--&filename=--A--recording_filename--B--&start_epoch=--A--epoch--B--&comments=--A--comments--B--&status=--A--dispo--B--&length=--A--talk_time--B--


Output in carrier report with uniqueid in dispo url
Code: Select all
UNIQUE ID            | CALL DATE           | SERVER IP       | LEAD ID   | HANGUP CAUSE | DIAL STATUS | CHANNEL                                  | DIAL TIME | ANSWERED TIME | SIP CODE | SIP HANGUP REASON              | PHONE NUMBER |
+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+----------+-----------------------

Code: Select all
 1519447771.181       | 2018-02-24 10:20:05 | 144.24.1.131    | 27        | 16           | ANSWER      | Local/8600051@default-0000003e;1         | 34        | 23            |        0 |                       


What can be the issue should i create db schema freshly and check or anything else
Please check

Thanks for giving your valuable time for helping to fix the issue
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby vijaymuddu » Sun Feb 25, 2018 2:24 pm

Hi Blackbird and others,

My issue of unique has been resolved, after doing lot of experiments, i finally remove some lines from my mysql config my.cnf and uniqueid was getting captured in dispo url

Below is what i removed from my.cnf
ft_min_word_len = 3
interactive-timeout
no-auto-rehash
skip-external-locking

Thanks Blackbird for your valuable time given

Keep up the good work
server config: i3,4gb, Centos 6.9 64bit | Version: 2.14b0.5 | Schema: 1528 | revision 2928| Asterisk 1.8.0 | E1-card
Thanks
Vijay Muddu
vijaymuddu
 
Posts: 106
Joined: Mon Jul 14, 2014 9:38 am
Location: India

Re: non_agent_api.php not sending password and session id

Postby blackbird2306 » Mon Feb 26, 2018 5:02 am

Thanks for the post-back!
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


Return to Support

Who is online

Users browsing this forum: No registered users and 126 guests