PHP in Agent Script?

Support forum for the ViciBox ISO Server Install and ISO LiveCD Demo

Moderators: enjay, williamconley, Staydog, mflorell, MJCoate, mcargile, Kumba

PHP in Agent Script?

Postby Nefariousparity » Tue Apr 08, 2014 1:14 pm

Is it possible to put php variables in Agent Script?

For instance, I would like to do the following.

Every time we reach Postal_Code 999 the background of script will change to red. Here is a sample of my code.
<?php
$Postal_Code = "999";
$bg="";
if($Postal_Code=="999")
{
$bg = "style=' background:#ff0000;'";
}

?>
<body<?php echo $bg;?>>
|| DB Schema Version: 1609 || Asterisk 11.25.1-vici || BUILD: 190902-0839 ||VERSION: 2.14-718a||SVN: 3133||10xTelephony||1x Database||1x Slave||1x Web||1x Archive||ViciBox v.8.0.1
Nefariousparity
 
Posts: 327
Joined: Wed Sep 12, 2012 7:01 pm

Re: PHP in Agent Script?

Postby williamconley » Wed Apr 16, 2014 9:33 pm

1) Good job posting your specs

2) If you want to know if php can be used in a script, I'd say you should test it. With something simple. LOL (I don't remember, honestly). Do remember to test your PHP script directly in a web page to be sure it works before assuming it doesn't work in a script. Proper troubleshooting techniques and all. 8-)

3) If it is NOT, then you CAN switch to an iFrame script instead (which would be completely external to Vicidial and php is definitely doable there, by definition).

4) Ever heard of Javascript? Didja know it can do things like modify colors and ... well, anything else? :) (In case you don't want an iFrame, and can't get php to work).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # 888-883-8488 # +44(203) 769-2294
williamconley
 
Posts: 20438
Joined: Wed Oct 31, 2007 4:17 pm
Location: Bartow, FL (In the boondocks)


Return to ViciBox Server Install and Demo

Who is online

Users browsing this forum: No registered users and 83 guests