Solved

conneting two asterisk servers encountering problem

Posted on 2009-04-01
5
505 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

How To Create Custom / Distinctive Ring Tones on Polycom Phones Purpose and Overview When creating a custom ring tone, you have simple aspirations: to make your phone cooler than everyone else's. Perhaps you need a louder ringer. Perhaps you w…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now