OBiTALK Community

General Support => Day-to-Day Use => Topic started by: giqcass on December 12, 2013, 03:14:40 AM

Title: Sipsorcery for no XMPP calling with Google Voice
Post by: giqcass on December 12, 2013, 03:14:40 AM
I still have a free Sipsorcery account so I decided to do a little testing tonight.  Any ATA including the Obi can be used with Sipsorcery to make and receive free Google Voice Calls.  Sipsorcery does not use XMPP so it should continue to work just fine after XMPP is shut off. Unfortunately free accounts with them don't appear to be available right now.  Paid accounts start at $69 per year flat rate. That averages out to $5.75 per month.  Since you can use sipsorcery to set up multiple Google voice accounts at no additional charge this can be a good deal.  The Sipsorcery account need not be used with a single ATA so one account could be used by you at home, at work, and one at your sisters house.  All of the ATA devices could use different phone numbers if you like or they could all use the same phone number.  Soft-phones can also be used with Sipsorcery so you could use your Android or Iphone with Sip to save minutes on your cell phone plan.  In my tests tonight I added Sipsorcery as a Gateway to my OBi.  Inbound calls do not need to be routed through Sipsorcery but if you choose to do so they will ring as normal.  Outbound calls work as normal accept you will hear one extra ring before the called party hears their 1st ring. 

Sipsorcery seems to work just as well for me today as it did the first time I used it years ago.  All updates are made on the Sipsorcery system so firmware updates are not needed if something breaks. You must enter your Google Voice credentials on their website in order to use their system with Google Voice. Sound quality is as good for me as it is on my Obi with the current Obi Google Voice calls.  Multiple calling routes are supported. 

There is no limit on the number of Google Voice accounts you can add to once Sipsorcery account but it appears only 3 Google Voice outbound calls can be made at the same time with the $69 plan.  For instance if you had 5 Google Voice accounts set up 3 of them could be making calls well 2 of them are taking calls all at the same time.  The math looks like this if you look at it on a per account basis.
1 Google Voice accoint=$5.75 per month.
2 Google Voice accoints=$2.87 per month.
3 Google Voice accoints=$1.91 per month.
4 Google Voice accoints=$1.43 per month.
5 Google Voice accoints=$1.15 per month.


On a side note Sipsorcery could be used as a backup route in case your Obi fails to register with Google Voice by using trunk groups.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 13, 2013, 06:50:04 AM
This sounds very interesting. As it turns out I still have a free (never used) sip sorcery account! Can you elaborate a little more how to set this up. I understand how to create the voice gateway and I read on Sipsorcery how to add Google Voice for outgoing calls, but don't follow all the instructions over there quite. Moreover how do I modify my Obi110 to use this. Currently I have Google Voice as Sp1 and Callcentric with a free DID on Sp2 and my Callcentric number is a forwarding phone number for Google Voice (from Sipsorcery's documentation I understand that this is all necessary). What else do I need to do on the Obi? I assume modifying the outbound call route, but how. What complicates things a little that I already use a voice gateway for my 800 numbers to avoid Google Voice's problems with some 800 numbers. I also did not quite understand what I have to on Sipsorcery's side. Any details would be appreciated.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: giqcass on December 13, 2013, 06:42:12 PM
Use the Silverlight gateway on Sipsorcery to do the following steps.
Step 1
Create a ruby dial plan named default on Sipsorcery.  Paste the following.

case req.URI.User
 when /^00/ then sys.Dial("cheapintlcalls")
 else sys.Dial("MyGoogleVoice")
end


Step 2
Add a Sip provider named MyGoogleVoice
Select Google Voice.
Enter your full email Google Voice email address as the user name.
Enter your Google Voice Password. 2-step verification must not be turned on.  App specific passwords won't work.
Enter your Callcentric number as the callback number.
Select Home for the phone type.

Step 3
Create a sip account.  This is the sip account you will use on you obi. Out dial plan = default.

Step 4
Go to callcentric and create this call treatment.  
Call coming from Caller ID:
This number: = your google voice number
Redirect call to:One destination
This number:= yousipaccount@sipsorcery.com The sip account you created in step 3.

Step 5
Set up a Gateway on your Obi.            
AccessNumber = SP2(sipsorcery.com)
AuthUserID = The Sipsorcery user name the part before the @ sign in the sip address from step 3
AuthPassword = The Sipsorcery password for the sip account in step 3

