<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Scrub question 2 - I think I have started on the stateful proxy... (still need to do ACK, BYE & CANCEL)</div><div><br></div><div>Diagnosis and analysis help still needed</div><div><br></div><div>Thanks</div><div><br>On 5 Oct 2014, at 16:51, "White, Phil" <<a href="mailto:whitepj@manx.biz">whitepj@manx.biz</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div><div><div><div><div><div><div>Hi All,<br><br></div>I've had an 'interesting' weekend reading RFCs and playing with kamailio. I'm making progress - however, I would be grateful for a little clarification.<br><br></div>I have sorted out a very basic stateless redirect proxy (config file below). I have cut it down to the absolute basic minimum - and it mostly appears to do what I would expect it to do. It does allow me to call any registered extension from my SIP softphone.<br><br></div>Problem 1: I have a Grandstream Budgetone 200, which will happily receive calls, but will not initiate any. Looking at a ngrep, it is ignoring the redirect, and sends out a flood of UDP INVITEs (also see below for details)<br></div>Question: Is this the fault of my configuration, or the Grandstream behaving incorrectly?<br><br></div>Problem 2: I am having difficulty in working out which module and command I require to perform a function. Could someone please indicate the INVITE route in this file for a stateful proxy? <br><br></div>Many thanks,<br><br>Phil<br><br>---<br><pre class="">## WARNING - DO NOT USE THIS IN A PRODUCTION SERVER. FOR TESTING & EDUCTION ONLY

debug=2
fork=no
log_stderror=yes

listen=<a href="http://192.168.1.254:5060">192.168.1.254:5060</a>

####### 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");
}</pre><br>---<br><br>U 2014/10/05 16:38:04.925388 <a href="http://192.168.123.16:5060">192.168.123.16:5060</a> -> <a href="http://192.168.123.254:5060">192.168.123.254:5060</a><br>INVITE sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP SIP/2.0.<br>Via: SIP/2.0/UDP 192.168.123.16:5060;branch=z9hG4bKaf202530a743a053.<br>From: "01782478349" <<a href="mailto:sip%3A111@192.168.123.254">sip:111@192.168.123.254</a>;user=phone>;tag=905632682e68e9b5.<br>To: <sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>.<br>Contact: <sip:111@192.168.123.16:5060;transport=udp;user=phone>.<br>Supported: replaces, timer, 100rel, path.<br>Session-Expires: 180.<br>Min-SE: 90.<br>Call-ID: <a href="mailto:358a9652404b14ad@192.168.123.16">358a9652404b14ad@192.168.123.16</a>.<br>CSeq: 63317 INVITE.<br>User-Agent: Grandstream BT200 1.1.6.32.<br>Max-Forwards: 70.<br>Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK.<br>Content-Type: application/sdp.<br>Content-Length: 407.<br></div><...SNIP...><br><div>U 2014/10/05 16:38:04.925895 <a href="http://192.168.123.254:5060">192.168.123.254:5060</a> -> <a href="http://192.168.123.16:5060">192.168.123.16:5060</a><br>SIP/2.0 302 Redirect.<br>Via: SIP/2.0/UDP 192.168.123.16:5060;branch=z9hG4bKaf202530a743a053;rport=5060.<br>From: "01782478349" <<a href="mailto:sip%3A111@192.168.123.254">sip:111@192.168.123.254</a>;user=phone>;tag=905632682e68e9b5.<br>To: <sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>;tag=71d9875c03b727cbe0217d2db6ac2a49.422e.<br>Call-ID: <a href="mailto:358a9652404b14ad@192.168.123.16">358a9652404b14ad@192.168.123.16</a>.<br>CSeq: 63317 INVITE.<br>Contact: <sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>.<br>Server: My SIP Server.<br>Content-Length: 0.U 2014/10/05 16:38:04.954405 <a href="http://192.168.123.16:5060">192.168.123.16:5060</a> -> <a href="http://192.168.123.254:5060">192.168.123.254:5060</a><br>ACK sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP SIP/2.0.<br>Via: SIP/2.0/UDP 192.168.123.16:5060;branch=z9hG4bKaf202530a743a053.<br>From: "01782478349" <<a href="mailto:sip%3A111@192.168.123.254">sip:111@192.168.123.254</a>;user=phone>;tag=905632682e68e9b5.<br>To: <sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>;tag=71d9875c03b727cbe0217d2db6ac2a49.422e.<br>Contact: <sip:111@192.168.123.16:5060;transport=udp;user=phone>.<br>Supported: path.<br>Call-ID: <a href="mailto:358a9652404b14ad@192.168.123.16">358a9652404b14ad@192.168.123.16</a>.<br>CSeq: 63317 ACK.<br>User-Agent: Grandstream BT200 1.1.6.32.<br>Max-Forwards: 70.<br>Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK.<br>Content-Length: 0.<br>.<br><br>U 2014/10/05 16:38:04.975398 <a href="http://192.168.123.16:5060">192.168.123.16:5060</a> -> <a href="http://192.168.123.254:5060">192.168.123.254:5060</a><br>INVITE sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP SIP/2.0.<br>Via: SIP/2.0/UDP 192.168.123.16:5060;branch=z9hG4bKa55f284fa742ad32.<br>From: "01782478349" <<a href="mailto:sip%3A111@192.168.123.254">sip:111@192.168.123.254</a>;user=phone>;tag=9a25392722276c54.<br>To: <sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP>.<br>Contact: <sip:111@192.168.123.16:5060;transport=udp;user=phone>.<br>Supported: replaces, timer, 100rel, path.<br>Session-Expires: 180.<br>Min-SE: 90.<br>Call-ID: <a href="mailto:f2989990cfa8525c@192.168.123.16">f2989990cfa8525c@192.168.123.16</a>.<br>CSeq: 1445 INVITE.<br>User-Agent: Grandstream BT200 1.1.6.32.<br>Max-Forwards: 70.<br>Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK.<br>Content-Type: application/sdp.<br>Content-Length: 407.<br>.<br>.<br></div><div>. etc...<br></div><div><br><br><br></div></div>
</div></blockquote></body></html>