Saving from own web script fields to VICI

All installation and configuration problems and questions

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

Saving from own web script fields to VICI

Postby amedina » Wed Apr 25, 2012 5:38 pm

Hi,

I created my own php script, enclosed it in an iframe to display in the script tab in VICI. Values of VICI fields are also populating, but my problem is when they edit the fields from the php script, values were not saved in VICI. How can I save the edited basic fields in VICI? Also, how can I save edited custom fields in VICI?

Please help.

----------------------------------------------------------------------------------
VERSION: 3.1.10 | BUILD: 110430-1642 | Asterisk Version: 1.4.38-vici | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation
amedina
 
Posts: 53
Joined: Wed Jul 13, 2011 1:49 pm

Re: Saving from own web script fields to VICI

Postby mflorell » Thu Apr 26, 2012 7:47 am

You can use the API to update the lead. If it is still an active call you can use the Agent-API, if not you can use the non-Agent-API:

http://www.vicidial.org/docs/AGENT_API.txt
http://www.vicidial.org/docs/NON-AGENT_API.txt
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Saving from own web script fields to VICI

Postby amedina » Wed Jun 06, 2012 6:54 pm

Hi Matt,

How will I add that in my php script? For example, I'm going to use the update_lead function below.
http://server/vicidial/non_agent_api.ph ... color=blue

Will custom fields be updated if I use Agent_API?
http://server/agc/api.php?source=test&u ... &address1=

What is source?.. source - description of what originated the API call (maximum 20 characters) - Can you explain further please?
----------------------------------------------------------------------------------
VERSION: 3.1.10 | BUILD: 110430-1642 | Asterisk Version: 1.4.38-vici | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation
amedina
 
Posts: 53
Joined: Wed Jul 13, 2011 1:49 pm

Re: Saving from own web script fields to VICI

Postby callcrazy » Thu Jun 07, 2012 9:06 am

In our setup we use the popup script so I'm not sure if this will work from an iframe.

When agents make changes on our script we write the changes back to the main vicidial lead details form.

Requirement is the script has to be running on the same domain as your agent page. Then you can reference the vicidial form fields like so:

window.opener.document.getElementsByName("phone_number")[0].value = "9999999999";
Vicibox 6.0.4 from .iso | VERSION: 2.12-538a BUILD: 160122-1401 | Asterisk 1.8.32.3-vici | 1xDB, 2xWeb, 7xPBX | Amfeltec Timers | Sangoma/Lyra AMD | Dell Hardware
callcrazy
 
Posts: 122
Joined: Fri Sep 10, 2010 11:30 am
Location: MI

Re: Saving from own web script fields to VICI

Postby amedina » Mon Jun 25, 2012 12:38 pm

callcrazy wrote:In our setup we use the popup script so I'm not sure if this will work from an iframe.

When agents make changes on our script we write the changes back to the main vicidial lead details form.

Requirement is the script has to be running on the same domain as your agent page. Then you can reference the vicidial form fields like so:

window.opener.document.getElementsByName("phone_number")[0].value = "9999999999";


Thanks! Will try that one if this Agent API fails :)

mflorell wrote:You can use the API to update the lead. If it is still an active call you can use the Agent-API, if not you can use the non-Agent-API:

http://www.vicidial.org/docs/AGENT_API.txt
http://www.vicidial.org/docs/NON-AGENT_API.txt


Hi Matt,

I tried the non_agent_api in the agent screen (customer already hangs up but had not disposition the call yet), and returned a response, see below.
SUCCESS: update_lead LEAD HAS BEEN UPDATED - 6666|1842296|1 NOTICE: update_lead CUSTOM FIELDS VALUES UPDATED - |1842296|700|0|700|1

I also tried api, response below.
SUCCESS: update_fields lead updated - 6666|201|1842286|address1='',address2='',city='',email='',first_name='johnathan',last_name='moores',postal_code='',state=''

But when i checked the records, fields were not updated at all. Please help.

----------------------------------------------------------------------------------
VERSION: 3.1.10 | BUILD: 110430-1642 | Asterisk Version: 1.4.38-vici | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation
amedina
 
Posts: 53
Joined: Wed Jul 13, 2011 1:49 pm

Re: Saving from own web script fields to VICI

Postby mflorell » Tue Jun 26, 2012 8:17 am

I couldn't tell you why it's not working in your specific example without a lot more information.

We have dozens of clients that use the APIs without issues, so there is probably something in your processes that aren't being done correctly or at the right time.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Saving from own web script fields to VICI

Postby amedina » Fri Jul 06, 2012 10:22 am

It's now working.. thanks for all the help guys!


----------------------------------------------------------------------------------
VERSION: 3.1.10 | BUILD: 110430-1642 | Asterisk Version: 1.4.38-vici | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation
amedina
 
Posts: 53
Joined: Wed Jul 13, 2011 1:49 pm


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 135 guests