Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

conneting two asterisk servers encountering problem

Posted on 2009-04-01
5
Medium Priority
?
525 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1500 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 1500 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Almost all Internet protocol telephones have built-in switches at the back that allow you to connect your personal computer to one port and use the other port to connect your phone to to a Cisco switch.   Why we need to connect the PC to the pho…
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

596 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