Help with Dialplan

Getting started with the SIP Sorcery
Post Reply
DaveSin
Posts: 20
Joined: Wed Sep 23, 2009 12:59 pm

Help with Dialplan

Post by DaveSin » Thu Nov 04, 2010 4:32 pm

I used to have my Sipsorcery account operational many months ago and decided to stop using it for a while. I forgot what my username and password and was able to retrieve the login information via Aaron. The problem now is, I trying to get this going so that I can place outgoing calls via GV and receive incoming calls from my GV number. I have the setup for using the a Sipgate number. I also have a Gizmo5 and IPKall numbers available to me.

I follow the procedure located here for Sipgate, but I'm having no success reciving incoming or making outgoing calls. I'm using the complex dialing plan and made the appropriate changes for:

GV_USER = "yyyyyy@gmail.com" # my GV e-mail address (user@gmail.com)
GV_PASS = "99884FasdF" # my GV password
SG_NUMBER = "415639xxxx" # my 10-digit Sipgate number (not always 415)
G5_NUMBER = "747474xxxx" # my 10-digit Gizmo5 number (always 747)

Should I omit the quotes (") when I enter the information above?

In my SPA-3102 ATA, I have the sipsorcery credentials and it shows up registered on the ATA and under the Sipsocery "Sip Bindings" [Sip Account Tab].

Also, under Sip Providers, it shows my account as registered with Sipgate and under my Sipgate account, also shows registered.

When I try to make an outgoing call, all I get is a fast busy tone. When I place a call to my GV number from a cell phone I end up the voicemail box of my sipgate number. Calling my Sipgate number gets the same voicemail message! Any help is figuring out what the problem might be? Thx.

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: Help with Dialplan

Post by MikeTelis » Thu Nov 04, 2010 5:52 pm

It might be a syntax error in your dialplan, for example. When you face with a problem like this, the Console is your best friend. Login to SS website, go to the Console and click on "Connect". Once connected, try placing and/or receiving a call and check what happens.

BTW, the strings must be enclosed in single or double quotes (' or ").

DaveSin
Posts: 20
Joined: Wed Sep 23, 2009 12:59 pm

Re: Help with Dialplan

Post by DaveSin » Thu Nov 04, 2010 8:48 pm

MikeTelis wrote:It might be a syntax error in your dialplan, for example. When you face with a problem like this, the Console is your best friend. Login to SS website, go to the Console and click on "Connect". Once connected, try placing and/or receiving a call and check what happens.

BTW, the strings must be enclosed in single or double quotes (' or ").
Thanks Mike for your Response. After some changes, I am now able to receive incoming calls to my GV number. I'm still unable to place outgoing calls and following Mike's suggestion, the following information is what is being displayed in the console at the time the call failed and I'm getting the fast busy tone:


Monitor 19:48:54:514: basetype=console, ipaddress=*, user=11_Digit_Sipsorcery_Username, event=*, request=*, serveripaddress=*, server=*, regex=.*.
NATKeepAlive 19:48:56:889 sip1(196348): Requesting NAT keep-alive from proxy socket udp:69.59.142.213:5060 to udp:xx.xxx.xxx.47:5062.
DialPlan 19:49:13:092 sip1(184544): New call from udp: xx.xxx.xxx.47:5062 successfully authenticated by digest.
DialPlan 19:49:13:123 sip1(184544): Using dialplan default for Out call to sip:OUTGOING _Number_Dialed@sip.sipsorcery.com.
NewCall 19:49:13:139 sip1(184544): Executing script dial plan for call to OUTGOING _Number_Dialed.
DialPlan 19:49:13:186 sip1(184544): There was a syntax error in your dial plan on line 292, please check.
DialPlan 19:49:13:186 sip1(184544): Dialplan cleanup for 11_Digit_Sipsorcery_Username (also the GV Number)
DialPlan 19:49:13:311 sip1(184544): Dial plan execution completed without answering and had an execution error message of Dial plan syntax error.
DialPlan 19:49:13:311 sip1(184544): UAS call failed with a response status of 500 and Dial plan syntax error.

SIP Port = 5062 [set on the ATA (SPA_3102)]

I would welcome any further suggestions as what is causing the problem? Additionally, I'm not sure what is the purpose of the G5 number in the "Complex" dialing plan? How should it be setup in Gizmo5, if necessary? Thanks

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: Help with Dialplan

Post by Aaron » Thu Nov 04, 2010 9:59 pm

Code: Select all

DialPlan 19:49:13:186 sip1(184544): There was a syntax error in your dial plan on line 292, please check.
I'd recommend copying your dialplan into an editor like Notepad++ and pasting the 5 lines above and below line number 292.

DaveSin
Posts: 20
Joined: Wed Sep 23, 2009 12:59 pm

Re: Help with Dialplan

Post by DaveSin » Fri Nov 05, 2010 1:31 am

Aaron wrote:

Code: Select all

DialPlan 19:49:13:186 sip1(184544): There was a syntax error in your dial plan on line 292, please check.
I'd recommend copying your dialplan into an editor like Notepad++ and pasting the 5 lines above and below line number 292.

Code: Select all

286 end
287   sys.Respond(@code,@reason) # Forward error code to ATA
288 rescue
289    # Gives a lot more details at what went wrong (borrowed from Myatus' dialplan)
290    sys.Log("** Error: " + $!) unless $!.to_s =~ /Thread was being aborted./
291 end
292 rescue
293  sys.Log("** Error: " + $!) unless $!.to_s =~ /Thread was being aborted./
294 end
The six lines above line 292 and the 2 lines below 292. Line 294 is the end of the dial plan. Again, I copied the Dial Plan from one of the how-to

http://google-voice-sipsorcery-dialplan ... exDialPlan

and makes the mandatory changes only. Thx.

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: Help with Dialplan

Post by MikeTelis » Fri Nov 05, 2010 2:38 am

The most common problem is with line wrapping. You need to click on "View raw file" before you copy dialplan from the Google Code site, or else long lines wrap to the next line causing syntax errors.

DaveSin
Posts: 20
Joined: Wed Sep 23, 2009 12:59 pm

Re: Help with Dialplan

Post by DaveSin » Fri Nov 12, 2010 4:35 pm

MikeTelis wrote:The most common problem is with line wrapping. You need to click on "View raw file" before you copy dialplan from the Google Code site, or else long lines wrap to the next line causing syntax errors.
O.K, I copied the Complex Dialplan (view Raw File) and made a couple of minor changes, i.e.

Code: Select all

GV_USER = "username@gmail.com"       # my GV e-mail address (user@gmail.com)
GV_PASS = "GV password"                  # my GV password
SG_NUMBER = "415xxxyyyy"             # my 10-digit Sipgate number (not always 415)
G5_NUMBER = "747xxxyyyy"             # my 10-digit Gizmo5 number (always 747)
I have both a Sipgate and a Gizmo5 number. Do I need to add both numbers to the dialplan? When I do and made the changes. I get a fast busy when I make an outbound call. Specifically, what changes do I need to make to the Complex dialplan to get it to work? When I use the very simple diaplan below (for Sipgate Number), I'm able to make outgoing calls without any issues:

Code: Select all

sys.Log("starting dialplan...")
sys.GoogleVoiceCall("username@gmail.com", "GV password", "1415xxxxxx", "#{req.URI.user}", ".*", 1)
sys.Log("Sorry, Google Voice Call failed.")

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: Help with Dialplan

Post by MikeTelis » Fri Nov 12, 2010 7:53 pm

You're using a very old version of dialplan. It was a feeble attempt to get it to work with two numbers; the changes made to my original code are quite amateur. In fact, it should have been taken out long ago but...

Here is what you do:

1. Open this SVN directory and copy dialplan from there.

2. Change username and password. Use either Gizmo or Sipgate number as your CB_NUMBER.

It should start working right away. Now, if you want the plan to use your other number as backup, change:

CB_NUMBER = [ '1747xxxxxxx', '1415yyyyyyy' ]

That is, put both numbers in the array. The dialplan will try first number and switch to the other if it fails (no callback).

DaveSin
Posts: 20
Joined: Wed Sep 23, 2009 12:59 pm

Re: Help with Dialplan

Post by DaveSin » Sun Nov 14, 2010 5:15 pm

MikeTelis wrote:You're using a very old version of dialplan. It was a feeble attempt to get it to work with two numbers; the changes made to my original code are quite amateur. In fact, it should have been taken out long ago but...

Here is what you do:

1. Open this SVN directory and copy dialplan from there.

2. Change username and password. Use either Gizmo or Sipgate number as your CB_NUMBER.

It should start working right away. Now, if you want the plan to use your other number as backup, change:

CB_NUMBER = [ '1747xxxxxxx', '1415yyyyyyy' ]

That is, put both numbers in the array. The dialplan will try first number and switch to the other if it fails (no callback).
Thanks Mike...that did work!!!

stav
Posts: 36
Joined: Fri Aug 14, 2009 4:20 pm

Re: Help with Dialplan

Post by stav » Fri Dec 03, 2010 12:35 am

I did exactly what Mike suggested but still deosnt work. Here is what I want to do and here is where I'm stuck:
I want to use GV number for out and in calls and I want people to call me to my GV number and have my phone connected in Line 1 (Sipsorcery) of the ATA to ring. Now, SS seems OK, I'm registered with sipgate and it appears in the bindings. I can dial out and it works great, showing my GV number. But, when I try to call my GV number from another phone not defined in my GV account settings, it rings 4 times and it goes to the GV voice mail. I should add that my Sipgate number is verified and checked in GV account.
I copied the dial plan as per Mike's recommendations in this thread and did (at least I believe so) all necessary changes and editing. Can someone have a look at it and tell me what's wrong with the syntax or anything else?
Thx,
Stavros
Dial Plan
REA_CODE = '561' # my area code
GV_USER = 'username@gmail.com' # my GV e-mail address (user@gmail.com)
GV_PASS = 'GV password' # my GV password
CB_NUMBER = '1aaaxxxyyyy' # my 11-digit sipgate number
TIME_OUT = 15 # callback time-out (in seconds)

# Uncomment 3 lines below and insert your primary GV phone number, your secondary
# GV account name and password, respectively. The second account will be used to call
# your primary GV number so that you could check voicemail from your ATA
# Note that your 2nd account must be configured with the same callback number(s) as primary

GV_NUMBER = '1561.......' # My primary GV number
VM_USER = 'username@gmail.com' # my secondary GV e-mail address (user@gmail.com)
VM_PASS = 'GV password' # my secondary GV password

SPEED_DIAL = { # my speed dial numbers
'1' => '19879879876', # Mom
'123' => '12345678901', # Work
'45' => '17479876543', # Gizmo BFF
'411' => '8004664411', # Google 411
'266' => '4153767253@podlinez.net', # CNN Headlines
}

# CNAM table: number in ENUM format => caller's name

CNAM = {
'12125551212' => 'Dear mom',
'12153332211' => 'Bratty kid',
}

# Uncomment next line and insert your White Pages API key, if you have it
# WP_key = 'Your_White_Pages_API_key_here' # White Pages API key

begin
sys.Log "** Call from #{req.Header.From} to #{req.URI.User} **"
sys.ExtendScriptTimeout(15) # preventing long running dialscript time-out

if sys.Out # if outbound call
num = req.URI.User.to_s # Get a string copy of the number to dial

num = SPEED_DIAL[num] || num # Substitute with speed dial entry, if any

case num
when /@/ then sys.Dial num # URI dialing
when /^[2-9]\d{6}$/ # Local call, 7-digit number
num = '1'+ AREA_CODE + num # prefix it with country and area code
when /^[01]?([2-9]\d{9})/ # US number with or without country code
num = '1' + $1 # add country code and truncate number to 10-digit
when /^(011|00|\+)(\d{9,})/ # international number
num = '+' + $2 # GoogleVoiceCall works with '+' prefix only
else sys.Respond 603, 'Wrong number, check & dial again'
end

user, pass = GV_USER, GV_PASS # assume it's not VM call
user, pass = VM_USER, VM_PASS if defined?(GV_NUMBER) && num == GV_NUMBER

Post Reply