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

mrjoe

Please could someone look at the Source Code and find out.
My Obi202 hasn't arrived yet.

QBZappy

skipro,

I tried calls both directions. Outbound Call using the OBi phone, I do indeed see the record button in the 'Call Status'. However in an Inbound call I don't get the Record button.  ??? Can you try receiving a call and confirm if the 'Record' button shows. TKS.
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

QBZappy

skipro,

Related to your problem re the script, it occurred to me that the urls in the OBi202 are different from the OBi100/110. If the previous script references this, you may need to use a tool like 'Firebug' Firefox addon to identify the proper syntax for the OBi202.
https://getfirebug.com/
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

skipro

QBZappy,
Confirmed. No record button on receiving calls. Any idea why not?

In reference to your suggestion on the script, I do not use Firefox so the add on is not a solution.
Since the record button is not on the front screen but 2 screens down, Main screen >Status > Call status, does the script need to refer to this location [2 screens from front screen] and this is why it does not work?

QBZappy

#24
skipro,

Then the record button is partially broken. I hope the OBi people have noticed this.

Re: script, I don't use it, so I don't really know how it works. Our friend infin8loop may have something to say about this.

If you use a Mac I believe that there is a very useful product that would serve your needs (not-free).
Phone Amego
http://www.sustworks.com/pa_guide/index.html#.UJqgMGcpYjk.

If you wanted to record your calls it may be simpler to use a hardware approach using a cheap $3 adapter.
RJ11 Telephone Line Pass-Thru to 3.5mm Mini-Jack Conversation Recording/Line-out Adapter
http://dx.com/p/rj11-telephone-line-pass-thru-to-3-5mm-mini-jack-conversation-recording-line-out-adapter-18869
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

MikeHObi

I have the Obi202
HardwareVersion   1.3   
SoftwareVersion   3.0.0 (Build: 3460)

Calling into the obi, on the local admin webpage I get record call as an option on the call status page using Chrome web browser.  Clicking it during the call starts a download of a file called record.au which continues to download until the call ends.  Inside this .au file is the audio of the call.

Calling from the obi, on the local admin webpage I get record call as an option on the call status page using the Chrome web browser.  Clicking it during the call starts a download of a file now called record(1).au which continues to download until the call ends.  Inside this .au file is the audio of the call.

Of course if I have an incoming call on my google voice line I can press 4 and it will record the call and store it in google voice.

I didn't try the script.
Obi202 user & Obi100 using Anveo and Callcentric.

QBZappy

The Record button not showing up in my Firefox v16.0.2 could very well be a browser compatibility issue.
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

skipro

If I call into the Obi through and phone associated with Obi, a record button will show. If I call into Obi from a phone not associated with Obi I get no record button. Mike, did you call into Obi from a phone /line not associated with Obi?

MikeHObi

did another test.  Firefox 16.0.2 button allowed recording... asked me to verify the save, but worked, both with me calling via my cell, or calling my cell via the obi.

IE 9 button allowed recording, asking me to save etc same thing, calling my cell or my cell calling in.

So all my browsers work. 

As far as how it's done.  Home phone is on phone port 1 of the obi and it is set to call out using Google Voice.  I have it call my personal google voice number that rings my cell (not my cell's direct number). 
When I call my home on my cell, I have it call using google voice, to the google voice number for my home.  That routes it to an anveo DID with fee incoming calling.

I don't know what associated with the obi means.  the anveo line is setup as sp3, callcentric is still setup as sp2, and google voice is sp1.
Obi202 user & Obi100 using Anveo and Callcentric.

infin8loop

Quote from: Bay11 on November 02, 2012, 07:07:00 PM
Infin8loop, can you help me please.
...
https://www.box.com/s/kzzau8jkwcr8urd4zg0s

I don't have an OBi202, so I cannot test. 

Looking at the source for callstatus.htm (from an Obi202) in the above "box" file (posted by bay11) I see:

function click_record(p){
var a;
a="record.au?port="+p;
document.forms[0].action=a;
document.forms[0].submit();
}

The above function click_record(p) appears to invoke url
"http://your-obi-ip-address/record.au?port=0"

The port is zero because in the code I'm looking at the function click_record is invoked when clicking
the "record" button by code:

<input class=buttoninput type=button value='Record' onClick="click_record(0)">.

Notice the zero being passed as a parameter to the function.
I don't know if the parameter will always be zero or will vary depending on what call(s) are in progress. 

I suggest someone with both my original script and an Obi202 do the following:

Make sure you modify the following 3 lines in the script as shown:

strURL = "http://192.168.0.40/record.au?port=0"
''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.

Notice the addition of "?port=0" to the strURL string which is not in the original script because the OBi110 doesn't (or didn't) need it. The poster of the htm file (bay11) appears to have had only 1 call in progress at the time of the callstatus.htm source capture.  If memory serves me correctly, an OBi110 only has one "record" button even if more than one call is in progress.  Pressing "record" will record whatever call in on the phone as you "flash" dial between the calls (if that makes sense). I don't know what the OBi202 shows. Does an OBi202 show more than one record button for multiple calls necessitating the port number?   
"This has not only been fun, it's been a major expense." - Gallagher

mrjoe

#30
Infin8loop, thanks so much for your help.

I can confirm the following:
The following URL will record calls only on Phone port 1
"http://your-obi-ip-address/record.au?port=0"

