Solved

conneting two asterisk servers encountering problem

Posted on 2009-04-01
5
520 Views
Last Modified: 2012-05-06
I'm new to Asterisk and SIP/VOIP in general. What I am trying to accomplish, is to have one main office using Asterisk and local SIP telephones (Polycom) connect to a SIP provider for outbound calls. We have another office located in another city with Polycom phones, so I'm trying to create a second server there, connect it to the main server, and use the main server for outbound calls to the provider.

I have the main server successfully connected to the provider and I can send/receive calls.

I have the secondary server connected to the main server and I can see that it is successfully registering. I'm using SIP instead of IAX to connect the two * servers.

I'm trying to use a phone at the secondary office to call an extension at the main office. The call doesn't seem to be getting routed correctly. Running asterisk on the secondary server with -vvv shows congestion errors (on the sending * server) when I try and connect to an extension on the other side.

I think this is a syntax issue on my part because I'm not fully understanding the documentation I'm reading. My config is posted and detailed below.

As far as network topology, both * servers are behind standard consumer routers that have a single public IP and using NAT. I'm using port forwarding to forward SIP and the entire range of RTP ports to the * server on both sides.
##########################################
# Main Office Asterisk Server (name "radar")
# ========================================
# Connects to VOIP Provider for outbound calls
# Accepts connections from local SIP phones
# Accepts SIP peer connections from satellite asterisk server
# Sits behind a standard consumer router with NAT using port forwarding
###########################################
 
sip.conf:
-------------------------------
[general]
localnet=192.168.0.0/255.255.0.0
externip=xxx.xxx.xxx.xxx
register => <user>:<pass>@sip.inphonex.com
register => <user>:<pass>@sip.inphonex.com
register => <user>:<pass>@<asterisk2 server>/gladiator
 
 
[gladiator]
type=friend
secret=xxxxx
context=gladiator_incoming
host=dynamic
disallow=all
allow=ulaw
nat=yes
 
[102]
type=friend
host=dynamic
secret=polycom
context=bob
 
 
[inphonex]
username=<user>
type=peer
secret=<pass>
host=sip.inphonex.com
fromuser=<user>
fromdomain=sip.inphonex.com
context=from-inphonex
canreinvite=no
 
[inphonex2]
username=<user>
type=peer
secret=<pass>
host=sip.inphonex.com
fromuser=<user>
fromdomain=sip.inphonex.com
 
 
extensions.conf:
--------------------------------
[general]
static=yes
writeprotect=no
clearglobalvars=no
 
[globals]
 
 
[gladiator_incoming]
exten => 102,1,Dial(SIP/102)
exten => _NXXXXXX.,1,Dial(SIP/${EXTEN}@inphonex,30,Tt)
exten => _NXXXXXX.,n,Congestion()
exten => _NXXXXXX.,n,Hangup()
exten => _NXXNXXXXXX.,1,Dial(SIP/${EXTEN}@inphonex,30,Tt)
exten => _NXXNXXXXXX.,n,Congestion()
exten => _NXXNXXXXXX.,n,Hangup()
exten => _1NXXNXXXXXX.,1,Dial(SIP/${EXTEN}@inphonex,30,Tt)
exten => _1NXXNXXXXXX.,n,Congestion()
exten => _1NXXNXXXXXX.,n,Hangup()
 
 
[tom]
exten => 101,1,Dial(SIP/101)
exten => 600,1,Answer()
exten => 600,2,Playback(demo-echotest) ; Let them know what
exten => 600,3,Echo()                  ; Do the echo test
exten => 600,4,Playback(demo-echodone) ; Let them know it
exten => 600,5,Hangup()
exten => _NXXXXXX.,1,Dial(SIP/${EXTEN}@inphonex,30,Tt)
exten => _NXXXXXX.,n,Congestion()
exten => _NXXXXXX.,n,Hangup()
exten => _NXXNXXXXXX.,1,Dial(SIP/${EXTEN}@inphonex,30,Tt)
exten => _NXXNXXXXXX.,n,Congestion()
exten => _NXXNXXXXXX.,n,Hangup()
exten => _1NXXNXXXXXX.,1,Dial(SIP/${EXTEN}@inphonex,30,Tt)
exten => _1NXXNXXXXXX.,n,Congestion()
exten => _1NXXNXXXXXX.,n,Hangup()
 
[bob]
exten => 102,1,Dial(SIP/102)
exten => 600,1,Answer()
exten => 600,2,Playback(demo-echotest) ; Let them know what
exten => 600,3,Echo()                  ; Do the echo test
exten => 600,4,Playback(demo-echodone) ; Let them know it
exten => 600,5,Hangup()
exten => _NXXXXXX.,1,Dial(SIP/${EXTEN}@inphonex2,30,Tt)
exten => _NXXXXXX.,n,Congestion()
exten => _NXXXXXX.,n,Hangup()
exten => _NXXNXXXXXX.,1,Dial(SIP/${EXTEN}@inphonex2,30,Tt)
exten => _NXXNXXXXXX.,n,Congestion()
exten => _NXXNXXXXXX.,n,Hangup()
exten => _1NXXNXXXXXX.,1,Dial(SIP/${EXTEN}@inphonex2,30,Tt)
exten => _1NXXNXXXXXX.,n,Congestion()
exten => _1NXXNXXXXXX.,n,Hangup()
 
 
 
