<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    <div class="moz-cite-prefix">On 05/10/14 17:51, White, Phil wrote:<br>
    </div>
    <blockquote
cite="mid:CAKsv4qY1U2_S+MfWgACapV13ipuxhV2PURKqOt+YUzYYus-tcw@mail.gmail.com"
      type="cite">
      <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>
          </div>
        </div>
      </div>
    </blockquote>
    for 2, look at kamailio-basic.cfg, it is a stateful proxy
    implementations (plus some few other features).<br>
    <br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <blockquote
cite="mid:CAKsv4qY1U2_S+MfWgACapV13ipuxhV2PURKqOt+YUzYYus-tcw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div><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 moz-do-not-send="true" 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 moz-do-not-send="true"
            href="http://192.168.123.16:5060">192.168.123.16:5060</a>
          -> <a moz-do-not-send="true"
            href="http://192.168.123.254:5060">192.168.123.254:5060</a><br>
          INVITE
          <a class="moz-txt-link-freetext" href="sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP">sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP</a>
          SIP/2.0.<br>
          Via: SIP/2.0/UDP
          192.168.123.16:5060;branch=z9hG4bKaf202530a743a053.<br>
          From: "01782478349" <<a moz-do-not-send="true"
            href="mailto:sip%3A111@192.168.123.254">sip:111@192.168.123.254</a>;user=phone>;tag=905632682e68e9b5.<br>
          To:
<a class="moz-txt-link-rfc2396E" href="sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP"><sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP></a>.<br>
          Contact:
          <a class="moz-txt-link-rfc2396E" href="sip:111@192.168.123.16:5060;transport=udp;user=phone"><sip:111@192.168.123.16:5060;transport=udp;user=phone></a>.<br>
          Supported: replaces, timer, 100rel, path.<br>
          Session-Expires: 180.<br>
          Min-SE: 90.<br>
          Call-ID: <a moz-do-not-send="true"
            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 moz-do-not-send="true"
            href="http://192.168.123.254:5060">192.168.123.254:5060</a>
          -> <a moz-do-not-send="true"
            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 moz-do-not-send="true"
            href="mailto:sip%3A111@192.168.123.254">sip:111@192.168.123.254</a>;user=phone>;tag=905632682e68e9b5.<br>
          To:
<a class="moz-txt-link-rfc2396E" href="sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP"><sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP></a>;tag=71d9875c03b727cbe0217d2db6ac2a49.422e.<br>
          Call-ID: <a moz-do-not-send="true"
            href="mailto:358a9652404b14ad@192.168.123.16">358a9652404b14ad@192.168.123.16</a>.<br>
          CSeq: 63317 INVITE.<br>
          Contact:
<a class="moz-txt-link-rfc2396E" href="sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP"><sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP></a>.<br>
          Server: My SIP Server.<br>
          Content-Length: 0.U 2014/10/05 16:38:04.954405 <a
            moz-do-not-send="true" href="http://192.168.123.16:5060">192.168.123.16:5060</a>
          -> <a moz-do-not-send="true"
            href="http://192.168.123.254:5060">192.168.123.254:5060</a><br>
          ACK
          <a class="moz-txt-link-freetext" href="sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP">sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP</a>
          SIP/2.0.<br>
          Via: SIP/2.0/UDP
          192.168.123.16:5060;branch=z9hG4bKaf202530a743a053.<br>
          From: "01782478349" <<a moz-do-not-send="true"
            href="mailto:sip%3A111@192.168.123.254">sip:111@192.168.123.254</a>;user=phone>;tag=905632682e68e9b5.<br>
          To:
<a class="moz-txt-link-rfc2396E" href="sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP"><sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP></a>;tag=71d9875c03b727cbe0217d2db6ac2a49.422e.<br>
          Contact:
          <a class="moz-txt-link-rfc2396E" href="sip:111@192.168.123.16:5060;transport=udp;user=phone"><sip:111@192.168.123.16:5060;transport=udp;user=phone></a>.<br>
          Supported: path.<br>
          Call-ID: <a moz-do-not-send="true"
            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 moz-do-not-send="true"
            href="http://192.168.123.16:5060">192.168.123.16:5060</a>
          -> <a moz-do-not-send="true"
            href="http://192.168.123.254:5060">192.168.123.254:5060</a><br>
          INVITE
          <a class="moz-txt-link-freetext" href="sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP">sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP</a>
          SIP/2.0.<br>
          Via: SIP/2.0/UDP
          192.168.123.16:5060;branch=z9hG4bKa55f284fa742ad32.<br>
          From: "01782478349" <<a moz-do-not-send="true"
            href="mailto:sip%3A111@192.168.123.254">sip:111@192.168.123.254</a>;user=phone>;tag=9a25392722276c54.<br>
          To:
<a class="moz-txt-link-rfc2396E" href="sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP"><sip:105@192.168.123.10:58833;rinstance=0d82c786ca88f460;transport=UDP></a>.<br>
          Contact:
          <a class="moz-txt-link-rfc2396E" href="sip:111@192.168.123.16:5060;transport=udp;user=phone"><sip:111@192.168.123.16:5060;transport=udp;user=phone></a>.<br>
          Supported: replaces, timer, 100rel, path.<br>
          Session-Expires: 180.<br>
          Min-SE: 90.<br>
          Call-ID: <a moz-do-not-send="true"
            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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>