Hello, 

I am trying to make an incoming PSTN call to and extension connected to Kamailio. I have set up the db_alias module and I have allowed the gateway to bypass the authentication. When I try and make a the call from the PSTN line I keep getting a 489 Bad Event error. Can someone let me know what the problem could be, thank you.


My output is as follows:

U 2013/07/14 21:15:59.265174 10.243.63.204:5060 -> 64.136.xxx.xxx:5060
SIP/2.0 403 Not (AJ Test 01) Allowed.
Via: SIP/2.0/UDP 64.136.xxx.xxx:5060;branch=z9hG4bK1sansay2538508233rdb3922;rport=5060.
To: <sip:18175000000@54.235.xxx.xxx>;tag=1d3ba323b5484a2f7ffc7e242c7e76f0.8ae5.
From: <sip:18451111111@64.136.xxx.xxx>;tag=sansay2538508233rdb3922.
Call-ID: 1645020719-0-1366935120@64.136.174.227.
CSeq: 1 INVITE.
Server: kamailio (4.0.2 (x86_64/linux)).
Content-Length: 0.
.


U 2013/07/14 21:15:59.283754 64.136.xxx.xxx:5060 -> 10.243.63.204:5060
ACK sip:18175000000@54.235.xxx.xxx:5060 SIP/2.0.
Via: SIP/2.0/UDP 64.136.xxx.xxx:5060;branch=z9hG4bK1sansay2538508233rdb3922.
To: <sip:18175000000@54.235.xxx.xxx>;tag=1d3ba323b5484a2f7ffc7e242c7e76f0.8ae5.
From: <sip:18451111111@64.136.xxx.xxx>;tag=sansay2538508233rdb3922.
Call-ID: 1645020719-0-1366935120@64.136.174.227.
CSeq: 1 ACK.
Max-Forwards: 70.
Content-Length: 0.
.


U 2013/07/14 21:16:00.048701 71.252.xxx.xxx:2980 -> 10.243.63.204:5060
REGISTER sip:54.235.xxx.xxx:5060 SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.15:2980;branch=z9hG4bK-d8754z-711e9d4e46092c03-1---d8754z-;rport.
Max-Forwards: 70.
Contact: <sip:7001@71.252.xxx.xxx:2980;transport=UDP;rinstance=199a2f4e3f3a7a88>.
To: "7001"<sip:7001@54.235.xxx.xxx:5060>.
From: "7001"<sip:7001@54.235.xxx.xxx:5060>;tag=f52da039.
Call-ID: NTBmYTkzMTgwMzJjMzdmZDVjZGYwYjRiZTNiMzc4NWU..
CSeq: 22 REGISTER.
Expires: 60.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE.
Supported: replaces.
User-Agent: 3CXPhone 6.0.26523.0.
Authorization: Digest username="7001",realm="54.235.xxx.xxx",nonce="UeMVLFHjFAAD0acw58oRnXnzj9evbiy7",uri="sip:54.235.xxx.xxx:5060",response="d82639507715230047ee167643f6b197",algorithm=MD5.
Content-Length: 0.
.


U 2013/07/14 21:16:00.050509 10.243.63.204:5060 -> 71.252.xxx.xxx:2980
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/UDP 192.168.1.15:2980;branch=z9hG4bK-d8754z-711e9d4e46092c03-1---d8754z-;rport=2980;received=71.252.xxx.xxx.
To: "7001"<sip:7001@54.235.xxx.xxx:5060>;tag=1d3ba323b5484a2f7ffc7e242c7e76f0.6c72.
From: "7001"<sip:7001@54.235.xxx.xxx:5060>;tag=f52da039.
Call-ID: NTBmYTkzMTgwMzJjMzdmZDVjZGYwYjRiZTNiMzc4NWU..
CSeq: 22 REGISTER.
WWW-Authenticate: Digest realm="54.235.xxx.xxx", nonce="UeMWPFHjFRC963tqi6ZPc7b/Ij7H1Fxr".
Server: kamailio (4.0.2 (x86_64/linux)).
Content-Length: 0.
.


