News:

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

Main Menu

Script to record call in progress

Started by MYOBi, January 21, 2012, 12:26:33 PM

Previous topic - Next topic

MYOBi

I understand it is possible to login to OBI management interface and record the call in progress.
Is it possible to create a script, when executed from windows, it will start recording the call in progress from the PC OBI is connected to?

See this for scripting ideas: http://www.obitalk.com/forum/index.php?topic=1152.0

Or, preferably, is it possible to record the call in progress by pressing certain keys on the telephone keypad, recorded file to be saved in the connected PC?

Thanks,


infin8loop

#1
Per your request I created the attached obi-recordcallinator.vbs script.   I have done very limited testing.  It successfully recorded a couple of test calls, the longest being 1min 42secs.  I don't know for sure how it will behave on longer calls as the files get larger.

The 3 variables in the script that must be changed to your specific configuration are:

strURL = "http://192.168.0.40/record.au"
''change 192.168.0.40 above to the local IP address of your Obi

strPassword = "obipassword"
''change obipassword above to the password of your local Obi page login

strDirectoryPath = "C:\Call_Recordings"
''change C:\Call_Recordings above to the full path of the directory to save the call recordings into. The Directory must already exist.

The script does exactly what clicking the "Record" button does and the resulting recording is saved in the directory specified by strDirectoryPath with a file name in the format of obi_recording_yyyymmdd_hhmmss.au.

Good luck and let me know how it works out.

infin8loop

Updated the attached script. Added some basic error checking based on feedback. Will now display "No OBi call in progress" if there is no call in progress.

 
"This has not only been fun, it's been a major expense." - Gallagher

MYOBi

#2
infin8loop,

I tried your script a couple of times. The first attempt was not successful, at the end of the first call, my local OBI rebooted by itself, and nothing was recorded. At the second try, the recorded massage appeared in the specified folder. I like the additions of date and time strings. Very nice!

Thanks.

Edit: I ran the script again when there was no call in progress, just to perform a stress test. It gives an error message.
"Arguments are of wrong type" at Line 27, char 1, code... source...

mrnaughty

Works good when call in progress.!
Thank you!

infin8loop

Quote from: MYOBi on January 22, 2012, 08:01:28 AM
infin8loop,

I tried your script a couple of times. The first attempt was not successful, at the end of the first call, my local OBI rebooted by itself, and nothing was recorded. At the second try, the recorded massage appeared in the specified folder. I like the additions of date and time strings. Very nice!

Thanks.

Edit: I ran the script again when there was no call in progress, just to perform a stress test. It gives an error message.
"Arguments are of wrong type" at Line 27, char 1, code... source...


I'm not sure why your OBi would have rebooted.  I just checked my OBi and it's been up for 2 days (after a config change), well before I even thought of this script. If your OBi reboots immediately during or after the call recording, please check the Status -> System Status -> Product Information -> Uptime for the Reboot Reason code that's in parenthesis. This may or may not tell us something.         

I updated the script (see the updated attachment to the original post) by adding some basic error checking to handle the "Line 27, char 1" error when no call is in progress by displaying a more friendly "No OBi call in progress" message.

If anyone wants to share the longest duration of call they've successfully recorded with the script, I'd appreciate the info.

Thanks for the feedback.
"This has not only been fun, it's been a major expense." - Gallagher

Judgeless


MYOBi

infin8loop,

Quoteplease check the Status -> System Status -> Product Information -> Uptime for the Reboot Reason code that's in parenthesis. This may or may not tell us something.   

(6) may be the reason code for reboot:
UpTime           0 Days 8:14:57 (6)

The code works perfectly. Thanks again, in case we need such a recording one day for "Quality control purposes!!"

RonR

Reboot Reason Codes:

6: New Profile Invoked AND Profile URL Changed

MYOBi

Can you please explain what this code does? Does it change the configuration file inside the OBI so it enables the device for recording (<- I am guessing here)  and maybe that was the reason the profile was changed after first reboot?

The reason I am asking is when I was in a call today, during the converstion, both parties heard a female voice saying "This call is being recorded". We did not run this script at all during this call, and in fact the PC was OFF. We made the call from Google Voice (SP1). I am wondering if recorded announcement came from Google Voice, if not OBI itself.

When I run the script, we never heard "This call is being recorded" message before, although it is desired to hear that.

If profile is changed, what was changed in the profile to enable recording? Where can I look at in the expert mode or from the protal to find out profile enables recording if such a thing exist?

I searched and found this
https://groups.google.com/a/googleproductforums.com/forum/#!category-topic/voice/making-and-receiving-calls/Ct6NL05OgcA


Thanks,

infin8loop


