Getting SIP channels to work in 1.2.7.1

I’ve had a heck of a time getting a SIP channel to work in Asterisk
1.2.7.1 (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 sip.unlimitel.ca (althogh I cannot explain why it would
always start working after a reload) so I ended replacing the
hostname sip.unlimitel.ca with the actual IP address (64.26.157.251).
Not pretty but at least I can call out now. BTW adding:

sip.unlimitel.ca 64.26.157.251

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:

[incoming]
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,
H

; -----------------------------------------------------------
; /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.
;
;********************************************************************
[general]
;
context=incoming-bogus-calls
bindport=5060 ; Port to bind to (SIP is 5060)
bindaddr=0.0.0.0 ; Address to bind to (all addresses on machine)
maxexpirey=3600 ; Must be larger than the re-register timeout on the router
defaultexpirey=3600
notifymimetype=text/plain
rtptimeout=60
rtpholdtimeout=300
disallow=all
allow=ulaw
;
; This section is because i’m behind nat
;
;register=>6477235412:@sip.unlimitel.ca/6477235412
register=>6477235412:@64.26.157.251/6477235412
externip= ;Outside address
localnet=192.168.0.148/255.255.255.0 ;Inside Network
;
;********************************************************************
[6477235412]
type=peer
;auth=md5
username=6477235412
fromuser=6477235412
fromdomain=unlimitel.ca
secret=
;host=sip.unlimitel.ca
host=64.26.157.251
port=5060
nat=yes
canreinvite=no
qualify=no
disallow=all
allow=g729
dtmfmode=rfc2833
insecure=very
context=incoming

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.