Step 6
Set up a dial plan on your Obi to make use of the Gateway in whatever fashion you plan to use it. Do you want to use it as a backup? as you primary? As a fallback?

Outgoing calls using the Gateway go through Sipsorcery.
Incoming calls bypass Sipsorcery entirely.


If you want to use it as a failover you will need to create a trunk Group.
Trunk Group 1 = SP1,VGx   where x = the Gateway you set up for Sip sorcery.
I don't know what your current dial plan looks like but you would replace sp1() with TG1() in your outbound plan.

With the Above setup if Callcentric went down Sipsorcery would not work.  An alternative would be to use an IPkall number as a Google Voice forwarding phone.  In Google Voice you would leave it unchecked and on the IpKall website you would forward directly to the sipsorcery sip account listed in step 3.

If anyone sees any errors let me know.  I was very frustrated writing this because I accidentally closed the tab the first time I wrote it and I lost the whole thing.   :'(
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 13, 2013, 09:29:00 PM
This is another solution. I was very busy today and worked on this off and on since this morning, so I have to post it.

SipSorcery

Create a Dialplan named dialplan
Anything after "#" is a comment

#Ruby # DialPlan
if sys.In                                                                                    #   IN DIALPLAN STARTS
  CID = req.Header.From.FromURI.User
  CID = "#{$1}" if CID =~ /^1?(\d{10})$/                            #   Remove leading "1"
  CallerName = req.Header.From.FromName
  sys.Dial("user1@local[fu=#{CID},fd=#{CallerName}]",30)

else                                                                                          #   OUT DIALPLAN STARTS
 UserID="#{req.Header.From.FromURI.User}"
 dialnum="#{req.URI.User}"
 sys.Log("Phone Number #{dialnum}")
 dialnum.insert(0,"480") if dialnum =~ /^\d{7}$/           #   7 digit Domestic (480=area code)
 if dialnum.match /^(1?[2-9]\d{9}$)/                                #   Domestic - GV Callcentric
    sys.GoogleVoiceCall("GVuserID", "password", "12121234567", "#{$1}", ".*", 1, 20)
#  GVuserID without @gmail,com
# 12121234567 = Callcentric DID
# Next to last parm = GV forwarding DID type. 1=Home, 2=Mobile, 3=Work
  else
    sys.Respond(400,"Invalid Call")
 end
end


Create a SIP Account:
Username = User1
Password = password
In & Out Dial Plan = dialplan

Define Callcentric as a SIP Provider:
Use your Callcentric credentials
Register Contact will be automatically defined by SipSorcery after save.

OBi110

Define Voice Gateway 2:
Name = SipSorcery
AccessNumber = sp2(sipsorcery.com)
DigitMap = (<2:>xxxxxxxxxx|<2:>xxxxxxx)
AuthUserID = user1
AuthPassword = password

Add to Phone Port Digit Map:
2xxxxxxxxxx|2xxxxxxx

Add to Phone Port OutboundCallRoute:
{(Mvg2):vg2}

Dial 24805551212 or 25551212

None of the above was tested.
I cut and pasted pieces of a more complex working dial plan to create the above.

When GV stops working with the OBi do following:
Delete GV, Callcentric and Voice Gateway 2 from the OBi.
Use SP1 to register to user1 at SipSorcery.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: giqcass on December 13, 2013, 10:03:57 PM
It should be noted that Sipsorcery allows you to use your Google Voice contacts for incoming caller Id.  I have not set that up so for the moment I can't help with that feature.  The post by azrobert  shows that dial plans can be more complex then the one I posted.  There are many advanced features available to Sipsorcery users.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 13, 2013, 10:36:51 PM
Quote from: giqcass on December 13, 2013, 10:03:57 PM
It should be noted that Sipsorcery allows you to use your Google Voice contacts for incoming caller Id.

You can also setup your own cname table in the dialplan.
It's been a long time since I did this, but I think you need a "begin" between the table and the code and an extra "end" at the end of the code. You can get into trouble if you don't get a match and callername ends up with a null value. That is why I set it to "unknown".

TNAME = {
 '4801111111' => 'Dad',
 '4802222222' => 'Sister',
 '6023333333' => 'Brother'  }

begin

callername = "unknown"
callername = TNAME[CID]

