News:

On Tuesday September 6th the forum will be down for maintenance from 9:30 PM to 11:59 PM PDT

Main Menu

Use Obi call recording function as portable voice recorder? [solved]

Started by unvalidUser, June 19, 2015, 05:13:31 PM

Previous topic - Next topic

unvalidUser

I have a Uniden portable handset connected to my OBi200. I would like to be able to use the handset as a portable recording device via the Obi call recording function.

A simple way of doing this, for example, would be for me to call my cell phone from my uniden handset (connected through my Obi), bury my cell phone in a basket of laundry to insulate it from any sound, then just use my Uniden handset as a mic. This would record the 'call', which would only really consist of the sound coming into the uniden - effectively turning it into a handheld voice recorder.

Of course I could do it exactly the way I describe above but it's a bit cumbersome.

So how can this be done using a callroute code/rule to initiate some type of session with the auto attendant or other destination which would be seen as a call-in-progress by the Obi device and thereby allow the call to be recorded?

Another way that would work for me would be to have access to a reliable public phone number that just produces silence, like some type of line test number - similar to this UK Quiet Line Test:
https://support.zen.co.uk/kb/Knowledgebase/Performing-a-Quiet-Line-Test
(although it would be ideal to not have to choose a menu number)

Anyone up for the challenge or have a secret telephone company quiet line test number?

SteveInWA

If you have a smartphone, download and use a sound recording app to turn the smartphone into a digital recorder.

Otherwise, just buy a portable recorder.

azrobert

A SIP conference room will work. If you can't find a free one, you can create your own using Tropo.
Create a free development account here:
https://www.tropo.com/login

Their Website doesn't work well with Internet Explorer, so I use Chrome.

Create a file by clicking on My Files then click on WWW
Click Create New File
Copy and paste the following:

<?php
conference
("1234");
?>


Name the file Conf.php

Create an app called Conf and point it to the above file.

After you create the app, place the cursor over SIP under VOIP details.
The address of the app will be displayed on the bottom left of the page.

I created an app with the above code.
Setup a speed dial like the following to call it:
sp2(9996110573@sip.tropo.com)

SP2 must be defined as SIP.
I'll leave the app up for a day and then delete it.
If it works for you, create your own.

unvalidUser


Thanks azrobert! Sounds fairly simple from your description. I'll give it a try and report back.


unvalidUser

holycrapthatworked

azrobert, your instructions are perfect.

Now i'll just have to leave my phone connected to tropo for several hours to see how long the connection remains before tropo, my service provider, or the Obi disconnects me.
(Edit 20150621: "...maximum session time with Tropo is four hours, so any conference call will also have a maximum uptime of four hours before sessions will begin to disconnect.")

I'm guessing that the 'normal' use for this app/service that I created would be that several people could dial in and conference?

For my purposes, this works. Thank you!

Now if only the record function could be activated from the handset.


azrobert

QuoteI'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.

QuoteNow 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:


<?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.

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.

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.

<?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" => "#")
);    
?>


unvalidUser


Finally got mine working. Only slightly different than azrobert's...
Mine simply starts recording immediately .. no prompts, no beeps .. and when done, just hang up.


<?php
//
// Record for up to 4 hours, hang-up to terminate
// Transfer recorded audio file to FTP destination
//
date_default_timezone_set('America/Chicago');
$dateTime date("YmdHis");
$maxSessSecs 14400;
record("",
       array (
"maxTime" => $maxSessSecs,
              
"beep" => false,
              
// wav format produces <1mb per minute so 4 hours = <240mb
              // "recordFormat" => "audio/wav",
              
"recordURI" => "ftp://ftp.tropo.com/recordings/$dateTime.wav",
              
"recordUser" => "my_tropo_username",
              
"recordPassword" => "my_tropo_password",
              
// Tropo will hang-up if silence for 5 seconds (default) so set to max
              
"silenceTimeout" => $maxSessSecs,
              
"terminator" => "#" // optional; can just hang-up
             
)
      );
?>




azrobert, thanks for the help. Finally got through to Tropo support directly and they helped fix my problem quick (there were a couple offending characters in my password causing problems).


Zopa

I'm trying to replicate this and I'm getting stumbled on something basic. Creating application on Tropo is easy, but I don't the whole flow conceptually, maybe because I have a bit more complex setup.

How it is supposed to work? You setup a speed dial as let's say "9" -- sp2(9991234567@sip.tropo.com), for the tropo app using let's say the code above, then to record a call, you simply conference in this app via "9" speed-dial, before you place a call you want to record (or conference in Tropo during a call in progress)? This part is lost on me a bit.

Now here is my setup. I am in US. I have Obi202, with:

SP1 - GV for outbound domestic calls
SP2 - CallCentric for inbound calls via GV to use their free CNUM lookup
SP3 - CallWithUS for international calls
SP4 - Proxy for my Panasonic KX-TGP550T04 SIP phone

If someone can guide me for how to properly set this up, it would be highly appreciated. The ideal setup would be to have another SIP ID to bound one on of the lines on the phone, which would automatically setup a conf call to Tropo prior to connecting the call. This way I could place regular calls as I do right now and have an option to record them if I wish. (If I'm not mistaken I need more an SP for each SIP ID, so I may need to setup another Obi202, unless there is a way to use the same ID)

I apologies if my questions are too basic and thank everyone in advance.

azrobert

You can call my Tropo app using a speed dial. At this point you can test the app by recording your own voice. Now hit Flash to put the app on hold and then call someone. Hit flash again to conference in the app. You can reverse the process by calling someone first and put them on hold then call the app.

I don't understand what you're trying to do. I've played with Tropo on and off for several years, but I'm far from an expert, so if you want to do something complex I might not be able to help.

wpsb

Can I use Tropo on my OBIHAI phone to make local US# calls?

Ie, can I set up one of my SP numbers to make outgoing US# calls?