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"><<a href="mailto:marianarduini@gmail.com" target="_blank">marianarduini@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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> </div><div>if(is_method("INVITE")) {</div><div> create_dialog();</div><div> t_on_failure("INVITE");</div><div>} </div><div><br></div><div>if (is_in_profile("e164")) {</div>
<div> 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: $avp(size)");</div>
<div><br></div><div>if (($oU =~ "^\+?[1-9][0-9]{4,14}$") || (is_in_profile("e164"))) {</div><div> set_dlg_profile("e164");</div><div> route("e164");</div><div>} else if (($od =~ "^<a href="http://mydomain.com" target="_blank">mydomain.com</a>$") || (is_in_profile("domain"))) {</div>
<div> set_dlg_profile("domain");</div><div> route("domain");</div><div>} else {</div><div> xlog("L_ERR","User in request uri ($oU) is not an E.164 number nor the domain ($od) is recognized.");</div>
<div> xlog("L_ERR","error(404) Not found");</div><div> sl_send_reply("404", "Not found");</div><div> 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>} </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> 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> # calling an E.164 number</div><div> xlog("L_INFO","calling E.164");</div><div> set_dlg_flag("1");</div><div> route("e164");</div><div>} else if (($od =~ "^<a href="http://mydomain.com" target="_blank">mydomain.com</a>$") || (is_dlg_flag_set("2"))) {</div>
<div> # calling mydomain</div><div> set_dlg_flag("2");</div><div> route("mydomain");</div><div>} else {</div><div> xlog("L_ERR","User in request uri ($oU) is not an E.164 number nor the domain ($od) is recognized.");</div>
<div> xlog("L_ERR","error(404) Not found");</div><div> sl_send_reply("404", "Not found");</div><div> 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>