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

infin8loop


At the request of DougObiFan, another script to stop a call recording in progress:

https://app.box.com/s/clcyu6z2y41oth299jtb

You could create a shortcut named "Stop OBi Recording" pointing to the vbs script.  You will need to change 2 parameters in the script for your OBi IP address and your password. I tested with an OBi110 and it seems to work.
Be aware the stop script will indicate "OBi Recording has been stopped" whether or not there was an actual recording in progress to be stopped.

As others have confirmed, on Obi2?? models (and perhaps others) a port=n parameter might to to be added.  The script will handle a 0 or 1 if passed as part of the executing command line.

I came to the conclusion that my "work" laptop has had so much security put on it that running vbscripts is no longer an option. I'm on a non-work Vista laptop now and the scripts seem to run fine. I only have access to 2 OBi110 models, so scripts may or may not work for all the new fangled boxes out there.
"This has not only been fun, it's been a major expense." - Gallagher

kommon

Is there anyway to automate this process to record all calls by setting some entry in ddwrt router and forwarding request to destination computer?

curt00

Quote from: mrjoe on October 17, 2012, 02:56:07 AM
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

Can you elaborate?  Where does http://10.100.101.105/record.au point to?  Is that your internal IP address for your Mac?

What about your input for "Notification URL".  Do I enter the same URL as you have?  If not, what should I enter?


curt00

Quote from: MYOBi on January 21, 2012, 12:26:33 PM
I understand it is possible to login to OBI management interface and record the call in progress.

How do you do this?  I've tried this by going to http://192.168.2.xx > Status > Call Status > clicked on Record.  But I cannot find the recording or recorded file.  On Call History, there is no recording to playback.

drgeoff

Quote from: curt00 on July 14, 2015, 10:58:29 AM
Quote from: MYOBi on January 21, 2012, 12:26:33 PM
I understand it is possible to login to OBI management interface and record the call in progress.

How do you do this?  I've tried this by going to http://192.168.2.xx > Status > Call Status > clicked on Record.  But I cannot find the recording or recorded file.  On Call History, there is no recording to playback.
The file is saved on the computer,  not the OBi.

b3ll

Quote from: infin8loop on January 22, 2012, 02:17:04 AM
Per your request I created the attached obi-recordcallinator.vbs script.

Good luck and let me know how it works out.

infin8loop

It works perfect for me on my OBi100. Thanks so much!!!

siafu2000

Is there a script or instructions on how to record all calls automatically in windows?

restamp

#47
I don't do Windows, but here is a script I use to record conversations on my Linux box.  Perhaps it might help give you some ideas.
#
# This script records a phone call in progress from the specified OBi device
#
USER=user
PW=/change/this/to/the/password/of/the/user/account/on/your/OBi/device
DIR=/path/to/the/directory/to/save/recorded/conversations/in
IP=192.168.0.5/user     # change this to whatever IP address is assigned to your OBi

[ X != "X$1" ] && FILE="$1" || FILE="${0##*/}-$(date +%F@%H:%M)"

cd "$DIR"

case "./$0" in
*/ph1 ) PORT=0 ;;
*/ph2 ) PORT=1 ;;
esac

exec wget --user="$USER" --password="$PW" --output-document="$FILE" \
                "http://$IP/record.au?port=$PORT"


Install this shell script in a directory searchable by your PATH variable, and link it as both "ph1" and "ph2".  When I'm on a call and decide I'd like to record it, I type "ph1" or "ph2" on a command line screen, depending on which line I am on.  The recording continues until I cancel it or hang up.  Optionally, I can specify the name of the file as an argument to the command itself; otherwise the script creates one based on the current date and time.

A few caveats:  This was tested under the Korn shell, but it uses standard shell constructs and should run correctly under any modern shell.  It's only been tested with my OBi202 which is running build 5135.  It does support recording two conversations simultaneously.  I chose to use the user account to initiate the recordings.  I did this because it is more restrictive, but you can also use the admin account if you prefer; just change the USER variable to "USER=admin", specify the admin password, and remove the "/user" from the IP address.  Since the account password is recorded in the script, you should probably restrict read access to protect your OBi's access credentials from prying eyes.  (BTW, you do know how to set the User account password, right?  It can be done under the 'System Management' -> 'Device Admin' page on the OBi.)

My Easter present to all you Linux folks reading the forum.  Enjoy!

Ruslan

Here's a Python script that can run on any OS (Windows, Mac, Linux etc).



ip_address = '192.168.0.55'              # IP address of the OBInet
username, password = 'user', 'user'   # username and password
local_dir = 'C:/temp/recordings'         # directory to save .au audio files

# you unlikely will need to make any changes below

import requests
from requests.auth import HTTPDigestAuth

from time import sleep, strftime

while 1 == 1:
    try:
        response = requests.get('http://%s/user/record.au' % ip_address, auth=HTTPDigestAuth(username, password))

        if response.status_code == 200 and len(response.content) > 0:

            filename = strftime(local_dir + '/rec%Y-%m-%d_%H-%M-%S.au')

            with open(filename, 'wb') as f:
                f.write(response.content)
                f.close()

            print('New file %s created' % filename)

    except Exception as e:
        print('%s: exception: %s' % (strftime("%c"), e.message))

    sleep(10)



