[OpenSIPS-Users] Dialog profiles and flags not matching

Mariana Arduini marianarduini at gmail.com
Wed May 23 16:47:42 CEST 2012


Hello all,

I'm having problems with Dialog module, again... I tried the following:

modparam("dialog", "profiles_no_value", "e164 ; domain")

if(is_method("INVITE")) {
    create_dialog();
    t_on_failure("INVITE");
}

if (is_in_profile("e164")) {
    xlog("L_INFO","I'm e164");
}

get_profile_size("e164","$avp(size)");
xlog("L_INFO","e164 profile size:  $avp(size)");

if (($oU =~ "^\+?[1-9][0-9]{4,14}$") || (is_in_profile("e164"))) {
    set_dlg_profile("e164");
    route("e164");
} else if (($od =~ "^mydomain.com$") || (is_in_profile("domain"))) {
    set_dlg_profile("domain");
    route("domain");
} else {
    xlog("L_ERR","User in request uri ($oU) is not an E.164 number nor the
domain ($od) is recognized.");
    xlog("L_ERR","error(404) Not found");
    sl_send_reply("404", "Not found");
    exit;
}

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.

Then I tried using dlg flags as following:

if(is_method("INVITE")) {
create_dialog();
 t_on_failure("INVITE");
}

# I'm forcing these just to check if dlg_flag would work, it is not part of
my logic
set_dlg_flag("1");
if (is_dlg_flag_set("1")) {
    xlog("L_INFO","dlg flag 1 is set");
}

if (($oU =~ "^\+?[1-9][0-9]{4,14}$") || (is_dlg_flag_set("1"))) {
    # calling an E.164 number
    xlog("L_INFO","calling E.164");
    set_dlg_flag("1");
    route("e164");
} else if (($od =~ "^mydomain.com$")  || (is_dlg_flag_set("2"))) {
    # calling mydomain
    set_dlg_flag("2");
    route("mydomain");
} else {
    xlog("L_ERR","User in request uri ($oU) is not an E.164 number nor the
domain ($od) is recognized.");
    xlog("L_ERR","error(404) Not found");
    sl_send_reply("404", "Not found");
    exit;
}

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.

I'm using the profile and flags after creating the dialog, as described in
the docs. What am I doing wrong?

Thanks,
Mariana.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120523/8361832e/attachment.htm>


More information about the Users mailing list