Menu

#207 is_dlg_flag_set does not really checking the flag (ver1.5.3)

1.5.x
closed-invalid
modules (454)
5
2010-01-05
2009-10-30
No

Hello.

I'm trying to catch the specific in-dialog request (BYE for call, that is on-hold). I try to make it with the dialog flags behavior:

route[1]
{
...
if(is_method("INVITE") && loose_route() && has_totag() && has_body("application/sdp")) {
if(search_body("c=IN IP4 0.0.0.0")||search_body("a=sendonly")) {
set_dlg_flag("1");
}
}
...
if ( is_method("BYE") && is_dlg_flag_set("1") ) {
xlog("L_INFO, "!!! cathed FLAG !!!");
}
...
}

When i check, how it works, i see: function is_dlg_flag_set("1") returns FALSE always.
Then i try to make some check for how it works, and write next construction in request route:

create_dialog();
set_dlg_flag("1");
if ( is_dlg_flag_set("1") ) {
xlog("L_INFO", "!!! SFLAG setup !!!");
}

And this message does not appear anytime in log. Other messages with L_INFO i can see properly, It seems that dialog flags behavior does not works fine.

Some configuration lines about dialog module:
loadmodule "dialog.so"
modparam("dialog", "dlg_flag", 3)
modparam("dialog", "bye_on_timeout_flag", 4)
modparam("dialog", "profiles_with_value", "termination")
modparam("dialog", "table_name", "dialog")
modparam("dialog", "default_timeout", 3600)
modparam("dialog", "dlg_extra_hdrs", "Hint: internal dialog timed out\r\n")

[root@sip-dev-an ~]# opensips -V
version: opensips 1.5.3-notls (x86_64/linux)
flags: STATS: Off, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
svnrevision: 4:784M
@(#) $Id: main.c 5887 2009-07-16 11:47:46Z bogdan_iancu $
main.c compiled on 08:19:11 Oct 23 2009 with gcc 4.1.2

Is this my misunderstanding or i should report a bug?

Discussion

  • Bogdan-Andrei Iancu

    • assigned_to: nobody --> bogdan_iancu
     
  • Bogdan-Andrei Iancu

    Hi,

    I tried the the script sequence you posted (with setting and testing the flag) and it worked in 1.6.0 (more or less the same code as in 1.5.3, for the dialog flags) - and it did work with no problem.

    Can you check also with 1.6.0 and confirm that it is working ?

    Regards,
    Bogdan

     
  • Bogdan-Andrei Iancu

    • labels: --> modules
    • milestone: --> 1.5.x
    • status: open --> open-invalid
     
  • Alexey Nikolaev

    Alexey Nikolaev - 2009-10-30

    Hi, Bogdan.

    Sorry, I can not check with 1.6.0 because 1.5.3 is used for production with some custom modules. Upgrade to 1.6.0 is not possible.

    However, if this make some clearence to you, i can contribute some debug information. LOG output on debug level, or something else?

     
  • Alexey Nikolaev

    Alexey Nikolaev - 2009-10-30

    I research the problem again.

    I point that, this problem appear (dialog FLAG can not be checked) when i do not make create_dialog in initial request. When it used in initial invite - all works perfect. This behavior described in documentation.

    So i have two questions

    1. How it deal with opensips performance, when i call create_dialog() in every INVITE msg?

    2. I was thinking that dialog automatically created when the initial request is processed. So i try to use construction:
    For reINVITE:
    set_dlg_flag(1);

    For BYE
    if ( is_method("BYE") && is_dlg_flag_set("1") ) {
    xlog("L_INFO, "!!! cathed FLAG !!!");
    }
    But have not get positive result.

    Do i need to make create_dialog() for all initial requests, for using flags and other dialog related fuctions in NOT INITIAL requests (re-INVITE, BYE, ACK...)?
    Is dialog was not created previously (in case when i do not call create_dialog in the initial request) when initial request was processed?

    Regards.
    Alexey.

     
  • Bogdan-Andrei Iancu

    Hi Alexey,

    for having the dialog flags working (setting and reading), it is a must to have a dialog context , so you must do "dialog_create()" before

    regarding the performance - of course, adding dialog awareness into opensips brings some performance penalties - we do plan to make some tests to try to quantify this extra load due dialog usage. Anyhow, the penalty is there, but not something to worry about as it is pure CPU and right now to bottleneck is in I/O ops.

    Regarding your second question - for INVITE you need to do "create_dialog()" before doing any op with dlg flags ; for BYE be sure you do loose_route() before accessing any information regarding the dialog context.

    Regards,
    Bogdan

     
  • Bogdan-Andrei Iancu

    • status: open-invalid --> closed-invalid
     

Log in to post a comment.