I suspect the "This call is being recorded" voice you heard was from Google Voice.  Normally you would have to press "4" during the call to trigger Google Voice recording.  I have the press  "4" to record calls option disabled in my Google Voice settings but nevertheless I sometimes get the "This call is being recorded" voice during a call even though "4" has not been pressed by me or the other party. When this happens, the call is indeed recorded by Google Voice. The Google forum you cited seems to confirm this behavior is probably a bug in Google Voice. The OBi, as far as I know, does not have the capability (at this time) to voice a "This call is being recorded" when it's recording a call.  If legally required to notify the other party, then you'd have to do so, verbally, yourself (nonlegalbeagledisclaimer).

As far as your reboot is concerned, as coincidental as it might seem, I don't have any reason to believe it was a result of running this script to record a call. In testing, I have never experienced a reboot (my UpTime confirmed this).  I doubt the OBi recording a call involves making any changes to a profile.       

The script simply emulates what pressing the "Record" button within the OBi interface does. When you press the "Record" button in the local OBi interface at http://your-obi-ip-address you are essentially launching page
http://your-obi-ip-address/record.au.  You can confirm this by navigating directly to http://your-obi-ip-address/record.au during a call.  Going there with no call in progress results in an empty page.  The script accomplishes this by the lines objHTTP.open "POST", strURL, False, "admin", strPassword and objHTTP.send where strURL = "http://your-obi-ip-address/record.au".
The response, or recording is in objHTTP.responseBody and is obtained by line BinaryStream.Write objHTTP.responseBody into a BinaryStream object that is then written to the target file by line BinaryStream.SaveToFile strFileName, 2.  Remember, all this script code is running on your PC, not the OBi.  The only script interaction with the OBi is through the http://your-obi-ip-address/record.au URL that your browser would use when clicking the "Record" button.

All this can be verified by looking at the html source of the appropriate "frame" of the browser window that the local OBi interface uses.

   

           
"This has not only been fun, it's been a major expense." - Gallagher

MYOBi

Thanks for the detailed explanation.

mrjoe

How would I use this script on a Mac?
Thanks

Stewart

Quote from: mrjoe on February 21, 2012, 01:21:13 AM
How would I use this script on a Mac?
The VBS code runs only under Windows.

If you have Windows for your Mac (Parallels, Fusion, etc.), the script should run fine.  See http://www.macwindows.com/emulator.html .

If there is a Windows PC on your LAN, you could run it there, using remote access software.

Or, you could rewrite the script in another language (perl, python, PHP, etc.) that runs on Mac.

whoit

I tried this script with my new Obi202 and it fails, plus it makes the Obi a bit squirrelly and I have to reboot.
I noticed the Web Admin page 'record.au' doesn't exist - I assume that the web page has been re-written for the current Obi202.
It looks like it's all JavaScript based, so no more individual pages.

Does any one else have an automated way to record calls?

Thanks...

mrjoe

#14
I found a way to automatically record calls on a Mac!!!


Using Phone Amego http://www.sustworks.com/sb_site/index.html
(an Amazing Application)

See the this for how I set it up.

very simple

Bay11

#15
Infin8loop, can you help me please.  I'm having troubles with the call record script and the OBI rebooting.
I tried the "obi-recordcallinator.vbs" script on an OBI-202 with poor results (my OBI reboots upon running the script).

When I run the script I received a "Windows Script Host" error "Status code = 12152 : Unknown".

I am running this script on an OBI 202 with the following specifications:
HardwareVersion:   1.3
SoftwareVersion:   3.0.0 (Build: 3460)

When I log into the Obi talk administration webpage and check status, I see the following:
I looked for a reboot reason code under; system status, product information, uptime, I do not see a reboot reason code, nor do I see the amount of free memory reported.

I'm using Microsoft Windows Vista, I've checked my firewall settings and directories security settings cannot find a reason why this is occurring (so the script and file, save is not being blocked).

I believe status code 12152 may mean, "error_winhttp_invalid_server_response  – the server response cannot be parsed".

I have attached a copy of OBI 202 callstatus.htm and DOM_Selection_Source.txt of the record button.  
I hope that this helps, I am not sure if this record script has been run on OBI 202 before?

I appreciate the help you all give and with any luck someone can find a solution.  Thank you!

https://www.box.com/s/kzzau8jkwcr8urd4zg0s

skipro

Obi 202, Win 7
Trying record script I get an error msg: Status code = 401 : Unauthorized
IP address and passworf are correct. Run "as adminstrator" gets same results.
When I open Obi page, I see no "record" option/button.
Does this work with the 202? Can you record with the 202?

QBZappy

skipro,

Try looking at the 'Call Status Page' when a call is active. There should be a Record button. It only shows up in the context of an active call.
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

QBZappy

skipro,

I stand corrected. I just had an opportunity to test this on my OBi202 during an active call. It seems the record button has quietly disappeared!!!  ???
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

skipro

#19
QBZappy,
It exists & works on my 202. I tried it from OBitalk, record button shows but does not work. When accessed from IP on computer, it shows and works.
I tried uploading a screenshot but get error, "The upload folder is full. Please try a smaller file or contact administrator."
File is only 45KB
What I do not understand is why the script does not work with my 202. Is this because the 202 has the record button in a different place?