<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    Indeed, when the BYE is internally processed by OpenSIPS and matched
    to the proper dialog, the dialog is also removed from the profiles
    it belonged to.<br>
    The dialog is not yet destroyed from memory, as you can still access
    stuff like dialog variables, etc, it is just removed from the
    profiles.<br>
    <br>
    Regards,<br>
    <pre class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a> </pre>
    <br>
    On 05/23/2012 08:51 PM, Mariana Arduini wrote:
    <blockquote
cite="mid:CABHUZgBd7SrB3LdS-LrKy=Lh-bVjAUCB_zdibvPXPAyctyvU8w@mail.gmail.com"
      type="cite">Ok, I've added match_dialog() before testing for the
      profile and now it works for the ACK, but not for the BYE. Even
      the profile size is set back to 0 when I get the BYE.
      <div><br>
      </div>
      <div>Is that expected? Is the dialog finished before I can check
        any profile information?</div>
      <div><br>
      </div>
      <div>Thanks,</div>
      <div>Mariana<br>
        <br>
        <div class="gmail_quote">On Wed, May 23, 2012 at 11:47 AM,
          Mariana Arduini <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:marianarduini@gmail.com" target="_blank">marianarduini@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">Hello all,
            <div><br>
            </div>
            <div>I'm having problems with Dialog module, again... I
              tried the following:</div>
            <div><br>
            </div>
            <div>
              <div>modparam("dialog", "profiles_no_value", "e164 ;
                domain")</div>
              <div>&nbsp; &nbsp;&nbsp;</div>
              <div>if(is_method("INVITE")) {</div>
              <div>&nbsp; &nbsp; create_dialog();</div>
              <div>&nbsp; &nbsp; t_on_failure("INVITE");</div>
              <div>} &nbsp; &nbsp;&nbsp;</div>
              <div><br>
              </div>
              <div>if (is_in_profile("e164")) {</div>
              <div>&nbsp; &nbsp; xlog("L_INFO","I'm e164");</div>
              <div>}</div>
              <div><br>
              </div>
              <div>get_profile_size("e164","$avp(size)");</div>
              <div>xlog("L_INFO","e164 profile size: &nbsp;$avp(size)");</div>
              <div><br>
              </div>
              <div>if (($oU =~ "^\+?[1-9][0-9]{4,14}$") ||
                (is_in_profile("e164"))) {</div>
              <div>&nbsp; &nbsp; set_dlg_profile("e164");</div>
              <div>&nbsp; &nbsp; route("e164");</div>
              <div>} else if (($od =~ "^<a moz-do-not-send="true"
                  href="http://mydomain.com" target="_blank">mydomain.com</a>$")
                || (is_in_profile("domain"))) {</div>
              <div>&nbsp; &nbsp; set_dlg_profile("domain");</div>
              <div>&nbsp; &nbsp; route("domain");</div>
              <div>} else {</div>
              <div>&nbsp; &nbsp; xlog("L_ERR","User in request uri ($oU) is not an
                E.164 number nor the domain ($od) is recognized.");</div>
              <div>&nbsp; &nbsp; xlog("L_ERR","error(404) Not found");</div>
              <div>&nbsp; &nbsp; sl_send_reply("404", "Not found");</div>
              <div>&nbsp; &nbsp; exit;</div>
              <div>}</div>
            </div>
            <div><br>
            </div>
            <div>I tested with an e164 profile call, but I don't see the
              log "I'm e164" for sequential requests. However, the
              get_profile_size shows 0 for the INVITE and 1 for both the
              ACK and BYE. I also tried with only one profile in the
              list, still no success.</div>
            <div><br>
            </div>
            <div>Then I tried using dlg flags as following:</div>
            <div><br>
            </div>
            <div>
              <div>
                <div>if(is_method("INVITE")) {</div>
                <div><span style="white-space: pre-wrap;"> </span>create_dialog();</div>
                <div><span style="white-space: pre-wrap;"> </span>t_on_failure("INVITE");</div>
                <div>}&nbsp;</div>
                <div><br>
                </div>
                <div># I'm forcing these just to check if dlg_flag would
                  work, it is not part of my logic</div>
                <div>set_dlg_flag("1");</div>
                <div>if (is_dlg_flag_set("1")) {</div>
                <div>&nbsp; &nbsp; xlog("L_INFO","dlg flag 1 is set");</div>
                <div>}</div>
                <div><br>
                </div>
                <div>if (($oU =~ "^\+?[1-9][0-9]{4,14}$") ||
                  (is_dlg_flag_set("1"))) {</div>
                <div>&nbsp; &nbsp; # calling an E.164 number</div>
                <div>&nbsp; &nbsp; xlog("L_INFO","calling E.164");</div>
                <div>&nbsp; &nbsp; set_dlg_flag("1");</div>
                <div>&nbsp; &nbsp; route("e164");</div>
                <div>} else if (($od =~ "^<a moz-do-not-send="true"
                    href="http://mydomain.com" target="_blank">mydomain.com</a>$")
                  &nbsp;|| (is_dlg_flag_set("2"))) {</div>
                <div>&nbsp; &nbsp; # calling mydomain</div>
                <div>&nbsp; &nbsp; set_dlg_flag("2");</div>
                <div>&nbsp; &nbsp; route("mydomain");</div>
                <div>} else {</div>
                <div>&nbsp; &nbsp; xlog("L_ERR","User in request uri ($oU) is not
                  an E.164 number nor the domain ($od) is recognized.");</div>
                <div>&nbsp; &nbsp; xlog("L_ERR","error(404) Not found");</div>
                <div>&nbsp; &nbsp; sl_send_reply("404", "Not found");</div>
                <div>&nbsp; &nbsp; exit;</div>
                <div>}</div>
              </div>
            </div>
            <div><br>
            </div>
            <div>Using the dlg flags, I can only see the log "dlg flag 1
              is set" for the INVITE. The function is_dlg_flag_set("1")
              does not return true for ACK and BYE.</div>
            <div><br>
            </div>
            <div>I'm using the profile and flags after creating the
              dialog, as described in the docs. What am I doing wrong?</div>
            <div><br>
            </div>
            <div>Thanks,</div>
            <div>Mariana.</div>
          </blockquote>
        </div>
        <br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </body>
</html>