##########################################
# Secondary Office Asterisk Server (name "gladiator")
# ========================================
# Connects to main office asterisk server for extensions and outbout calls to provider
# Accepts connections from local SIP phones
# Sits behind a standard consumer router with NAT using port forwarding
###########################################
 
sip.conf:
-----------------------------
 
[general]
register => <user>:<pass>@98.175.96.233/radar
externip=98.163.74.196
 
[radar]
type=friend
secret=welcome
context=radar_incoming
host=dynamic
disallow=all
allow=ulaw
nat=yes
 
[101]
type=friend
context=tom
host=dynamic
secret=polycom
 
 
 
extensions.conf:
--------------------------
 
[globals]
 
[general]
autofallthrough=yes
 
 
 
[radar_incoming]
exten => 102,1,NoOp()
exten => 102,n,Dial(SIP/radar/${EXTEN})
exten => 102,n,Hangup()
 
 
[tom]
exten => 102,1,NoOp()
exten => 102,n,Dial(SIP/radar/${EXTEN})
exten => 102,n,Hangup()
 
exten => _NXXXXXX.,1,Dial(SIP/radar/${EXTEN})
exten => _NXXXXXX.,n,Congestion()
exten => _NXXXXXX.,n,Hangup()
 
exten => _NXXNXXXXXX.,1,Dial(SIP/radar/${EXTEN})
exten => _NXXNXXXXXX.,n,Congestion()
exten => _NXXNXXXXXX.,n,Hangup()
 
exten => _1NXXNXXXXXX.,1,Dial(SIP/radar/${EXTEN})
exten => _1NXXNXXXXXX.,n,Congestion()
exten => _1NXXNXXXXXX.,n,Hangup()

Open in new window

0
Comment
Question by:node_runner
5 Comments
 
LVL 32

Expert Comment

by:Kamran Arshad
ID: 24058222
Hi,

Could you please paste the console errors when your run your asterisk in debugging mode?
0
 
LVL 7

Assisted Solution

by:koszegi
koszegi earned 500 total points
ID: 24435673
Why don't you create a vpn between the 2 sites and let the asterisk server connect over that vpn.  Creating a VPN add another layer of complexity to the mix, but it provides so much benefit in the long run.  The VPN will allow smooth extension to extension calling between the sites.

Once you have the VPN connection up you can connect the asterisk boxes using sip or iax. Then you can set you dial plan in the secondary Asterisk server to connect to PSTN by using the connection on the first Asterisk server.
0
 
LVL 7

Accepted Solution

by:
koszegi earned 500 total points
ID: 24445954
In your extension.conf file you have the context specifying the local dial-plan for everyone.  This is very redundant and when you need to make changes to your outbound dial-plan you will have a hard time to manage it.  What you need to do is modify the extension.conf on radar and gladiator to point to the appropriate local to terminate calls.

Example you should have a context call something like outbound or pstn and include that context in the context tom and bob etc. Actually you really should have a context call internal_ext and place tom and bob in them.  

You are on the right track to understanding context. Read this link it will enlighted you.
Create an account to http://www.voip-info.org it is free and you will not regret it.  That place have everything about voip.  I was turn on to that site about 6 years ago when I stated using asterisk.  That is the wiki site that Digium (the maker of Asterisk) recommend on their asterisk.org site.

Asterisk Dialplan Introduction
http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Introduction

Asterisk config extensions.conf
http://www.voip-info.org/tiki-index.php?page=Asterisk%20config%20extensions.conf

You may want to read up on sip channel a little bit to get a fuller picture.

Asterisk SIP channels
http://www.voip-info.org/tiki-index.php?page=Asterisk%20SIP%20Channels

Enjoy your journey on becoming an asterisk guru.  We are here to help.


 
0
 

Author Comment

by:node_runner
ID: 24839739
We ended up not using Asterisk and ditching the project. We needed something fairly quickly, and we just ended up having too many technical problems getting things to work reliably. Thanks for your help to everyone who commented.
0
 

Expert Comment

by:zedpoint
ID: 37820093
i like the expert comment .. can u pls guide me step by step how  my outisde carrier bypass thier traffic through my linux server which is attached gsm gateway*voip devices)
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you think no one can listen in on your VOIP conversations, eh? Well... if you haven't setup Secure Real Time Transport (SRTP), your voice communications can be hacked into by just about anyone! First, let's talk about the intended audience for…
I recently purchased a Bluetooth headset called the Music Jogger (model BSH10). The control buttons on it look like this: One of my goals is to use it as the microphone and speakers for Skype calls. In that respect, it works well. However, I …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question