Asp + vXML dynamic data - php

I have been put in charge of building an IVR using vXML and asp.net. For some reason the voice server we are using requires ASP.net and cannot use PHP in conjunction with vXML so I am stuck learning ASP.net. The application is pretty simple in that it runs an ASP.net file with vXML and should pull data from a database based on user input.
Example:
User enters customer ID "23313"
It should then pull data from our SQL2012 DB that corresponds to that ID and read it back via prompts. Simple enough I figured.
A have a couple questions regarding possible solutions to this -
Is it possible for ASP/vXML to pull data from PHP dynamically (post or get statements), and use the data in the current vXML document? or will I have to bite the bullet and figure out a second page?
if using PHP is not ideal or possible, would it be better or possible to add a db connection into the asp/vXML document and run the IVR that way?
I am not very familiar with ASP.net, and am trying to find out the most efficient way to accomplish my goal without having to have an additional vXML page to run.
Any help appreciated.
EDIT
After further investigation and help from Jim I was able to get inline PHP working. The server I was using was set to go specifically to this asp.net and did not have PHP installed on the server itself. After installing PHP, changing where the server was looking for the file, I am able to run the latest PHP version in my app.
Deleted code sample as it was completely irrelevant

The ASP requirement seems odd, unless you are leveraging some type of library within the ASP.net environment. VoiceXML browsers, are just that, a browser. It should be able to process VXML from the standard sources. I suspect you are working within a framework that requires the serverside ASP.
If your browser is VoiceXML 2.1 compliant, you should have access to the Data element. This element allows you to make Get and Post requests to a server, get back XML and parse the data within Javascript. Note, the return data must be valid XML.
Any database connection would have to be on the ASP.net side of the solution. VoiceXML gets data by transitioning to a new page (goto or subdialog element) or the Data element above.

Related

Create plot from database server side and visualize it on client side

I'm currently trying to find the best way of doing this:
We have a python program (client side) we use to upload metrics on a mySQL database on a server and later, via web check it and filter it, etc.
The problem arises when we try to plot any query from to the database. It's unclear to us what aproach to use. The main page was made with Joomla in php.
Currently I was looking into python alternatives to run on the server side, somehow capture the query, process the data, create the image and then return it to the client side as an image or as a string to be reconstructed on the client side. But as I have read it seems also possible (and maybe easier) to do the same in PHP or JavaScript which (as I understand it) run on the client side, leaving less to worry about.
Is it that so? Are my assumptions right? Which aproach would you use/pŕefear? Is there some link or info you could give me to continue my search?
I would prefer to do it on Python using something like matplotlib, plotly, bokeh, etc. but as I see it, the problem is not about creating the image, but about comunicating and sending the image information between server and client.
Thanks!
I think it possible to do what you want to with bokeh. I dont know joomla but it think its not that important.
Check out that part of the bokeh documentation Embedding Bockeh
then for the server parts in python i would recommend flask to start with.
You can just prototype your app with one of the bokeh server apps examples from the bokeh repo.. there are flask examples too.
Then you can start to extend the bokeh server app from the examples with a query to your database with sqlalchemy or
mysql-flask

Accesing php web service and MySQL from Qt/C++ in android. How to send data to service?

I am pretty new with this. I am trying to develop some android application in Qt/Qml to query and update data to a database.
The problem I'm trying to solve:
There is a server with a MySQL database. The android application request some data. I use a very very basic php file that query in the database, format an XML and show that file starting with a header('Content-type: text/xml'); sentence, then some echo "<...>" sentences. This php file receives parameters via $_GET array and performs the query.
This is a little archaic but works fine. My client application use Qt/QML for android. It uses XmlListModel to obtain the data from the server and show that data in a ListView.
So far so good, but here is my real problem:
The user of the android application can change some data, and the modified data must be sent back to the server, who performs an update in the database.
My first attempt was to create another php file and send the data in the URI, get it via $_GET and perform the update to the database. This works but there could be many variables and the URI will become very large. I think might be better to send an XML (or JSON) from the client to the server, and put in that file the data for the update.
So, this is the question: How can I send an XML file from Qt/QML to the server? How does the php file obtain that data? Or maybe there is another, better way for doing this.
Every example I find just shows the server-to-client part, or is written in Java, and I don't know java enough.
Additional notes:
After I can solve this I will fight with security: SSL, avoiding SQL injection or anything, but that will be in another question if necessary.
I didn't use SOAP or similar because the first ideas was simple. Also, I have never used SOAP before. If this is the right way, I would be very grateful if you show me how to use it from Qt/QML in android.
Of course, I can use C++ for the client application since it is using Qt.
I use Qt since I already know it and the app might be useful in desktop as well.
Sorry if I made any english mistake.
Thank you in advance.