It's also stable for any temporary network or Obinet problems - will not bail out and keep monitoring for calls.

ubergoober

I took a different approach.  I have Freeswitch running on a Raspberry Pi and my OBI202 SP3 registers to Freeswitch.  I added a Speed dial entry **31732.  When dialed, extension 1732 simply records any audio that is received.  While on either an incoming or outgoing call, line 1 or line 2, I am able to key the flash button on my DECT phone, followed by the speed dial entry and then flash a 2nd time and the call is recorded.  WinSCP let's me get at the recordings easily.

ubergoober

#50
2nd Alternative approach?  Node-Red running on the Pi.  I directed Obi202 syslog output to udp port 1514.  Node-Red running as a service captures the syslog events, and when an off-hook message comes through, executes a wget based shell script to "press" the record button for the appropriate port.  Upon completion, the CDR callhistory.htm page is called and the caller ID is used to rename the recording with a timestamp, and if the call was received or placed, in the filename.  Completely hands free operation, while accommodating both ports.

You can find this node-red flow at the node-red library: http://flows.nodered.org

or on github:

https://gist.github.com/tomlynn/1acb62db43de9b7f8bc0750f02307d54

Noodles

Infin8loop, great script! Thank you!

Anyone know how can I append the complete phone number associated with the call to the file name in the vb script? Would like to add it at the end of the current file name scheme so I can quickly search when needed.

Thanks again!
nn


ubergoober

@Noodles,
You'll want to have your script wait a second or two after the recording completes and then look at the contents of http://obi-ip-address/callhistory.htm  It contains the list of call detail records.  Good luck.

AutoCallRecorder

Hello,

Like many of you, I got frustrated with the Obihai's seeming inability to record calls automatically. I've adapted the OP's script so that, as long as its running, it will monitor the call status page for active calls from/to numbers white-listed in the script and record those calls, producing an output file with the callers'/recipients' name. Make sure that the script starts up with Windows.


I might adapt the script so that it's easier to expand the number of filtered names and numbers (by adding an array for it to check rather than just blocks of if statements) if there's any popular demand. Additionally, if anyone requests, and time permits, I could modify the script so that it records all phone numbers and names the resulting files with the phone number included.

Enjoy!

GoogleFan

Can anyone help me?

I don't have the record button at all on my Obi1032 device. I only have it on my Obi200.
Is something wrong with my device?

Thanks

GV_OSCE

Quote from: AutoCallRecorder on June 13, 2017, 09:42:12 PM
Hello,

Like many of you, I got frustrated with the Obihai's seeming inability to record calls automatically. I've adapted the OP's script so that, as long as its running, it will monitor the call status page for active calls from/to numbers white-listed in the script and record those calls, producing an output file with the callers'/recipients' name. Make sure that the script starts up with Windows.


I might adapt the script so that it's easier to expand the number of filtered names and numbers (by adding an array for it to check rather than just blocks of if statements) if there's any popular demand. Additionally, if anyone requests, and time permits, I could modify the script so that it records all phone numbers and names the resulting files with the phone number included.

Enjoy!

Are you able to adapt the script so it records ALL the phone conversations?  We only use these ObiTalk/GV phones for training purpose.

ubergoober

I've updated the Node-Red flow that records all calls with an OBI202.

https://flows.nodered.org/flow/1acb62db43de9b7f8bc0750f02307d54

Best Regards,
Tom

JamesJ

Quote from: AutoCallRecorder on June 13, 2017, 09:42:12 PM
Hello,

Like many of you, I got frustrated with the Obihai's seeming inability to record calls automatically. I've adapted the OP's script so that, as long as its running, it will monitor the call status page for active calls from/to numbers white-listed in the script and record those calls, producing an output file with the callers'/recipients' name. Make sure that the script starts up with Windows.


I might adapt the script so that it's easier to expand the number of filtered names and numbers (by adding an array for it to check rather than just blocks of if statements) if there's any popular demand. Additionally, if anyone requests, and time permits, I could modify the script so that it records all phone numbers and names the resulting files with the phone number included.

Enjoy!

JamesJ

#58
Hello Automated Call Recorder,

I have a obi 1032 phone. I have run your script from a Windows 10 computer on the network.
As soon as someone calls, I receive an error message: Windows Script Host Status Code = 404: Not found.

Could able to help me?

THanks

ubergoober

I've updated my Node-Red based call recording flow at: https://flows.nodered.org/flow/1acb62db43de9b7f8bc0750f02307d54

It allows you to trigger recording manually with a URL or you can use syslog to trigger recording on all calls.  It no longer uses shell scripts to do the work and is a lot more accurate in it's identification of the remote caller ID.  It will rename the recording to include the date and remote caller ID and if you install FFMPEG on your LINUX system it will convert the recording to mp3 to save space.

Enjoy!