Getting SIP channels to work in

I’ve had a heck of a time getting a SIP channel to work in Asterisk (Redhat 9.0). I’ve done it successfully a number of times on
pre 1.2 versions of Asterisk so perhaps it’s version related. Any
insights are welcome!

At first I wasn’t able to dial out on the SIP channel whenever I
started Asterisk (i.e. not just when the box was booted). I always
had to do a reload from the CLI before it would work. Using Ethereal
I noticed that there seemed to be some trouble resolving my ITSP’s
hostname (althogh I cannot explain why it would
always start working after a reload) so I ended replacing the
hostname with the actual IP address (
Not pretty but at least I can call out now. BTW adding:

to hosts didn’t help.

I’d be grateful for any insights on this and whether there’s a more
elegant sol’n.

Anyway I was able to call out on that SIP channel but I couldn’t
receive calls on it. I captured a SIP debug trace and noticed
something about the SIP number not being in the context. The context
associated w/ the SIP channel looked like this:

exten => s,1,NoOp(${CONTEXT})
exten => s,n,Ringing()
exten => s,n,GoTo(attendant-MainMenu,s,1)
exten => s,n,Hangup()

I found that I had to add:

exten => _6477235412,1,NoOp(${CONTEXT})
exten => _6477235412,n,Ringing()
exten => _6477235412,n,GoTo(attendant-MainMenu,s,1)
exten => _6477235412,n,Hangup()

I found this odd because I thought s would be sufficient (it has been
in the past). Any comments you can share w/ me on this?

I’ve also noticed this warning message from time-to-time in the CLI:

WARNING[2203]: chan_sip.c:9633 handle_response_register: Got 200 OK on
REGISTER that isn’t a register

Any ideas?

My SIP.conf is below. BTW what’s auth=md5 supposed to do. I can’t
find any documentation on it so I commented it out.

Many Thanks,

; -----------------------------------------------------------
; /etc/asterisk/sip.conf
; Note: If your SIP devices are behind a NAT and your Asterisk
; server isn’t, try adding “nat=1” to each peer definition to
; solve translation problems.
bindport=5060 ; Port to bind to (SIP is 5060)
bindaddr= ; Address to bind to (all addresses on machine)
maxexpirey=3600 ; Must be larger than the re-register timeout on the router
; This section is because i’m behind nat
externip= ;Outside address
localnet= ;Inside Network

You might want to set the type=friend instead of type=peer. I don’t think peer allows a bidirectional call setup.

we have all of our 1.2.4 boxes using type=peer - call-limit won’t function with type=friend, so type=peer is the only option available to us.

everything works great for us here.

I know as I have converted systems to 1.2 that the rules seem to be being enforced a little more and weak dialplan programming had to be fixed.

One of the things I have had to do is to refer to the command references I nthe wiki to make sure I had everything correct. Some of the short hand I was using was no longer supported.

If I understand your question you can place a call with your SIP phone but can’t recieve a call? In your dialplan do you havea route to the SIP/username anywhere, I don’t see this in the information provided.

I am also curious if your DNS is resolving properly since you are having a problem with this.