<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>ah, ok, I misunderstood.</p>
    <p>Is the INVITE received with the header Session-Expires?</p>
    <p>And remove the line:</p>
    <p>#!define DLG_TIMEOUT_AVP "i:1"</p>
    <p>It does not replaces the token inside strings, like inside the
      last parameter of the line:</p>
    <p>modparam("dialog", "timeout_avp", "$avp(DLG_TIMEOUT_AVP)")</p>
    <p>and if you use in config expressions $avp(DLG_TIMEOUT_AVP), then
      its name is replaced. So overall it can be two avp names, although
      when reading looks like one.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 22.03.20 14:40, harneet singh wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAHTs8D9ECcbSUCqJJiYhwkfje3gawy8rNP=fw=gLKbrtJVnetA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi Daniel,
        <div><br>
        </div>
        <div>Thanks for the confirmation. Your point confirms the same
          as I interpreted from the documentation, that Kamailio would
          not send refresh INVITEs. I am not expecting to achieve that.
          However, if i understand correctly, Kamailio can look into the
          "Session-Expires" header from UAC/UAS and set the timeout_avp
          based on that.</div>
        <div>In effect, Kamailio should ideally <b>tear down the call
            (Send a BYE to UAC and UAS)</b>, if it doesn't see any
          signalling(may it be session-refresh INVITE/UPDATE or any
          other mid-dialog messages). This i believe can be done by
          using the SST Module in conjunction with the Dialog Module. </div>
        <div>I am also using the SST Module and the Dialog Module,
          however have the following issues.</div>
        <div><br>
        </div>
        <div>1. I am seeing the following message when sending
          Session-Expires: 200 . </div>
        <div>   ""dialog [dlg_handlers.c:681]: <b>get_dlg_timeout():
            invalid AVP value, using default timeout</b>"</div>
        <div><br>
        </div>
        <div>Not sure what is causing this. </div>
        <div><br>
        </div>
        <div>2. If i try to hardcode the session-expires to a certain
          value, the Kamailio DOES send a BYE to UAC and UAS on the
          timer expiry if no signaling seen during that time. However,
          as pointed earlier, the Dialog Load on the Kamailio DOES NOT
          go down, as shown in the last email.</div>
        <div><br>
        </div>
        <div>FWIW, here's the config snippet from the Kamailio cfg i am
          using.</div>
        <div> 
