Use Obi call recording function as portable voice recorder? [solved]
azrobert:
Quote
I'm guessing that the 'normal' use for this app/service that I created would be that several people could dial in and conference?
Correct. Other people would use the same URI to join the conference. There are several options you can use for the conference.
Quote
Now if only the record function could be activated from the handset.
Tropo has a record function. You would call the record app the same way as the conference app and it would immediately start recording. I never used this function, but I assume the recording will be stored in your account under My Files/Recordings. You should be able to download the file to a computer. There are other options to auto download to a server.
See following for a description and options of the available commands:
https://www.tropo.com/docs/scripting/reference
In addition to these commands, you can use the programming language code to manipulate the data. Tropo supports 5 programming languages.
unvalidUser:
For anyone who might be interested, i tried creating a Tropo app that would automatically begin recording when dialed - like azrobert suggested. I got close but couldn't get it to work for me - yet.
How it should work: call the Tropo app; it starts recording immediately; when done (hang up), it automatically FTPs or POST/PUTs the audio file to a destination URL you specify.
According to my Tropo logs, all seems to go as expected EXCEPT the audio file fails to reach its destination. This however, I believe is a problem with my FTP server configuration, not Tropo's fault. The FTP server I'm trying to use is an extremely simple one built into my router .. it doesn't even produce a log file that I might use to diagnose the problem .. and Tropo's log doesn't produce enough detail in that area either. I don't have the time at the moment to mess with installing/configuring a 'real' FTP server (even a simple free one) and I don't have access to a hosted one. But hopefully, others can use what I've done here as a starting point and get it to work for them.
The Tropo/app details:
I followed azrobert's original directions and created a new file called recordCall.php with the following content/code:
Code:
<?php
startCallRecording("ftp://username:password@ftp.yourserver.com/audiotest.wav");
?>
I then created a new app called recordCall and pointed it at the recordCall.php file. The app generated a new SIP address which I then added into my Obi as a speed dial.
That's it.
When I dial the number, i get silence on the other end, as expected. It should be recording whatever voices/sounds my phone mic picks up. But I can't confirm since the file never makes it to my FTP (and it isn't saved/accessible on Tropo's site unless you have a paid account, as far as i can tell).
Now, my original request was just for ideas to turn my phone into a simple voice recorder, but azrobert has opened up a whole new can of gummy worms with a possible workaround for the limited/manual Obi admin call status record-phone-call feature. I'm thinking that this Obi/Tropo-app combination could be used to 'conference-in' the recording app at any point (before or during) of an ongoing conversation. (I know there are posts in this forum about scripts that can 'watch' for the appropriate Obi activity & automatically start recording but it would be mighty handy to be able to initiate recording from the handset, on-demand ... surely this is in the works Obi?)
I'll try to tackle this idea myself later if someone doesn't beat me to it.
azrobert:
Below is my version of a Tropo Record app. I'm using the current year, day of year, hour and minute as the file name. Stop the recording with the pound key. I chose the Ruby language because I'm more familiar with it than the other languages, plus I have a way to test the Ruby code. I was going to add code to stop then restart the app without exiting, but decided it's just as easy to restart the app with a call. I didn't try it, but you should be able to conference in the Record app with a current call.
I use the 1st "Say" command for testing. When you modify a script, it takes the Tropo servers awhile to update and this time period can vary. Every time I modify the script, I change the digit. Now I know I'm using the current script.
Code:
say "Starting 1"
r = Time.now.strftime("%Y%j%H%M")
record "Press pound to terminate recording", {
:maxTime => 900,
:recordFormat => "audio/mp3",
:recordURI => "ftp://:@ftp.tropo.com/recordings/#{r}.mp3",
:recordUser => "Your_Tropo_ID",
:recordPassword => "Your_Tropo_PW",
:terminator => "#"}
say "Ending"
azrobert:
I just noticed that Tropo uses GMT. I live in the Phoenix area, so the time in the file name is off by 7 hours. I couldn't figure out how to change the time zone in Ruby, so I just subtracted 700 or 9500 8300 depending on the hour. I hope I did this correctly. Below is the new script.
Code:
say "Starting 1"
r = Time.now.strftime("%Y%j%H%M")
if r[7,2] > "07"
r = r.to_i - 700
else
r = r.to_i - 8300
end
record "Press pound to terminate recording", {
:maxTime => 900,
:silenceTimeout => 100,
:recordFormat => "audio/mp3",
:recordURI => "ftp://:@ftp.tropo.com/recordings/#{r}.mp3",
:recordUser => "Your_Tropo_ID",
:recordPassword => "Your_Tropo_PW",
:transcriptionOutURI => "mailto:robert@email.com",
:transcriptionID => $currentCall.callerID,
:terminator => "#"}
say "Ending"
Edit:
There is a silenceTimeout that will end the recording.
Edit2:
I did a transcription and sent it to my email.
Edit3:
My date calculation was off by 12 hours when the hour is 01 thru 07. It has been corrected.
azrobert:
It bugged me that I couldn't set the time zone in Ruby. In addition my time adjustment code wouldn't work at the end of the year. I checked PHP and it's very easy to set the time zone. Phoenix has its own time zone because we don't use DST. You can use the standard time zones like PST.
Code:
<?php
date_default_timezone_set('America/Phoenix');
$today = date("YzHi");
record("Press pound to terminate recording", array (
"maxTime" => 900,
"silenceTimeout" => 100,
"recordFormat" => "audio/mp3",
"recordURI" => "ftp://:@ftp.tropo.com/recordings/$today.mp3",
"recordUser" => "Your_Tropo_ID",
"recordPassword" => "Your_Tropo_PW",
"terminator" => "#")
);
?>
Navigation
[0] Message Index
[#] Next page
[*] Previous page