News:

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

Main Menu

WebRTC Outbound Calls

Started by azrobert, January 07, 2015, 06:47:13 PM

Previous topic - Next topic

azrobert

Usetheforceobiwan showed us how to call our OBi's via WebRTC.
See: http://www.obitalk.com/forum/index.php?topic=9234.msg61177#msg61177

If you log into your GetOnSip account you can pass an outbound number to your OBi. Add code to your X_InbounCallRoute to bridge the call out a provider. I had to use STUN to fix a one-way audio problem. I also port forward the UserAgent and RTP ports.

Log into your GetOnSip account using Chrome here:
https://www.getonsip.com/webrtc/

Enter  18005551212@xx.xx.xx.xx:5061
Click the phone symbol.

Replace xx.xx.xx.xx:5061 with your public IP address and OBi trunk port number.

This worked using Chrome on Window 7 and Android.

QBZappy

Using these WebRTC Outbound Calls methods with the obi as a sip/pstn gateway with the ability to make audio/video calls basically makes voip apps not relevant anymore. The obi used as a gateway can ring any other endpoint reproducing somewhat what Google Voice does. This might be interesting for people who can not obtain a GV number directly.
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

Usetheforceobiwan

#2
The only caveat to this is with respect to one stage dialing for calls from the Getonsip web portal  via the non-login method as referenced above.  While the name you have to enter in order to place the call is forwarded to the Obi as the CNAME (Peer Name), the CID (Peer Number) comes through as "anonymous".  Last time I messed with this, and unless something has changed recently, you cannot route calls via Peer Name, it can only be done with Peer Number.  So in order to facilitate one stage dialing from non-login Getonsip calls,  you have to be prepared to permit one stage dialing for all calls inbound.  At least that is how I remembered it was when I messed around with this 6 months ago.

Edit:  I just remembered another issue (duh), because the logged-in or non logged-in Getonsip web portal does not have facilities to generate DTMF tones, you cannot place calls via the Auto Attendant because you have no way to generate the dialing codes the AA needs.  So the only way to set up redirects through the AA via your Getonsip account is to call your Gos account from another Gos account (login required) which will generate a non anonymous CID which you can route to a speed dial or other pre-defined end point.

Usetheforceobiwan

I just did a search for an online HTML-5 base WEBRTC-SIP client (to allow DTMF dialing) and it appears one does not exist.  While it should be possible, beyond prototypes and demo's, evidently the capability does not exist currently.

azrobert

I logged into my GetOnSip account for the above test.
My OBi call history shows my GetOnSip username as Peer Number.
I did not test for Peer Number in my testing.
I bridged all inbound calls out SP1, but since it shows in the call history I'm sure Peer Number can be tested for routing.

azrobert

#5
Quote from: Usetheforceobiwan on January 08, 2015, 06:17:40 PM
So in order to facilitate one stage dialing from non-login Getonsip calls,  you have to be prepared to permit one stage dialing for all calls inbound.

How do you pass an outbound number to the OBi with a non-login GetOnSip call?

Usetheforceobiwan

Quote from: azrobert on January 08, 2015, 08:30:46 PM
I logged into my GetOnSip account for the above test.
My OBi call history shows my GetOnSip username as Peer Number.
I did not test for Peer Number in my testing.
I bridged all inbound calls out SP1, but since it shows in the call history I'm sure Peer Number can be tested for routing.


