my setup
request_route {
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if(is_method("OPTIONS")) {
# send reply for each options request
sl_send_reply("200", "ok");
exit();
}
if(method=="BYE") {
#Account BYE transactions
};
if (method=="CANCEL") {
if (t_check_trans()) t_relay();
exit;
};
if (loose_route()) {
t_relay();
exit;
}
if (is_method("INVITE")) {
record_route();
}
f (!t_relay_to_udp("3.1.1.1", "5060")) {
sl_reply_error();
exit;
};
exit
};
here is a trace to a call made to a hotel.
i had changed the real ips for obvious reasons.
thanks.
asterisk ip 1.1.1.1
kamailio internal 1.1.1.2
kamailio external 2.0.0.1
Voip Carrier 3.1.1.1
voip contact ip 3.1.1.2
Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bKcydzigwkX.
Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK280c4e9c;rport=5060.
Route: <sip:2.0.0.1;lr=on;ftag=as4bc322e9>,<sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05>.
Max-Forwards: 16.
CSeq: 102 ACK.
User-Agent: Asterisk PBX 1.8.15-cert2.
Content-Length: 0.
.
Max-Forwards: 69.
Route: <sip:2.0.0.1;lr=on;ftag=as4bc322e9>.
CSeq: 2 BYE.
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE.
Via: SIP/2.0/UDP 3.1.1.1:5060;branch=z9hG4bKce8a.db93afa3.0.
Via: SIP/2.0/UDP 3.1.1.2:5060;branch=z9hG4bK96003ecbb11f5deaf6014235140e6952.
Content-Length: 0.
Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bKcydzigwkX.
Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK280c4e9c;rport=5060.
Route: <sip:2.0.0.1;lr=on;ftag=as4bc322e9>,<sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05>.
Max-Forwards: 16.
CSeq: 102 ACK.
User-Agent: Asterisk PBX 1.8.15-cert2.
Content-Length: 0.
.
Max-Forwards: 69.
Route: <sip:2.0.0.1;lr=on;ftag=as4bc322e9>.
CSeq: 2 BYE.
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE.
Via: SIP/2.0/UDP 3.1.1.1:5060;branch=z9hG4bKce8a.db93afa3.0.
Via: SIP/2.0/UDP 3.1.1.2:5060;branch=z9hG4bK96003ecbb11f5deaf6014235140e6952.
Content-Length: 0.