Many thanks,
Phil
---
## WARNING - DO NOT USE THIS IN A PRODUCTION SERVER. FOR TESTING & EDUCTION ONLY
debug=2
fork=no
log_stderror=yes
listen=192.168.1.254:5060
####### Modules Section ########
mpath="/usr/lib/kamailio/modules/"
loadmodule "pv.so"
loadmodule "sl.so"
loadmodule "usrloc"
modparam("usrloc", "db_mode", 0)
loadmodule "xlog.so"
loadmodule "registrar.so"
####### Routing Logic ########
route{
if(method=="REGISTER") {
if (!save("location")) {
xlog("L_ERR", "**REGISTER: save failed \n");
sl_reply_error();
} else {
xlog("L_NOTICE", " REGISTER rcvd $si:$sp \n");
};
};
if(method=="INVITE") {
lookup("location");
switch ($retcode) {
case -1:
case -3:
sl_send_reply("404", "Not Found");
exit;
case -2:
sl_send_reply("405", "Not Found");
exit;
};
sl_send_reply("302","Redirect");
};
if(method=="PUBLISH" || method=="SUBSCRIBE"){
xlog("L_INFO","REJECTION. We do not process $rm requests. \n");
route(No);
};
}
route[No] {
sl_send_reply(503, "Service Unavailable");
}
---
U 2014/10/05 16:38:04.925388
192.168.123.16:5060
->
192.168.123.254:5060
INVITE
sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP
SIP/2.0.
Via: SIP/2.0/UDP
192.168.123.16:5060;branch=z9hG4bKaf202530a743a053.
From: "01782478349" <
sip:111@192.168.123.254;user=phone>;tag=905632682e68e9b5.
To:
<sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>.
Contact:
<sip:111@192.168.123.16:5060;transport=udp;user=phone>.
Supported: replaces, timer, 100rel, path.
Session-Expires: 180.
Min-SE: 90.
Call-ID:
358a9652404b14ad@192.168.123.16.
CSeq: 63317 INVITE.
User-Agent: Grandstream BT200 1.1.6.32.
Max-Forwards: 70.
Allow:
INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK.
Content-Type: application/sdp.
Content-Length: 407.
U 2014/10/05 16:38:04.925895
192.168.123.254:5060
->
192.168.123.16:5060
SIP/2.0 302 Redirect.
Via: SIP/2.0/UDP
192.168.123.16:5060;branch=z9hG4bKaf202530a743a053;rport=5060.
From: "01782478349" <
sip:111@192.168.123.254;user=phone>;tag=905632682e68e9b5.
To:
<sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>;tag=71d9875c03b727cbe0217d2db6ac2a49.422e.
Call-ID:
358a9652404b14ad@192.168.123.16.
CSeq: 63317 INVITE.
Contact:
<sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>.
Server: My SIP Server.
Content-Length: 0.U 2014/10/05 16:38:04.954405
192.168.123.16:5060
->
192.168.123.254:5060
ACK
sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP
SIP/2.0.
Via: SIP/2.0/UDP
192.168.123.16:5060;branch=z9hG4bKaf202530a743a053.
From: "01782478349" <
sip:111@192.168.123.254;user=phone>;tag=905632682e68e9b5.
To:
<sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>;tag=71d9875c03b727cbe0217d2db6ac2a49.422e.
Contact:
<sip:111@192.168.123.16:5060;transport=udp;user=phone>.
Supported: path.
Call-ID:
358a9652404b14ad@192.168.123.16.
CSeq: 63317 ACK.
User-Agent: Grandstream BT200 1.1.6.32.
Max-Forwards: 70.
Allow:
INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK.
Content-Length: 0.
.
U 2014/10/05 16:38:04.975398
192.168.123.16:5060
->
192.168.123.254:5060
INVITE
sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP
SIP/2.0.
Via: SIP/2.0/UDP
192.168.123.16:5060;branch=z9hG4bKa55f284fa742ad32.
From: "01782478349" <
sip:111@192.168.123.254;user=phone>;tag=9a25392722276c54.
To:
<sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>.
Contact:
<sip:111@192.168.123.16:5060;transport=udp;user=phone>.
Supported: replaces, timer, 100rel, path.
Session-Expires: 180.
Min-SE: 90.
Call-ID:
f2989990cfa8525c@192.168.123.16.
CSeq: 1445 INVITE.
User-Agent: Grandstream BT200 1.1.6.32.
Max-Forwards: 70.
Allow:
INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK.
Content-Type: application/sdp.
Content-Length: 407.
.
.
. etc...