How to hold or save the DTMF input in VXML? Any guides to set up a test IVR (VXML) service? - perl

So I currently have an IVR written in some dodgy old code which is confusing and goes way over the top for some things.
I'm wanting to re-write one of my basic IVRs with VXML.
So a little bit of research is that I can call perl scripts which I can use to run data past databases, that part isnt to bad.
My question is how, or what is the syntax to use to "hold" or save the dtmf input for a menu, and then pass it to the perl script.
Question two.
Hosting of the VXML IVR. Are there any guides to setting up a test service? I have a PABX, and a few servers I can play around with.

To play around with VoiceXML I would recommend Voxeo's excellent platform called Prophecy. You can get two ports for free that you can run on a server or even on your workstation/laptop. They provide a SIP softphone to test your apps so it does not require any elaborate setup; just a simple install and you are ready to go. They also have hosted environment that you can test from for free. You just pay for the service if you put it into production. Here is a post that describes how to setup and test applications in the hosted environment. And here is a post on how to setup and test applications if you install Prophecy on your PC. Voxeo's CTO is on the VoiceXML standards committee so their platform conforms very close to the standard.
Voxeo's developer site has excellent documentation on VoiceXML that is full of examples. On your question for how to get dtmf input you can go to the bottom of the left pane in the documentation and click on the element "field". The field element is used to collect information from the caller. To easily do this with DTMF input you can use the builtin grammars. For more information on builtin grammars look at the documentation on the "type" attribute of the "field" element. Once you get a "filled" event from the "field" you can call your Perl script using a "submit" element. Voxeo's documentation has a link to this article on creating a VoiceXML applications with Perl. The Voxeo Forum is also an excellent source of information on VoiceXML and the Prophecy. If you cannot find an answer to your question in the Forum just ask it and their knowledgeable support staff will assist.
If you are also familiar with .NET technologies there is an open source project called VoiceModel that makes it easy to develop VoiceXML applications using ASP.NET. The project has a lot of examples in it.
These resources should get you started with VoiceXML fairly quickly.

To specifically answer your DTMF question, just use <submit> to send the DTMF input to the perl script, using the attribute namelist (which is just a list of variables that you need to send).
Also, from the VXML 2.0 specification:
"The <submit> element is used to submit information to the origin Web server and then transition to the document sent back in the response. Unlike <goto>, it lets you submit a list of variables to the document server via an HTTP GET or POST request. For example, to submit a set of form items to the server you might have:
<submit next="log_request" method="post"
namelist="name rank serial_number"
fetchtimeout="100s" fetchaudio="audio/brahms2.wav"/>
"

Related

Create custom Google Smart Home Action