SharePoint 2007 form, with data inserted into SQL

I'm setting up a form on an internal Sharepoint 2007 site, and the requestor would like the form data to emailed to them, and stored on a SQL Server table.
I have a good general knowledge of web development, but I am relatively new to developing for SharePoint, and it's not within budget for me to learn Visual Studio and C# and make a webpart.
So, I am attemping to do this with a basic HTML form within a Page Viewer webpart, posting to a PHP script & handling the email and SQL insert in PHP. The problem is that upon hitting submit, rather than executing the PHP script, it hides the form and displays the PHP code in plain text in the webpart.
Now, I know I'm not using PHP correctly for SharePoint, but I cannot find any information on how to run PHP within SharePoint, other than people using PHP on a seperate server to pull list data.
Anyone have any ideas on a fix, or an alternative method of achieving this kind of form?
I am open to trying new things, but I will NOT build a webpart, especially as this should be portable, as we're upgrading SP soon and moving to a new server.
Thank you!
you may be able to use InfoPath to accomplish this.
Please see the following link for an InfoPath introduction - http://office.microsoft.com/en-us/infopath-help/introduction-to-microsoft-office-infopath-2007-HA010163577.aspx

Avaya CMS - how to get data with php?

Is it possible to get data from Avaya CMS (16.3) (for call centers) with PHP?
I want to create a real-time statistics with PHP but i don't know how to get data from database :/
If anyone is searching for an answer - yes, it is possible but partially.
You need to create a script from the CMS SuperVisor to export data to the TXT file. Next using PHP you need to load this file to the database.
I am using this solution without problems for last 3 years.
ODBC is of no use for real time data since there is no ODBC interface to Real Time Database (RTDB) in CMS. The only practical solution to get that data is to run terminal reports with CLINT, parse them and store that data in your database. See Tek-Tips thread that has some information on how to do this.
Another option is to use CMS Webdash, which a web interface for CMS but can be used as data source too.
Sound like an older Avaya-switch? In that case, the console based client (hopefully included) on the CMS-server - clint - could be used for screen scraping. It's quite a project writing custom reports from scratch and then make another application log on, start clint and begin scraping that report, but it works and may be an alternative if there is no database-access.
I don't know much about newer Avaya-switches, but they may have more features than this..
You can use clintSVR which is a high level tool based on CMS CLINT. By using clintSVR, you can use CGI, OCX and C++ interfaces to get the real time data from CMS. For PHP, you can use CGI interface to get the real time data.

Connecting Php with javascript

I am trying to make a plugin that people can place on their site to generate a form. I dont want to use an iframe to display the form but use javascript to generate it.
The problem is how do i connect the javascript and php together. My site is programmed in PHP.
Your getting a liite mixed up, I think.
PHP runs on your server. This is the place where you fetch data from the database and create some form of html-response.
Javascript runs in the browser. It can't directly talk to your database.
iframe is a special html-element: Therfore it is passive and can't do anything like creating a form.
You have two ways:
Create a PHP script which handles everything through plain HTTP-Requests. This is the "old school" way and requires a lot of page-reloading.
Write most of the logic in javascript and let it communicate to PHP/your database through AJAX. In this case. Have a look at jQuery which makes AJAX-requests (and a lot of other things) very easy.
One issue you will be faced with is 'Cross site Scripting' with Javascript / AJAX.
You can read up on it a bit here:
http://snook.ca/archives/javascript/cross_domain_aj
Also, thinking your process through, you will need sufficient javascript code to create a 'widget' on any place, and have a way to communicate BACK to your server (keep in mind PHP only runs local on your machine, so it cannot be used remotely in your javascript).
You will probably need to build a JSON API (google / stack search this if needed).
And enable communication from your JAVASCRIPT to the API (don't think of it as to PHP, even tho php will be your API server side language).
Here is an example of a PHP JSON API (on youtube too):
http://www.youtube.com/watch?v=F5pXxS0y4bg
If you put PHP into JavaScript and someone implements this, PHP will compile on their server. So you just can't. You just need to put the form in your plugin.

Categories