Tried pre-defined routing based on Peer Number being a Getonip user name i.e. {getsonsipusername:10#} and {getsonipusername:SPx(18005551212) and AA threw a 403 error upon redirect.  Wonder why?

Usetheforceobiwan

Quote from: azrobert on January 08, 2015, 08:48:18 PM
Quote from: Usetheforceobiwan on January 08, 2015, 06:17:40 PM
So in order to facilitate one stage dialing from non-login Getonsip calls,  you have to be prepared to permit one stage dialing for all calls inbound.

How do you pass an outbound number to the OBi with a non-login GetOnSip call?

Actually as I edited my post to reflect you could not one stage dial through the Obi and  you cannot do second stage (i.e. Auto Attendant) dialing because the Getonsip web portal does not have a dial pad to generate the DTMF codes to tell the Obi Auto Attendent what to dial after you reach the attendant.  The best you can hope to do is be able to redirect a non-login GOS call by pre-defined redirect or in other words a hot line call.

azrobert

Enabling X_SpoofCallerID can cause a 403 error.

Usetheforceobiwan

Just tried to redirect using a non-login Getonsip call to my GOS Obi SP and I was able to route using {anonymous:LI(11235551212)} which bridged the call through the line port.  Audio worked fine both directions.  So it looks like you could setup a GV account on another SP, you could redirect to a pre-defined POTS number or directly to ph1 or ph2.  And if you have multiple GOS accounts, you could define as many Inbound route redirects as you have different GOS account names + an anonymous one for non-login GOS calls.

azrobert

#10
Try following to fix 403 error:
{(<getonsipusername:OBiUsername>)>(1xxxxxxxxxx):SPx}

OBiUsername is the AuthUserName of the outbound trunk.

This worked for me:
{getonsipusername>(1xxxxxxxxxx):SP1},{getonsipusername>(<2:1>xxxxxxxxxx):SP2}

dial 18005551212@me.dyndns.com:5061 to route to SP1
dial 28005551212@me.dyndns.com:5061 to route to SP2

azrobert

#11
I was able to call a number using the OBi Auto Attendant.
I used a keypad external from GetOnSip.

Here is the keypad:
http://onlinetonegenerator.com/dtmf.html

Use Chrome, it doesn't work in IE.
You must press and hold the key for 1+ second.
It took me a few tries to determine how long to hold the key.
The OBi wouldn't recognize every key.
You must also change the DTMFMode in the OBi to INLINE InBand.

drgeoff

Quote from: azrobert on January 09, 2015, 05:59:59 AM
You must also change the DTMFMode in the OBi to INLINE.
.. to InBand?

azrobert


Usetheforceobiwan

#14
Quote from: azrobert on January 08, 2015, 10:32:17 PM
Try following to fix 403 error:
{(<getonsipusername:OBiUsername>)>(1xxxxxxxxxx):SPx}

OBiUsername is the AuthUserName of the outbound trunk.

This worked for me:
{getonsipusername>(1xxxxxxxxxx):SP1},{getonsipusername>(<2:1>xxxxxxxxxx):SP2}

dial 18005551212@me.dyndns.com:5061 to route to SP1
dial 28005551212@me.dyndns.com:5061 to route to SP2


Just to clarify if you are new to this, what this refers to is one stage dialing from a "logged-in" session at Getonsip through your Obi to call out on any of the available SP's.  The basis of this technique is here:  http://www.obitalk.com/forum/index.php?topic=2454.0  and here: http://www.obitalk.com/forum/index.php?topic=895.msg5509#msg5509.  What azrobert has figured out is how to use the Getonsip WebRTC client portal  as a psuedo SIP client.  If you have things setup like azrobert outlines, you could login to your Getonsip account and in the who to call window enter 1 plus the POTS number you want to dial @ your Obi's public IP (if exposed completly to the internet)  or dyndns address (if behind a port forwarded router with dynamic DNS capability) plus the port number (forwarded if required) that the Obi SP you designated listens to.  How this works, Getonsip sends out an invitation to start a call to your Obi, your Obi sees the invitation and recognizes that it is coming from a trusted Peer number (your Getonsip user name) and bridges the call to the other SP you choose using the phone number before the @ sign to make up the digits that place the call.  

Usetheforceobiwan


azrobert

#16
I was able to setup single stage outbound calls with the non-login GetOnSip method.
I used Raspbx as an interface between GetOnSip and the OBi.
GetOnSip wants a name when you make a call with the no-login method.
Instead of a name, enter an outbound number.
Since this method is totally insecure I tried to add some security by including a 3 character PIN prefix to the dialed number.
Add GetOnSip as an inbound trunk in Raspbx.
The inbound call has Cname set to the entered string.
In a custom destination the PIN is stripped off and the outbound number is sent to the OBi.
In this example I'm routing the call to an OBi, but you can do anything you want.
You can include a prefix and route 1 prefix to the OBi and another to a Raspbx trunk.

Add the following code to /etc/asterisk/extensions.custom.conf

[getonsip]
exten => s,1,Set(dialnum=${CALLERID(name)})
exten => s,n,Set(CALLERID(num)=USERID)
;Change USERID to the ID in the OBi InboundCallRoute
exten => s,n,Set(CALLERID(name)=GetOnSip)
exten => s,n,GotoIf($[ $["${dialnum:0:3}" = "PIN"]]?routecall)
;Change PIN to the 3 character Pin you want to use.
exten => s,n,Hangup()
exten => s,n(routecall),Dial(SIP/${dialnum:3}@192.168.1.100:5061)
;192.168.1.100:5061 is the IP address and port of the OBi


To make the above active, enter the following command in the Asterisk CLI:
dialplan reload

Setup a Custom Destination in Freepbx: getonsip,s,1
Description: WebRTC Calls

Add an inbound route for GetOnSip and point it to the above custom destination.

Edit:
The same setup can be accomplished in SipSorcery.