[Asterisk-Users] Problem setting SIP incoming/outgoing

Rich Adamson radamson at routers.com
Mon Oct 10 05:26:10 MST 2005


> I am a newbie to * and I am having a problem which appears strange as I did
> not find any mention of it anywhere in my search.
> 
> Simply speaking, I have an external SIP proxy server which I am trying to
> configure for incoming and outgoing calls from my asterisk installation. So
> here is my configuration in sip.conf
> 
> [general]
> register => user:secret:user at sipserver.com:8080
> 
> as long as I have just the above entry, I am able to receive incoming calls.
> Now I would like to setup outgoing calls too. So I create a new section in
> sip.conf
> 
> [sipserverout]
> type=peer
> secret=secret
> username=user
> fromuser=user
> fromdomain=sipserver.com
> host=sipserver.com
> port=8080
> context=default
> 
> with the above configuration I can successfully dial out using
> dial(SIP/{$EXTEN}@sipserverout)
> 
> but now when I call my incoming number, I get a busy or invalid number
> signal. If I coment out sipserverout section, I could receive incoming calls
> again.
> 
> So I turned on sip debug on CLI. and it appears to me that the following is
> happening. astreisk takes the incoming call and tries to match it with a
> section with the same hostname. Now the reverse IP lookup on 109.147.41.48
> return sipserver.com (which is correct), so it is trying to send the call to
> sipserverout which is essentially back to the same server where it came from
> (Notice the statement "Found peer 'sipserverout'" in the sip debug logs
> below). This creates an endless loop and the equipment at the other end
> terminates the call.
> 
> According to all the examples I have seen, my setup is the correct setup and
> everyone seems to be using it. but it does not work for me. I am deperately
> looking for a solution. Please help.
> 
> I am using asterisk 1.2.0 beta 1 on FC1.

In very general terms, you probably want something like this in your sip.conf:
 [sipserver]
 type=friend
 secret=secret
 username=user
 fromuser=user
 fromdomain=sipserver.com
 host=sipserver.com
 port=8080
 insecure=very
 canreinvite=no
 dtmfmode=inband
 context=from-sipserver
 disallow=all                      
 allow=ulaw

For sip stuff, notice the use of type=friend and canreinvite=no. The use
of the register statement (in this case) implies use of type=friend (for
both incoming and outgoing calls).

Then in extensions.conf, use something like this:
 exten => _1NXXXXXXXXX,3,Dial(SIP/sipserver/${EXTEN})
where SIP/sipserver is referring to the context [sipserver] in sip.conf.

Did the folks at sipserver.com tell you to use port=8080?  If not, 
remove that statement as the default for sip is port=5060.

There are other ways to accomplish the same thing, so consider the above
as only way to do it.





More information about the asterisk-users mailing list