Putting a 1 in place of the 0 will record calls only on Phone port 2
"http://your-obi-ip-address/record.au?port=1"

MikeHObi

Obi puts up two grids with a record button on the header of each for multiple call presentations on the obi202.
See below.


Now I did test this and and flashing between the callers was wonkey.i.e. the first caller could be flashed to hold, but when I went back they couldn't hear me, but I could hear them.  Recording caught both sides though.  Pressing the second button after pressing the 1st didn't really do anything.  It appears that what it is recording is what is sent or received from the handset, and not the individual sp ports.

Thus if I press record call on the top call, it switched to showing stop recording for both.
Obi202 user & Obi100 using Anveo and Callcentric.

infin8loop

#32
Quote from: mrjoe on November 10, 2012, 09:04:49 AM
Infin8loop, thanks so much for your help.

I can confirm the following:
The following URL will record calls only on Phone port 1
"http://your-obi-ip-address/record.au?port=0"

Putting a 1 in place of the 0 will record calls only on Phone port 2
"http://your-obi-ip-address/record.au?port=1"

Thanks for the heads-up. I forgot the OBi202 has two phone ports. Makes sense why the port parameter is needed.

Below link points to an updated version of the original script. The phone port (0 or 1) may be passed to the script via the command line. This can be done by creating a shortcut for the script and then editing the properties of the shortcut. Add a 0 or 1 to the end of the shortcut "Target" after the last double quote if there are double quotes surrounding the value. There should be a space between the last double quote and the 0 or 1. Create two different shortcuts, one with a 0 for phone port 1 and another shortcut with a 1 for phone port two. No port needs to be passed for the OBi 100/110.  

Three lines in the script still need to be modified to your own values.
 
script: https://www.box.com/s/hthaoxvqbuidwd6uogqp


Again, I don't have an OBi202, so I cannot test the nuances of script execution.

The upload directory here on the forum shows to be full.

Update: If you have an OBi202 and can't remember to pass the 0 or 1 in the command line then you can add the three lines shown in red below:

if WScript.Arguments.Count = 1 then
    strPort = WScript.Arguments(0)
    if strPort = "0" or strPort = "1" then
        strURL = strURL & "?port=" & strPort   
    else
        wscript.echo "If a port number is passed, it must be 0 or 1"
        wscript.quit(2)
    end if
else
    wscript.echo "You must include the phone port number in the shortcut for an OBi202"
    wscript.quit(2)

end if

I was attempting to make the script generic enough to handle both an OBi100/110 or OBi202. The port is not need for an OBi100/110.
"This has not only been fun, it's been a major expense." - Gallagher

skipro

Infi8loop,
Thanks for the scripts.
What script line would send a error msg if no port # was included. You have one if it is not "0" or "1", but what if there is no port # added or included.
Msg Ex:  "You must include the phone port number in the shortcut"

Now all you get is a Windows Script Host error: "Status code = 12152 : unknown"

infin8loop

Quote from: skipro on November 10, 2012, 04:13:12 PM
Infi8loop,
Thanks for the scripts.
What script line would send a error msg if no port # was included. You have one if it is not "0" or "1", but what if there is no port # added or included.
Msg Ex:  "You must include the phone port number in the shortcut"

Now all you get is a Windows Script Host error: "Status code = 12152 : unknown"

Please see the update in my earlier post. 

Does the updated script work on an OBi202 if the phone port is passed in the command line? 
"This has not only been fun, it's been a major expense." - Gallagher

skipro

#35
Infi8loop,
Again, thanks. Works fine.
Another option I used before you updated your script to include the port was to add the port info to your original script, then have 1 script one for port1 and another for port2.  Obviously your updated script is more elegant.

Another idea, have the script request the port number in an input box, then after user input, proceed. How would this be done?

cyberic68

Hi infini8loop,

I have an Obi110, I have run your script without a real success

I did update your script with the following

strURL = "http://192.168.11.27/record.au"
strPassword = "xxxxx"
strDirectoryPath = "C:\Users\Eric\Call_Recordings"

I run the script with "Microsoft Windows Based Script Host" under Windows 8 Pro.

Automatically it has created a file under C:\Users\Eric\Call_Recordings

obi_recording_20130205_230448.au with 0kb size

Then I have made a phone call, but nothing has been recorded, the file size was still 0 kb after I hang up.

Would you have an idea ?

thanks

Eric

infin8loop

#37
cyberic68,

Upon trying to run my OBi related scripts I've discovered they all fail now. I use Windows XP (a work requirement). I don't routinely use the scripts that I have posted. I developed them as a hobbyist and they worked (for me) when posted. I'm not sure exactly what has changed to render the scripts inoperable.
The script to record calls was designed to be launched while a call is in progress on the OBi.  It emulates pressing the "Record" button while on the OBi Call Status page. Or navigating directly to http://your_obi_ip_address/record.au (the same URL the "Record" button on an OBi100/110 Call Status page envokes) in a browser window while a call is in progress used to work. Now that fails for me as well. If I figure it out, I'll post back.
   
"This has not only been fun, it's been a major expense." - Gallagher

cyberic68

Hi infin8loop

I really hope that you will find a work around

Thanks

Cyberic68

opuletn

I switched from a Obi110 to a Obi200 and the original script that used to work for the Obi110 stoped working.
Adding the ?port=0 to the strURL as infini8loop suggested fixed it. Even though the Obi200 only has 1 physical phone port.