Trunk registration error 'Got SIP response 489 "Bad event

hi
i have configured sip trunk with our asterisk server. it was registered and working fine and i was able to send and receive calls until yesterday, but today when I tried to start asterisk on my PC, strange behavior is seen. it shows reachable and registered status on my asterisk client but on asterisk server it does not show any thing with command ‘sip show registry’ and calls are not being routed to my asterisk client.

on asterisk server i see this error on cli

Got SIP response 489 “Bad event” back from 115.101.10.27(asterisk client’s router ip)

I see contact field in sip register message is wrong. (sip:s@192.168.0.20)
what parameters should i use that will change contact header field to valid address?

see the trace and config below

REGISTER sip:my.ast-server.com:5678 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.20:5060;branch=z9hG4bK6f76c341;rport
From: sip:abc@my.ast-server.com;tag=as23f4bafa
To: sip:abc@my.ast-server.com
Call-ID: 129974637fd74fdf561b1fd8402c9da9@192.168.0.20
CSeq: 104 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Authorization: Digest username=“abc”, realm=“asterisk”, algorithm=MD5, uri=“sip:my.ast-server.com:5678”, nonce=“63c5e348”, response=“282d7bb441a5c0170628aa529a77ef0d”, opaque=""
Expires: 120
Contact: sip:s@192.168.0.20
Event: registration
Content-Length: 0

here is my register statement and trunk config.

register => abc:secret@my.ast-server.com:5678

[abc]
type=peer
username=abc
authname=abc
secret=secret
port=5678
host=my.ast-server.com
context=default
dtmfmode=rfc2833
canreinvite=yes
insecure=port,invite
disallow=all
allow=ulaw
allow=alaw
allow=g729
allow=gsm
nat=yes
qualify=yes

kindly help. also plz give me address of some good documentation regarding sip header manipulation via sip conf parameters.

thanks

Nasir Javaid

You probably have a problem with your NAT settings in the general section of sip.conf.

I solved the problem, just changed the register string and added “/abc” at the end which changed contact header to

contact:abc@192.168.0.20.

i can now receive calls on this trunk. and “sip show registry” on my asterisk client shows abc registered:

Host Username Refresh State Reg.Time
my.ast-server.com:5678 abc 105 Registered Mon, 23 Aug 2010 17:09:11

but on asterisk server “sip show registry” show emtpy.

Host Username Refresh State Reg.Time

why it does not show registered on server?

here is my general section of sip.conf

[general]
context=default ; Default context for incoming calls
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no ; Enable server for incoming TCP connections (default is no)
bindport=5060
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
nat=no
careinvite=yes