end
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 15, 2013, 07:50:54 AM
I have some questions about the sip sorcery dial plan. Currently I use Google Voice also for my international calls. In giqcass's dial plan I assume I can simplify his dial plan, but what is the simplest way. In azrobert's dial plan I am not sure it will handle international calls as listed and I do not understand the role of the 480 area code. Do I change that to my area code and does it handle international calls via Google voice?
Thanks for these explanations, I feel that I am close to implementing this, initially maybe as a fall back.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 15, 2013, 09:00:29 AM
"480" is your local area code. The command inserts "480" to the beginning of a 7 digit dialed number. You could do this function in the OBi.

Here is an updated dial plan and OBi changes including international numbers:

#Ruby # DialPlan
if sys.In                                                            #   IN DIALPLAN STARTS
  CID = req.Header.From.FromURI.User
  CID = "#{$1}" if CID =~ /^1?(\d{10})$/                            #   Remove leading "1"
  CallerName = req.Header.From.FromName
  sys.Dial("user1@local[fu=#{CID},fd=#{CallerName}]",30)

else                                                                #   OUT DIALPLAN STARTS
 UserID="#{req.Header.From.FromURI.User}"
 dialnum="#{req.URI.User}"
 sys.Log("Phone Number #{dialnum}")
 dialnum.insert(0,"480") if dialnum =~ /^\d{7}$/                    #   7 digit Domestic (480=area code)
 if dialnum.match /^1?[2-9]\d{9}$/ or                               #   GV-Callcentric
    dialnum[0,3].match /^011$/
    sys.GoogleVoiceCall("GVuserID", "password", "12121234567", "#{dialnum}", ".*", 1, 20)
# GVuserID without @gmail.com
# 12121234567 = Callcentric DID
# Next to last parm = GV forwarding DID type. 1=Home, 2=Mobile, 3=Work
  else
    sys.Respond(400,"Invalid Call")
 end
end


OBi110

Define Voice Gateway 2:
Name = SipSorcery
AccessNumber = sp2(sipsorcery.com)
DigitMap = (<2:>xxxxxxxxxx|<2:>xxxxxxx|<2:>011xx.)
AuthUserID = user1
AuthPassword = password

Add to Phone Port Digit Map:
2xxxxxxxxxx|2xxxxxxx|2011xx.

Add to Phone Port OutboundCallRoute:
{(Mvg2):vg2}

Dial 24805551212, 25551212 or 2011xx.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 17, 2013, 06:31:21 PM
I tried this, but I get immediately a busy call when dialing my cell phone, while I know the number is not busy (my cell phone is right next to me). I get a busy call after two rings when I call my office phone number. When looking at the OBI Call history page it shows that the cell phone call  never connected, while my office phone was connected for 8 seconds. A few details I guessed at:
When creating the sip provider account for call centric on the Silverlight page it asks me for the username. I tried using both my Callcentric login username and the 1777xxxxxxx number. I also entered callcentric.com as server, which was updated to sip:callcentric.com and I ticked the Register button. The register contact got populated by my callcentric username@callcentric.com
Is this all correct? The Sip provider registry part is populated and seems correct to me.
I must say that I have no clue what is wrong. Any hints?
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: giqcass on December 18, 2013, 04:27:42 AM
If you were following my instructions and you added Callcentric as a Sip Provider in the Sipsorcery silverlight portal.  Thats problem number 1.  It can work that way but why don't we try to see what else is different.

Why don't you go to the silverlight portal and see what errors you are getting for the calls.  Click the calls tab and tell me what you see.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 18, 2013, 07:12:28 AM
I was using azrobert's method. Tonight I'll try your method and see whether that works. I was wondering whether the different behavior could be caused by the fact that my cell phone is a Google Voice forwarding phone and my work phone is not.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 18, 2013, 07:43:16 AM
I just setup my Callcentric account as a provider using the 1777 number.
The Register Contact should be sip:username@sipsorcery.com
username is your SipSorcery account name.
Don't know why it's showing your Callcentric username.
Does SIP Provider Registrations show you are registered to Callcentric and what is Contact?

You can click on the Console Tab, then click Connect.
The console will show all activity including any dial plan syntax errors.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 18, 2013, 01:40:24 PM
@azrobert
I mistakenly wrote my call centric user name, in fact it shows exactly like you wrote.
SIP Provider Registrations shows registered with contact replacing my real username by username: sip:username@sipsorcery.com;rinstance=MHYTBD
When I clicked on console it showed:
Monitor 21:37:40:172: basetype=console, ipaddress=*, user=username, event=*, request=*, serveripaddress=*, server=*, regex=.*.
Do I watch the console while trying to make call? If so, it will have to wait until I am home.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 18, 2013, 02:07:09 PM
Yes, you need to make a call.