U 2013/07/14 21:16:00.254004 71.252.xxx.xxx:2980 -> 10.243.63.204:5060
REGISTER sip:54.235.xxx.xxx:5060 SIP/2.0.
Via: SIP/2.0/UDP 192.168.1.15:2980;branch=z9hG4bK-d8754z-b0144b07765fd06c-1---d8754z-;rport.
Max-Forwards: 70.
Contact: <sip:7001@71.252.xxx.xxx:2980;transport=UDP;rinstance=199a2f4e3f3a7a88>.
To: "7001"<sip:7001@54.235.xxx.xxx:5060>.
From: "7001"<sip:7001@54.235.xxx.xxx:5060>;tag=f52da039.
Call-ID: NTBmYTkzMTgwMzJjMzdmZDVjZGYwYjRiZTNiMzc4NWU..
CSeq: 23 REGISTER.
Expires: 60.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE.
Supported: replaces.
User-Agent: 3CXPhone 6.0.26523.0.
Authorization: Digest username="7001",realm="54.235.xxx.xxx",nonce="UeMWPFHjFRC963tqi6ZPc7b/Ij7H1Fxr",uri="sip:54.235.xxx.xxx:5060",response="49614e7e64f2548f137f1b5b28358a78",algorithm=MD5.
Content-Length: 0.
.


U 2013/07/14 21:16:00.256117 10.243.63.204:5060 -> 71.252.xxx.xxx:2980
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 192.168.1.15:2980;branch=z9hG4bK-d8754z-b0144b07765fd06c-1---d8754z-;rport=2980;received=71.252.xxx.xxx.
To: "7001"<sip:7001@54.235.xxx.xxx:5060>;tag=1d3ba323b5484a2f7ffc7e242c7e76f0.399e.
From: "7001"<sip:7001@54.235.xxx.xxx:5060>;tag=f52da039.
Call-ID: NTBmYTkzMTgwMzJjMzdmZDVjZGYwYjRiZTNiMzc4NWU..
CSeq: 23 REGISTER.
Contact: <sip:7001@71.252.xxx.xxx:2980;transport=UDP;rinstance=199a2f4e3f3a7a88>;expires=60;received="sip:71.252.xxx.xxx:2980".
Server: kamailio (4.0.2 (x86_64/linux)).
Content-Length: 0.
.


U 2013/07/14 21:16:01.545481 10.243.63.204:5060 -> 71.252.xxx.xxx:2980
....

U 2013/07/14 21:16:04.076753 71.252.xxx.xxx:1026 -> 10.243.63.204:5060
SUBSCRIBE sip:7002@54.235.xxx.xxx:5060 SIP/2.0.
Via: SIP/2.0/UDP 71.252.xxx.xxx:1026;rport;branch=z9hG4bKPjVKERo5fJwcm1TzdDQkKqZMENTBQX.arO.
Max-Forwards: 70.
From: "7002" <sip:7002@54.235.xxx.xxx:5060>;tag=uLM9M.QFu7ACPKMclG7sZLlOj.osdjqy.
To: "7002" <sip:7002@54.235.xxx.xxx:5060>.
Contact: "7002" <sip:7002@71.252.xxx.xxx:1026;ob>.
Call-ID: xwOd60hYc9OPTFfQnxr7ZDZ8YvfCIPCo.
CSeq: 26216 SUBSCRIBE.
Route: <sip:54.235.xxx.xxx;lr>.
Event: message-summary.
Expires: 3600.
Supported: replaces, 100rel, timer, norefersub.
Accept: application/simple-message-summary.
Allow-Events: presence, message-summary, refer.
User-Agent: 3CXPhone for iPhone 1.1.5.
Content-Length:  0.
.


U 2013/07/14 21:16:04.077342 10.243.63.204:5060 -> 71.252.xxx.xxx:1026
SIP/2.0 407 Proxy Authentication Required.
Via: SIP/2.0/UDP 71.252.xxx.xxx:1026;rport=1026;branch=z9hG4bKPjVKERo5fJwcm1TzdDQkKqZMENTBQX.arO.
From: "7002" <sip:7002@54.235.xxx.xxx:5060>;tag=uLM9M.QFu7ACPKMclG7sZLlOj.osdjqy.
To: "7002" <sip:7002@54.235.xxx.xxx:5060>;tag=1d3ba323b5484a2f7ffc7e242c7e76f0.741d.
Call-ID: xwOd60hYc9OPTFfQnxr7ZDZ8YvfCIPCo.
CSeq: 26216 SUBSCRIBE.
Proxy-Authenticate: Digest realm="54.235.xxx.xxx", nonce="UeMWQFHjFRSCCGNpQ0t1SBxoW87faSTq".
Server: kamailio (4.0.2 (x86_64/linux)).
Content-Length: 0.
.


