It's PIAF Speak2Tweet

peivoip

Member
Joined
Jun 13, 2008
Messages
117
Reaction score
0
Anyway to setup our own @speak2tweet ?

Google and twitter using it for getting voice updates from Egypt.

It would be awesome to do the same on our Piaf. Anyone already have something like it ?
 
I haven't found good automatic speech recognition software for Linux yet.

So the easiest thing would be to setup a google voice number that will do the transcription and forward to email.

Pop that email account with fetchmail and post to twitter using TTYtter. (a command-line Twitter client)
 
There must be a way to setup an extension that when you leave a voicemail it get saved to a folder (ex. /var/www/html/vmtweets/ ) and have something like a cron job running to tweet a message that new recording is available?

I think I just answered myself. but I'm a noob and have very limited knowledge of linux, especially cron jobs.

Is there a way to have one extension saving VMs to a different location and have all my other extensions stay the way they are ?

I think this post needs to be moved to the Help section!?!
 
Tropo

I have been exploring the capabilities of Tropo (www.tropo.com) and the speak2tweet idea seems like something that one could achieve with a small amount of scripting.

General idea is like this, and if no one else jumps on it, I may code it up in some spare time, just for fun. I personally don't even "type2tweet" so I'm not sure if I'd ever speak2tweet...

1. Accept the call, announce that the caller should say something in maybe 5 seconds or less, and then record (https://www.tropo.com/docs/scripting/record.htm)

2. Use the transcript URL parameter in record() to send the transcript back to the Tropo script as an HTTP POST.

3. Use the say() function to output the transcription to a twitter account affiliated with the script. (https://www.tropo.com/docs/scripting/say.htm)

I'm not a fanboy or employee of Tropo, but have used it for some cool stuff and recommend it if you want to try out your idea. (It's free for dev.)
 
Looks interesting, but I have no programming skills.

I'll still have a good look at it.

Thanks
 
My curiosity was piqued after our short discussion and I wanted to see how hard it would be to write something up.

I've got a pretty decent bit of code using Tropo that is only missing one piece: sending the tweets. Once the support ticket is resolved I should have something fun to demonstrate!
 
Hey,

Can't wait to see.

With all the publicity the speak2tweet got because of Egypt, one would think more people would have come up with a diy setup.
 
SpeakTweet demo

Here's one you can try out!

PSTN: (412) 228-4199
Skype: +990009369991483034
SIP: sip:[email protected]
INum: +883510001828257

(Take your pick.)

You get 30 seconds max to say whatever you want that will be transcribed to a Tweet (or a short series of tweets) here:

http://twitter.com/piafspeaktweet

Tweet has last 4 digits/characters of your caller ID as an identifier. Transcription can be hit-or-miss. I think it's probably about as good as Google's, but that's just my opinion.

Powered by Tropo/Voxeo (http://tropo.com) voice recognition and transcription and some PHP code with a slick, simple Twitter library (https://github.com/abraham/twitteroauth). About 75 lines of PHP script altogether not including the library modules. No Asterisk needed, which makes it not so relevant on this forum, but you could route it through your Asterisk box if you want to use your own DIDs rather than those available from Tropo.
 
code

I'm uploading the two PHP scripts that make it work.

One defines an application on Tropo. In that script, you have to define the location of the other script on an external web server.

The other script does a little more work. It has to run on a PHP web server where you've also installed the twitteroauth PHP library (referenced in my last post). Basically you just extract the contents of the twitteroauth tar file to your web folder. Put the tweetsender script there too, and fill in the variables at the top.

Those variables come from Twitter. You sign up for a Twitter account, then go to dev.twitter.com and register a new application. Doesn't really matter what you call it, as long as you chose read/write as the type. The comments in the PHP file tell you where to find the necessary keys once you've registered your Twitter app.

I originally thought it all might be doable within Tropo but they do not enable the use of Twitter in this fashion.
 

Attachments

Absolutely amazing.

Do need to register to tropo or can this be done on Piaf ?

Thanks for the scripts.
 
Tropo is the engine that does the recording and transcription. So yes you will need to start there.

I'm thinking about adding a link to the recording like @speak2tweet does. Then if the transcription is really puzzling you can listen to the recording and decipher the message yourself.
 
Here is a stupid question.

in the tweetsender.php where i type in the keys, do I keep the quotation ?

The app in Tropo is setup with the script and the tweetsender.php is hosted on my hosting server.When I place a call Tropo does answer and records my message, but it seems that it is not being sent to tweetsender.php.
 
Yeah, keep the quotes. The variable is a character string.

Check the transcriptionOutURI line in the Tropo script to make sure it's pointing to the right place on your PHP hosting server. Test the URL by going there with your own browser and seeing that you get a response (should say "POST only, please").
 
Yep tested and I get "POST only, please."
I have also ran the Application Debugger in Tropo it does send the info to the tweetsender.php.

So now I'am trying to figure out whats wrong between the tweetsender.php and twitter.
 
No, the php file should just be chmod 644.

If something isn't working right you'll have to look at your web server error logs and find out what's going wrong and/or add some debugging output to the log file you're writing to (see the routine at the end of the for loop, fopen/fwrite/fclose).
 
Just some comments on Tropo:
- It's very friendly for developers, and you can build some very nice speech enabled apps with it.
- I built a voice-enabled IVR for my PIAF... pretty cool.

Tropo is free for developing... it does not seem to have a time limit on that... but if you use it in production, it's 3c/minute -- pretty expensive. The bummer is transfers keep tropo in the loop, and the 3c meter is running. I, and others, have asked if they will release a Transfer API which drops the Tropo leg -- so far, no replies.

Still, Voxeo speech recog. is very good and Tropo is a rocking site.
 
The bummer is transfers keep tropo in the loop, and the 3¢ meter is running. I, and others, have asked if they will release a Transfer API which drops the Tropo leg -- so far, no replies.


That's a major gotcha. Just to be sure I understand... if you use a Tropo IVR to greet your business customers and the IVR transfers them to a specific department that has calls which average 15 minutes, then the cost per call per customer is 45¢ instead of a more realistic 3¢ for the Tropo front-end service. :crazy:
 
There are workarounds to the no-transfer situation. The gist is that if you start the call from your own PBX, you can still maintain some control over it through a CGI callback and transfer via the Asterisk Manager Interface. Works, but not ideal. SIP REFER (blind transfer) is the right way to do it.
 
Now includes links to recordings

Whose voice results in the most accurate transcription? Not mine, to be sure, but now if you have a mumbler at least you can listen to their recording as well, and decipher on your own. Try it again, and this time there are bit.ly links at the end of the tweet that point to the recording. Nice if you end up with "rigmarole rolls that calling phone"...
 

Members online

No members online now.

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top