<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    dialog flags (dlg_setflag) are for storing specific flags inside the
    dialog structure. It is not used to mark a request for creating a
    dialog. For that you have to use setflag.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 31/01/15 23:10, Anthony Messina
      wrote:<br>
    </div>
    <blockquote cite="mid:52695157.KIPCk3VIqb@linux-ws1.messinet.com"
      type="cite">
      <pre wrap="">I'm currently using Kamailio built from master@e59db79 and have been following 
the recent threads about the dialog module as I'm moving toward adding dialog 
support for presence and CDRs in my setup.

However, I seem to have come across an issue where dlg_setflag() does nothing, 
while setflag() works properly with the following (trimmed) script.  So for 
now, I issue setflag(FLT_DIALOG) for INVITE rather than 
dlg_setflag(FLT_DIALOG).

Is there something I'm missing about dlg_setflag()?


#!define FLT_DIALOG 4
request_route {
        route(REQINIT);
        route(NATDETECT);
        if(is_method("CANCEL")) {
                if(t_check_trans()) {
                        route(RELAY);
                }
                exit;
        }
        route(WITHINDLG);
        if(t_precheck_trans()) {
                t_check_trans();
                exit;
        }
        t_check_trans();
        route(AUTH);
        remove_hf("Route");
        if(is_method("INVITE|SUBSCRIBE"))
                record_route();
        if(is_method("INVITE")) {
                setflag(FLT_ACC);
                # Enable dialog support (dlg_setflag not working)
                #dlg_setflag(FLT_DIALOG);
                setflag(FLT_DIALOG);
        }
        route(SIPOUT);
        route(PRESENCE);
        route(REGISTRAR);
        if($rU==$null) {
                # request with no Username in RURI
                sl_send_reply("484","Address Incomplete");
                exit;
        }
        route(PSTN);
        route(LOCATION);
        route(RELAY);
}

route[WITHINDLG] {
        if(!has_totag()) return;
        if(loose_route()) {
                route(DLGURI);
                if(is_method("BYE")) {
                        setflag(FLT_ACC);
                        setflag(FLT_ACCFAILED);
                        # Testing dialog flag
                        xlog("L_INFO", "Completed $dlg(from_uri) to 
$dlg(to_uri) - $DLG_lifetime duration\n");
                } else if(is_method("ACK")) {
                        route(NATMANAGE);
                } else if(is_method("NOTIFY")) {
                        record_route();
                }
                route(RELAY);
                exit;
        }
        if(is_method("SUBSCRIBE") && uri==myself) {
                route(PRESENCE);
                exit;
        }
        if(is_method("ACK")) {
                if(t_check_trans()) {
                        route(RELAY);
                        exit;
                } else {
                        exit;
                }
        }
        sl_send_reply("404","Not Found");
        exit;
}

</pre>
      <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>
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
  </body>
</html>