I have a Google Nest Hub Max and I want to increase its capabilities for a custom need:
"Hey Google, add xyz to my work planning"
Then I want to make an HTTP call to my private server
The private server returns a text
The text is displayed in the Google Nest Hub Max screen + speak-out.
How can that be achieved?
Originally I thought that this will not be difficult. I've imagined a NodeJs, Java, Python or whatever framework where Google gives me the xyz text and I can do my thing and return a simple text. And obviously, Google will handle the intent matching and only call my custom code when users say the precise phrase.
I've tried to search for how to do it online, but there is a lot of documentation everywhere. This post resumes quite well the situation, but I've never found a tutorial or hello world example of such a thing.
Does anyone know how to do it?
For steps 2. and 3., I don't necessarily need to use a private server, if I can achieve what the private server does inside the Smart Home Action code, mostly some basic Python code.
First - you're on the right track! There are a few assumptions and terminology issues in your question that we need to clear up first, but your idea is fundamentally sound:
Google uses the term "Smart Home Actions" to describe controlling IoT/smart home devices such as lights, appliances, outlets, etc. Making something that you control through the Assistant, including Smart Speakers and Smart Hubs, means building a Conversational Action.
Most Conversational Actions need to be invoked by name. So you would start your action with something like "Talk to Work Planning" or "Ask Work Planning to add XYZ'. There are a limited, but growing, number of built in intents (BIIs) to cover other verticals - but don't count on them right now.
All Actions are public. They all share an invocation name namespace and anyone can access them. You can add Account Linking or other ways to ensure a limited audience, and there are ways to have more private alpha and beta testing, but there are issues with both. (Consider this an opportunity!)
You're correct that Google will help you with parsing the Intent and getting the parameter values (the XYZ in your example) and then handing this over to your server. However, the server must be at a publicly accessible address with an HTTPS endpoint. (Google refers to this as a webhook.)
There are a number of resources available, via Google, StackOverflow, and elsewhere:
On StackOverflow, look for the actions-on-google tag. Frequently, conversational actions are either built with dialogflow-es or, more recently, actions-builder which each have their own tags. (And don't forget that when you post your own questions to make sure you provide code, errors, screen shots, and as much other information as you can to help us help you overcome the issues.)
Google's documentation about how to design and build conversational actions.
Google also has codelabs and sample code illustrating how to build conversational actions. The codelabs include the "hello world" examples you are probably looking for.
Most sample code uses JavaScript with node.js, since Google provides a library for it. If you want to use python, you'll need the JSON format that the Assistant will send to your webhook and that it expects back in response.
There are articles and videos written about it. For example, this series of blog posts discussing designing and developing actions outlines the steps and shows the code. And this YouTube playlist takes you through the process step-by-step (and there are other videos covering other details if you want more).

Controlling a random webpage through a Perl script

There is a random website say abc.com and this website has a search engine. Is it possible to create a perl script to automatically read from a text file and feed search values into this search engine and automatically download the files that are the result of the search ? Once the download is complete, the loop has to continue until all the search values have been exhausted. I don't have any server details about the website itself.
Any help is much appreciated. Thanks !
This is HTTP client programming. You're basically writing a program that is pretending to be a browser.
The standard module for doing this is probably WWW::Mechanize (see the cookbook and the examples).
If you want something lower level, then the LWP bundle of modules will do all that you want.
There's a free online book. But it's a little old and probably doesn't reflect current best practices.

SNDSMTPEMM NOTE Limited to 400 Characters

I am trying to get our iSeries 6.1 machine to send email through our Exchange server. I can do it with SNDDST and with SNDSMTPEMM, but both are very limiting. I need support for basic HTML, and for PDF attachments. I thought I could get them both from SNDSMTPEMM, but now I see that the body parameter for SNDSMTPEMM (NOTE) is limited to 400 characters. Is it possible that this command allows 10 attachments but less than a paragraph of text?
I would like to know if anyone is using this command, and if I am missing something about it that would allow me to create an actual email message.
If indeed I can't put more than 400 characters into the body of an email with this command, I have read about MMAIL and MAILTOOL and I am curious if anyone knows if this message length restriction exists for those as well?
It will be a very hard sell for our main programmer to install any third-party anything to get this working, so I would love to be able to do it with SNDDST of SNDSMTPEMM (or some other built in I haven't found yet).
I don't currently need to be able to send to multiple recipients, but I do need to be able to attach a couple of attachments (where SNDDST fails for me). I also can't use attachments with an *LMSG.
I'm sorry if this is the wrong place for this kind of post - I find it very difficult to find the right place.
The SNDSMTPEMM command is indeed limited to 400 characters in the message body, according to the documentation.
Where I work, we still mainly use MMAIL, which used to be free but now requires a $50 "donation" (and lots of hoops to jump through just to register). It doesn't have that message length limitation. It comes with several commands for ease of use, and a service program for more fine-grained control over how the message is built. Once you download it, you have access to the source, so you can really muck around with it if you have to. (The donation also allows you to download a multitude of other utilities from Easy400.net.)
A better but more expensive option is Bradley Stone's MAILTOOL. It's still competitively priced, as far as commercial IBM midrange software goes. If you go that route, it's probably worth getting the Plus! add-on, which side-steps IBM's native SMTP, a recurring source of headaches. (MMAIL and the basic MAILTOOL rely on native SMTP.)
The best place for this kind of post, at least for now, is the Midrange-L mailing list at midrange.com. When it comes to AS/400, iSeries, and IBM i stuff, that community is currently much more active than Stack Overflow, and they welcome open-ended discussion and "what do you recommend?" posts, which are discouraged here. You can find some discussion on the command you mentioned, and some alternatives, in this thread.

Programmatically Fax from Internet form

I'm new to programming, and my only area of expertise is web design/simple development on platforms like wordpress/expression engine. (Yea, you guys can laugh).
I have a new client who currently receives medical faxes through an online form (the user fills out a form concerning their prescriptions and once submitted, it faxes the info).
I'm completely redesigning their site, and I'm not sure how online faxing works.
Has anybody dealt with internet faxing? How does it work? Does/can it go through email?
And is it possible to send a fax through a form with javascript/php or route it through email?
Don't pay for it! All you need is a modem on the server and a standard phone line. Then set up a fax print driver under your os (you can do it on windows and unix).
The unix way is mgetty/sendfax : http://mgetty.greenie.net/doc/mgetty_3.html#SEC3
The Windows way : http://support.microsoft.com/kb/306657
There are other ways but unless you can't get a phone line you'd be mad to pay fees for it.
Would it not be helpful to look at how it is currently being done, that way you can learn a thing or two about the process before trying to go do it again? That way you can find if it is using any special libraries or techniques or services to send the fax and you can then either duplicate the code or use it as a template to get started on your own solution.
All of what your asking is possible. I would recommend finding a service provider who can send the fax for you. They all have different interfaces requirements and pricing. I used to use DataOnCall which is now called Fax.com
They had a web service which we would post the document to be faxed plus additional information. They were a preety reasonable service. This was several years ago so I can't speak how they currently fair.
Take a look at eFax's SDK. I haven't used it, but it looks like it might be useful to you.
Yes, you can send faxes via email through several services; this link seems to have some useful information. I worked at a company previously that did this same sort of thing, and while I don't recall the exact service we used, most of them are very similar, and they work reasonably well.

Best method to write an email poller

I am working on an email polling solution, for a multi-user system. So users can send emails on their respective ids and it would be polled and inserted to a db.
There are two options that I am considering:
Perl/Unix based email pollers..
A java based poller.
What would you recommend.. (other suggestions are also welcome)
Instead of polling, why don't you forward the mail to a process? Depending on the mail server you use, you can do that as an alias or even in the .forward file.
I've nothing much to add to this, but there's currently a project at google code to rebuild iwantsandy.com as open source.
It's at:
http://code.google.com/p/sandysback/
I'm definitely going to be watching this to see how they parse emails, and have those emails "inserted into a db"
Whichever language you have most experience in!
I personally know java and perl well and for this task I would choose perl but the differneces are marginal.
Perl would be shorter and sweeter, java would be take longer but probably be a more robust solution once the database access is sorted out.
I find Perl DBI is a better and more portable database interface than JDBC which does not hide database implementations from your code and is sensitive to version changes etc. I.E. you must have the right version of the right database driver for your target database.
RE: Poling
If you have the option to forward the email to a process I would highly recommended you do that. (Forwarding generally puts less load on the server than poling does.) If not, then poling is the next best thing. Look into the POP3 client libraries on whichever language you are most comfortable with.
RE: Language choice
If I intended to do a lot of parsing of the emails then Perl would be my choice. If not much parsing is involved then Java would be the way to go for me ;-).
-- In a former life I wrote a Perl script to parse (well structured) incoming emails into HTML pages and post them to a web server.
You have a couple of options. As the orginal poster said - probably the simplest way is to set up an entry in the aliases file to a script.
Then the body of the email gets passed as standard input to the script. You can then use a perl script + Mime modules to parse out the bits of the message and do whatever you want with it.
One might also look at apache james - which is a custom mail server. They have the equivilent of servlets, called 'maillets' that you put your business logic in. They often hard to deploy in enterprise scenario's though as most companies don't like having custom mailservers being deployed.
... the aliases route is probably your best bet. one other note of caution - email isn't gauranteed. if you are using this as some sort of app to app messaging system, and you control both ends, you should probably look at something else, like JMS type messaging.
-Ace