U 2013/07/14 21:16:04.297176 71.252.xxx.xxx:1026 -> 10.243.63.204:5060
SUBSCRIBE sip:7002@54.235.xxx.xxx:5060 SIP/2.0.
Via: SIP/2.0/UDP 71.252.xxx.xxx:1026;rport;branch=z9hG4bKPjoBxiTpnta2kUvH14jnbeYpWhJo5Gj3W1.
Max-Forwards: 70.
From: "7002" <sip:7002@54.235.xxx.xxx:5060>;tag=uLM9M.QFu7ACPKMclG7sZLlOj.osdjqy.
To: "7002" <sip:7002@54.235.xxx.xxx:5060>.
Contact: "7002" <sip:7002@71.252.xxx.xxx:1026;ob>.
Call-ID: xwOd60hYc9OPTFfQnxr7ZDZ8YvfCIPCo.
CSeq: 26217 SUBSCRIBE.
Route: <sip:54.235.xxx.xxx;lr>.
Event: message-summary.
Expires: 3600.
Supported: replaces, 100rel, timer, norefersub.
Accept: application/simple-message-summary.
Allow-Events: presence, message-summary, refer.
User-Agent: 3CXPhone for iPhone 1.1.5.
Proxy-Authorization: Digest username="7002", realm="54.235.xxx.xxx", nonce="UeMWQFHjFRSCCGNpQ0t1SBxoW87faSTq", uri="sip:7002@54.235.xxx.xxx:5060", response="b3106d603e3b6d99b948e4f8c7c82d0c".
Content-Length:  0.
.


U 2013/07/14 21:16:04.298958 10.243.63.204:5060 -> 71.252.xxx.xxx:1026
SUBSCRIBE sip:7002@71.252.xxx.xxx:1026;ob SIP/2.0.
Record-Route: <sip:54.235.xxx.xxx;lr=on>.
Via: SIP/2.0/UDP 54.235.xxx.xxx:5060;branch=z9hG4bKd014.a2424884.0.
Via: SIP/2.0/UDP 71.252.xxx.xxx:1026;rport=1026;branch=z9hG4bKPjoBxiTpnta2kUvH14jnbeYpWhJo5Gj3W1.
Max-Forwards: 16.
From: "7002" <sip:7002@54.235.xxx.xxx:5060>;tag=uLM9M.QFu7ACPKMclG7sZLlOj.osdjqy.
To: "7002" <sip:7002@54.235.xxx.xxx:5060>.
Contact: "7002" <sip:7002@71.252.xxx.xxx:1026;ob>.
Call-ID: xwOd60hYc9OPTFfQnxr7ZDZ8YvfCIPCo.
CSeq: 26217 SUBSCRIBE.
Event: message-summary.
Expires: 3600.
Supported: replaces, 100rel, timer, norefersub.
Accept: application/simple-message-summary.
Allow-Events: presence, message-summary, refer.
User-Agent: 3CXPhone for iPhone 1.1.5.
Content-Length:  0.
.


U 2013/07/14 21:16:04.420794 71.252.xxx.xxx:1026 -> 10.243.63.204:5060
.


U 2013/07/14 21:16:04.428966 71.252.xxx.xxx:1026 -> 10.243.63.204:5060
SIP/2.0 489 Bad Event.
Via: SIP/2.0/UDP 54.235.xxx.xxx:5060;received=54.235.xxx.xxx;branch=z9hG4bKd014.a2424884.0.
Via: SIP/2.0/UDP 71.252.xxx.xxx:1026;rport=1026;branch=z9hG4bKPjoBxiTpnta2kUvH14jnbeYpWhJo5Gj3W1.
Record-Route: <sip:54.235.xxx.xxx;lr>.
Call-ID: xwOd60hYc9OPTFfQnxr7ZDZ8YvfCIPCo.
From: "7002" <sip:7002@54.235.xxx.xxx:5060>;tag=uLM9M.QFu7ACPKMclG7sZLlOj.osdjqy.
To: "7002" <sip:7002@54.235.xxx.xxx:5060>;tag=Xsy75WcGX8u4wF-YDKGUBSx6bFBJSlI0.
CSeq: 26217 SUBSCRIBE.
Content-Length:  0.
.


U 2013/07/14 21:16:04.429376 10.243.63.204:5060 -> 71.252.xxx.xxx:1026
SIP/2.0 489 Bad Event.
Via: SIP/2.0/UDP 71.252.xxx.xxx:1026;rport=1026;branch=z9hG4bKPjoBxiTpnta2kUvH14jnbeYpWhJo5Gj3W1.
Record-Route: <sip:54.235.xxx.xxx;lr>.
Call-ID: xwOd60hYc9OPTFfQnxr7ZDZ8YvfCIPCo.
From: "7002" <sip:7002@54.235.xxx.xxx:5060>;tag=uLM9M.QFu7ACPKMclG7sZLlOj.osdjqy.
To: "7002" <sip:7002@54.235.xxx.xxx:5060>;tag=Xsy75WcGX8u4wF-YDKGUBSx6bFBJSlI0.
CSeq: 26217 SUBSCRIBE.
Content-Length:  0.
.


U 2013/07/14 21:16:07.675337 71.252.xxx.xxx:2980 -> 10.243.63.204:5060
.