==========================================================================  <br>
        </div>
        <div>#!define <b>DLG_TIMEOUT</b>_AVP "i:1"<br>
        </div>
        <div><br>
        </div>
        <div># ----------- dialog params -----------<br>
          modparam("dialog", "send_bye", 1)<br>
          <b>modparam("dialog", "timeout_avp", "$avp(DLG_TIMEOUT_AVP)")</b><br>
          modparam("dialog", "dlg_flag", 5)<br>
          <br>
          # ----------- sst params -----------<br>
          modparam("sst", "enable_stats", 1)<br>
          modparam("sst", "min_se", 150)<br>
          # Set the sst modules timeout_avp to be the same value<br>
          <b>modparam("sst", "timeout_avp", "$avp(DLG_TIMEOUT_AVP)")</b><br>
          #modparam("sst", "reject_to_small", 1)<br>
          modparam("sst", "sst_flag", 6)<br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>request_route {</div>
        <div>     ....... </div>
        <div>     ....... </div>
        <div>    # account only INVITEs</div>
        if (is_method("INVITE")) {<br>
                        setflag(FLT_ACC); # do accounting<br>
                        <br>
                        setflag(5); # set the dialog flag<br>
                        setflag(6); # Set the sst flag<br>
                        $dlg_ctx(timeout_bye)=1;<br>
        <br>
                        if (sstCheckMin("1")) {<br>
                           xlog("L_ERR", "422 Session Timer Too Small
        reply sent.\n");<br>
                           exit;<br>
                        }<br>
        <br>
        }
        <div> .....</div>
        <div>......</div>
        <div>}</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>==========================================================================<br>
          <div><br>
          </div>
          <div>From the SST documentation, it pretty much seems like the
            only config to do. Am I missing something. If you have a
            working config for the Kamailio tuned in this manner using
            the SST and Dialog Module, could you share the same?</div>
          <div>Any pointers to make it work are most welcome. </div>
          <div><br>
          </div>
          <div>Regards,</div>
          <div>Harneet</div>
          <div><br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Sun, Mar 22, 2020 at 3:01
          PM Daniel-Constantin Mierla <<a
            href="mailto:miconda@gmail.com" moz-do-not-send="true">miconda@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p>Hello,</p>
            <p>are you looking for Kamailio to send re-INVITEs? If yes,
              that is not available as a feature of dialog module.</p>
            <p>Cheers,<br>
              Daniel<br>
            </p>
            <div>On 21.03.20 10:39, harneet singh wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">Hi,
                <div><br>
                </div>
                <div>I am fairly new to Kamailio and had a question
                  regarding how to use Kamailio to enable Session
                  refresh functionality when Kamailio is acting as Sip
                  Stateful Proxy. </div>
                <div>Kamailio Version used: <b>5.3.2</b> with <b>Call
                    Load based routing</b> using the <b>dispatcher </b>module.</div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div>* From what i understand from the documentation,
                  Kamailio will probably not be acting as a session
                  refresher, but Kamailio can tear down the call in case
                  session refresh is negotiated, between the caller and
                  the callee(via Kamailio Sip Proxy), and no message
                  exchange happens in the duration set in
                  Session-Expires header. <b>Is my
                    understanding correct?</b></div>
                <div><b><br>
                  </b></div>
                <div><b>* </b>I believe the above functionality is
                  possible by using the <b>sst</b> and <b>dialog</b>
                  module. I have set the same according to the
                  documentation but I keep getting the following error:</div>
                <div>"dialog [dlg_handlers.c:681]: <b>get_dlg_timeout():
                    invalid AVP value, using default timeout</b>"</div>
                <div>Can someone share a working example?</div>
                <div><br>
                </div>
                <div>* When i tried hardcoding the timeout value by
                  setting the timeout_avp to a specific value, Kamailio
                  did sense a timeout and hence sent a BYE towards the
                  caller and the Callee side both(which is what the
                  requirement is), however, i do see the <b>dialog is
                    still not cleared</b> in the "kamcmd
                  dispatcher.list". Output excerpt below for reference:</div>
                <div><br>
                </div>
                <div>[root@CPaaSVM ~]# kamcmd dispatcher.list<br>
                  {<br>
                          NRSETS: 1<br>
                          RECORDS: {<br>
                                  SET: {<br>
                                          ID: 1<br>
                                          TARGETS: {<br>
                                                  DEST: {<br>
                                                          URI: <a
                    moz-do-not-send="true">sip:172.27.44.121:5080;transport=tcp</a><br>
                                                          FLAGS: AP<br>
                                                          PRIORITY: 0<br>
                                                          ATTRS: {<br>
                                                                  BODY:
                  duid=sample-cas;maxload=1000<br>
                                                                  DUID:
                  sample-cas<br>
                                                                 
                  MAXLOAD: 1000<br>
                                                                 
                  WEIGHT: 0<br>
                                                                 
                  RWEIGHT: 0<br>
                                                                 
                  SOCKET:<br>
                                                          }<br>
                                                          LATENCY: {<br>
                                                                  AVG:
                  111.304000<br>
                                                                  STD:
                  1042.193000<br>
                                                                  EST:
                  2.385000<br>
                                                                  MAX:
                  9999<br>
                                                                 
                  TIMEOUT: 1<br>
                                                          }<br>
                                                          RUNTIME: {<br>
                                                                  <font
                    color="#ff0000">DLGLOAD: <b>1</b></font><br>
                                                          }<br>
                                                  }<br>
                                          }<br>
                                  }<br>
                          }<br>
                  }<br>
                </div>
                <div><br>
                </div>
                <div>It is noteworthy that in case the BYE is initiated
                  by either the caller or the callee, the dialog is
                  cleared properly and the DLGLOAD is set to 0 on call
                  termination. </div>
                <div><br>
                </div>
                <div>Any pointers for the above questions would be
                  highly appreciated. </div>
                <div><br>
                </div>
                <div>Regards,</div>
                <div>Harneet</div>
                <div>
                  <div><br>
                  </div>
                  -- <br>
                  <div dir="ltr">"Once you eliminate the impossible,
                    whatever remains, no matter how improbable, must be
                    the truth" - Sir Arthur Conan Doyle<br>
                  </div>
                </div>
              </div>
              <br>
              <fieldset></fieldset>
              <pre>_______________________________________________
Kamailio (SER) - Users Mailing List
<a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
            </blockquote>
            <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a></pre>
          </div>
        </blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">"Once you eliminate the
        impossible, whatever remains, no matter how improbable, must be
        the truth" - Sir Arthur Conan Doyle<br>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a></pre>
  </body>
</html>