As I said before I created the dial plan with several cut and pastes plus some mods, so it's very likely I made a mistake.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 18, 2013, 06:17:52 PM
@azrobert
I tried making a call. Now I got the female Google Voice message saying that it could not complete the call. Please try again. The console on Sipsorcery did not change at all, so it seems that the call never reached sipsorcery. The insole did show a successful registration with Callcentric:
ContactRegisterInProgress 02:10:33:472 sip1(1740): Sending initial register for xxxxxx and Callcentric to udp:204.11.192.163:5080.
ContactRegisterInProgress 02:10:33:472 sip1(1740): Initiating registration for xxxxxx on sip:callcentric.com.
ContactRegistered 02:10:33:550 sip1(1740): Contact successfully registered for xxxxxx on sip:callcentric.com, expiry 64s.

I have to check my OBI configuration. Does it matter where I add the items for the Phone port (i.e. any place  in the PortDigitMap and  Phone Port OutboundCallRoute).
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 18, 2013, 10:11:07 PM
I think the call is being routed out SP1.
The default ITSP A DigitMap contains the rule "xx." which will match the dialed number and route the call out SP1.
Add "{(Mvg2):vg2}" at the beginning of the Phone Port OutboundCallRoute.
It doesn't matter where the DigitMap rule is placed.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 19, 2013, 06:24:40 PM
I already suspected that my OutboundCallRoute was not correct and was planning to add the "{(Mvg2):vg2} to it. I did and now it seems to work. One question: should the call not show up as an inbound call on the Callcentric webpage? I looked and it was not listed.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 19, 2013, 07:25:37 PM
Yes, the call should be posted on Callcentric.
Are you sure the call is going to SipSorcery?
Can you see it in the SipSorcery console or Call history?
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 20, 2013, 06:56:51 AM
Anybody with a smartphone can use this setup to make and receive GV calls. Install a softphone and register it to SipSorcery using the same credentials as VG2.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 20, 2013, 07:51:36 AM
My guess is that it does not go to Sipsorcery. I am wondering whether the digit map in the ITSP Profile for Callcentric is the problem. I have:
(*xx.|**275*x.|[3469]11|1xxxxxxxxxx|<1>[2-9]xxxxxxxxx|011xx.|xx.|(Mipd)|[^*#]@@.)
Would this digit map cause the number to out over Sp1 (my default outgoing service)?
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 20, 2013, 08:43:39 AM
Your ITSP DigitMap will match the dialed number with "xx.".
OutboundCallRoute processing goes left to right using the first matching rule, so it doesn't matter if the VG2 rule is first.

Check the OBi call history to see what's happening.
Log into the OBi directly using the Web interface.
Go to Status -> Call History.

You are dialing the number with a "2" prefix?
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 20, 2013, 05:50:28 PM
In the Call history it shows the number without the "2", while I do dial with the "2" prefix. The call is made by GoogleVoice1. I had put the VG2 rule not quite at the beginning, so I'll change that and see what happens.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 20, 2013, 06:04:37 PM
I just moved {(Mvg2):vg2} and 2xxxxxxxxxx|2xxxxxxx|2011xx. to the front of  Phone Port OutboundCallRoute and of the Digit Map respectively and now the call does not go out at all. After a long silence with some clicking noises I get the dial tone.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 20, 2013, 06:16:26 PM
I tried this again (maybe the Obitalk network does not update immediately). Now I got an error message and I had the console open at Sipsorcery and saw this:
DialPlan 02:10:15:394 sip1(6116): There was a syntax error in your dial plan on line 21, please check.
DialPlan 02:10:15:394 sip1(6116): Dialplan cleanup for user.
DialPlan 02:10:15:473 sip1(6116): Dial plan execution completed without answering and had an execution error message of Dial plan syntax error.
DialPlan 02:10:15:473 sip1(6116): UAS call failed with a response status of 500 and Dial plan syntax error.

As far as I can see line 21 is the end of the script, so I don't quite understand the error message (the "2" was stripped successfully from the number)
Title: Re: Sipsorcery for no XMPP calling with Google Voice- progress
Post by: AntonS on December 20, 2013, 06:25:53 PM
I found one error. When I copied your Ruby script, I missed the second "end". I added it and tried again, but now I had another error:
DialPlan 02:17:27:791 sip1(6116): Using dialplan dialplan for Out call to sip:803xxxxxxx@sipsorcery.com.
NewCall 02:17:27:806 sip1(6116): Executing script dial plan for call to 803xxxxxxx.
DialPlan 02:17:27:853 sip1(6116): Phone Number 803xxxxxxx
DialPlan 02:17:27:853 sip1(6116): SDP on GoogleVoiceCall call had public IP not mangled, RTP socket xxx.53.114.116:16802.
DialPlan 02:17:27:853 sip1(6116): UAS call progressing with Ringing.
DialPlan 02:17:27:853 sip1(6116): Logging into google.com for user.
DialPlan 02:17:27:884 sip1(6116): Google Voice pre-login page loaded successfully.
DialPlan 02:17:27:900 sip1(6116): GALX key G0q9gKFG5H0 successfully retrieved.
DialPlan 02:17:28:494 sip1(6116): Google Voice home page loaded successfully.
DialPlan 02:17:28:509 sip1(6116): Could not find _rnr_se key on your Google Voice account page, callback cannot proceed.
DialPlan 02:17:28:509 sip1(6116): Exception on GoogleVoiceCall. Could not find _rnr_se key on your Google Voice account page, callback cannot proceed.
DialPlan 02:17:28:509 sip1(6116): Dialplan cleanup for user.
DialPlan 02:17:28:837 sip1(6116): Dial plan execution completed without answering and with no last failure status.
DialPlan 02:17:28:837 sip1(6116): UAS call failed with a response status of 480.

Here 803xxxxxxx is the number I was trying to dial, but I have no clue what "_rnr_se key on your Google Voice account page" means.
Title: Re: Sipsorcery for no XMPP calling with Google Voice-Problem identified
Post by: AntonS on December 20, 2013, 07:20:50 PM
It seems that Google is blocking Sipsorcery from accessing my account, as its login originates from an unknown location. I got emails from Google about this referring me to web a page where I could click to say that this was me (or change my password if it wasn't me), but after clicking that it was me,  I still got "Browser sign-in attempt (prevented)" on my next attempt and I can't see on Google's webpages how to get around that. On that same webpage it says:"For your security, we will continue to display these events for 2 weeks." Maybe this means that after 2 weeks it will start working.
Title: Re: Sipsorcery for no XMPP calling with Google Voice- partial progress
Post by: AntonS on December 20, 2013, 07:33:15 PM
I found though some Googling that going to the page:
https://accounts.google.com/DisplayUnlockCaptcha
one gets around login issue, but somehow the callback did not happen fast enough and timed out:
ContactRegisterInProgress 03:27:22:926 sip1(1740): Initiating registration for user on sip:callcentric.com.
ContactRegistered 03:27:23:020 sip1(1740): Contact successfully registered for user on sip:callcentric.com, expiry 65s.
DialPlan 03:27:32:957 sip1(17704): Google Voice Call timed out waiting for callback.
DialPlan 03:27:33:004 sip1(17704): Google Voice Call to  was successfully cancelled.

Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 20, 2013, 08:58:25 PM
The 20 (last parm) is a timeout value. 20 seconds should be more than enough, but you can set it higher.
Make sure the DID type matches how you defined the Forwarding number in GV. It won't work if it doesn't match.

sys.GoogleVoiceCall("GVuserID", "password", "12121234567", "#{dialnum}", ".*", 1, 20)
# GVuserID without @gmail.com
# 12121234567 = Callcentric DID
# Next to last parm = GV forwarding DID type. 1=Home, 2=Mobile, 3=Work
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 20, 2013, 09:36:35 PM
I made several changes to my last post because I didn't carefully read your posts.

You have dual registrations to Callcentric. One registration from the OBi and another from SipSorcery. The call from GV should be routed to both.  You can try unregistering Callcentric on the OBi and see if that makes a difference.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: AntonS on December 23, 2013, 02:48:59 PM
I am away from my home Obi so I can't test your suggestions. I am at another location where I have another Obi which calls via a speed dial out over Google Voice on  my Home Obi. As an experiment I registered that second Obi with Sipsorcery and tried to dial out to a number prepending the number with **2. As all my outgoing calls are redirected to my first Obi I got the Obi attendant and pressing 1 the call continued, but kept ringing (while an answering machine should have picked it up), so I am not sure that worked. I don't want to mess too much with this second Obi right now (as it is my most reliable phone connection), so I'll wait until I'm back home to try this again.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: mrjoe on December 29, 2013, 04:54:03 AM
Just managed to track down the login details for my free account! :)

Going to have some fun with this!

Can you bridge 2 voip accounts using their switches?
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 29, 2013, 07:32:02 AM
Quote from: mrjoe on December 29, 2013, 04:54:03 AM
Can you bridge 2 voip accounts using their switches?

Please explain what you want to do.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: mrjoe on December 29, 2013, 07:52:19 AM
I want to register a SIP account and have Sipsorcery forward incoming calls via another SIP account.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 29, 2013, 08:50:41 AM
If you want fun you can definitely have it with SipSorcery.

Place following in the inbound section of your dial plan:

Bridge an inbound call to a user at Callcentric:
     sys.Dial("17771234567@in.callcentric.com[fu=#{CID}]")

Bridge an inbound call to an IP address. This can be your OBi.
      sys.Dial("user@someone.dyndns.com:5061[fu=#{CID}]")

The free account only allows 1 provider, but you can route calls to SipSorcery by IP address.
Example: setup IPKall to yourID@sipsorcery.com

When you have multiple providers you normally can't determine which provider is sending the inbound call. There is a trick to determine the provider. Let me know if this is a requirement.

In the outbound section of the dial plan you can send a call to the OBi like this:
sys.Dial("#{dialnum}@you.dyndns.com:5061",30)

Then route the call out a SP:
{YourSipSorceryID>(Msp1):sp1}

This is another OBion replacement.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: mrjoe on December 29, 2013, 09:04:03 AM
thank you for that azrobert.  I'm pretty new to this.

shame I can only use 1 sip account, but it is useful to be able to forward an existing "locked" DID to another account.

what account forwards to the SIP address?  Is it the main sipsorcery account or does it go back out via your SIP provider?
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on December 29, 2013, 12:14:04 PM
The only providers I know that can route calls to SipSorcery without registration are IPKall and Callcentric. See giqcass' reply #2 step 4 to setup Callcentric. I'm sure there are others.

This is the info available on an inbound call:
UserID = req.URI.User     
CID = req.Header.From.FromURI.User
CallerName = req.Header.From.FromName

When you bridge the call you set the CallerId and CallerName like this:
sys.Dial("someone@dyndns.com[fu=#{CID},fd=#{CallerName}]")
or
sys.Dial("someone@dyndns.com[fu=#{UserID},fd=#{CallerName}]")
or
sys.Dial("someone@dyndns.com[fu=8005551212,fd=#{CallerName}]")

On an outbound call the UserID of the extension (account) you are registered to is available like this:
UserID="#{req.Header.From.FromURI.User}"

When you do this:
sys.Dial("#{dialnum}@you.dyndns.com:5061",30)

It defaults to the extension UserID. I think you can override this with the "fu" parm, but I never tried it.

Edit:
On an inbound call the UserID is the SipSorcery target ID.
So if your SipSorcery main account is "user" and you have sub-accounts "user2" and "user3", UserID will be one of these depending on how the call was routed to SipSorcery.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: deskjockey on January 30, 2014, 03:13:52 PM
I also have an old Sipsorcery account that I once used for GV, using IPComms as my DID. I blamed latency on the Linksys ATA and ended up with 4 Obi devices that improve latency and time to connect the call. But at my age I don't remember much but want to set it up again.

Will having Obi registered with GV conflict with SS registering? IPComms' site shows I can make two concurrent calls, it acting as two lines, if that also is a consideration.

Thanks in advance
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: drgeoff on January 30, 2014, 04:32:51 PM
Quote from: deskjockey on January 30, 2014, 03:13:52 PM
Will having Obi registered with GV conflict with SS registering?
I think it will not conflict.  SS does not register with GV in the same way that a SIP client registers with a SIP server.  SS only communicates with GV when you place a call.  It emulates the GV method of making a call via your GV web page, inputting the number you wish to call and indicating the callback number.

But why not try it for yourself and report back here with the result?
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: CLTGreg on January 30, 2014, 05:21:12 PM
This is cool and all but reading their recipe it seems like they are just call forwarding to a phone number that then trickles down through a SIP provider. I'm not sure why I would do that over the free Callcentric NY number (which I wasn't impressed with the quality last night) unless I needed some of the other functionality such as multiple Google Voice #s which is cool.

What isn't cool and what I'm more nervous about is my primary number is linked to an account that links to a lot of other stuff. I'm skittish on giving out my user name and password to a third party that will unlock my entire Google experience.

If I would have planned better I would have set this up different so the account wasn't critical but it is and I'm hard press to give out the authentication.

I'm probably missing something but I don't see the advantage here unless you could use the other features.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: deskjockey on January 30, 2014, 07:50:22 PM
drgeoff,

Thanks, I agree but I feared I was missing something and needed encouragement. I still think I better test it on a lightly used number just in case.

I will probably take day if not next week seeing IPComm tech is off weekends because I suspect I will run into a communication problem between IPComms and SS.

Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: giqcass on February 01, 2014, 06:28:15 AM
Quote from: drgeoff on January 30, 2014, 04:32:51 PM
Quote from: deskjockey on January 30, 2014, 03:13:52 PM
Will having Obi registered with GV conflict with SS registering?
I think it will not conflict.  SS does not register with GV in the same way that a SIP client registers with a SIP server.  SS only communicates with GV when you place a call.  It emulates the GV method of making a call via your GV web page, inputting the number you wish to call and indicating the callback number.

But why not try it for yourself and report back here with the result?

I haven't had an issue using Obi and Sipsorcery together.  I've had a Sipsorcery account since before Obi existed.  Multiple XMPP connections can cause devices conflicts but Sipsorcery uses http/sip instead of XMPP.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: deskjockey on February 01, 2014, 10:51:38 AM
OK, the answer is that there is a conflict having OBI and SS running GV at the same time. GV blocks SS (the newest IP address) and sends a message that somebody is hacking the account. I think there is a way for GV to permit a second IP address using the credentials so I'll look into it.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: drgeoff on February 01, 2014, 03:06:05 PM
From https://www.sipsorcery.com/mainsite/Help/DialPlans#GoogleVoice

"When placing a Google Voice call if an error is received stating "Could not find _rnr_se key on your Google Voice account page, callback cannot proceed" then Google Voice is rejecting the call based on the SIP Sorcery server's IP address. Google allows the IP addresses that can access an account to be reset by visiting this link https://accounts.google.com/DisplayUnlockCaptcha and following the instructions."

Perhaps this is relevant.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: deskjockey on February 01, 2014, 03:50:54 PM
Thank you very much for that info. Might never have figured it out actually and it is relevant. However, I ran the SS consol yesterday and noticed that message killing the connection. So I found a SS thread advising your solution. However, I went to GV to send a text and they had a big red banner across the top of my page about somebody hacking my account. They listed all the attempts with location and asked me to approve them or change my password. I approved knowing it the location of my IPComms did I'm using with SS. They then said they will continue posting attempts on my account for two weeks.

So now I have to see if GV is letting SS through. That may be tomorrow though. You guys are great and a brilliant thought by you to suspect that.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: deskjockey on February 07, 2014, 06:35:17 AM
Update: My clicking the red banner and approving the hacker (SS with my IPComms #), is letting my OBI GV & SS GV both work. After IPComms fixed my account I was able to go online and get my forward to SS to take. My old SS Teilis '10 dial plan is working so now I have cnam again.
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: tyeske on February 26, 2014, 01:26:09 PM
I have ipkall & SS. It had been working well, but CNAM seems to be broken again. I use whitepages for CNAM. I see others are currently having trouble with CNAM too.

I'm not worried about incoming calls, as they are routed through SS to my OBI202. Currently my OBI202 routes calls directly to GV. I have tried to set up my OBI to route calls through SS, but I can't seem to get my dialplan to work properly.

Can anyone help me with the proper script to make outgoing calls work?
Title: Re: Sipsorcery for no XMPP calling with Google Voice
Post by: azrobert on February 26, 2014, 03:22:31 PM
Quote from: tyeske on February 26, 2014, 01:26:09 PM
I have ipkall & SS. It had been working well, but CNAM seems to be broken again. I use whitepages for CNAM. I see others are currently having trouble with CNAM too.

I'm not worried about incoming calls, as they are routed through SS to my OBI202. Currently my OBI202 routes calls directly to GV. I have tried to set up my OBI to route calls through SS, but I can't seem to get my dialplan to work properly.

Can anyone help me with the proper script to make outgoing calls work?

See my reply to your other post here:
http://www.obitalk.com/forum/index.php?topic=7272.0