[OpenSIPS-Devel] [ opensips-Bugs-2889312 ] is_dlg_flag_set does not really checking the flag (ver1.5.3)

SourceForge.net noreply at sourceforge.net
Wed Nov 4 10:17:33 CET 2009


Bugs item #2889312, was opened at 2009-10-30 11:01
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2889312&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.5.x
Status: Open
Resolution: Invalid
Priority: 5
Private: No
Submitted By: Alexey Nikolaev (iamthedeath)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: is_dlg_flag_set does not really checking the flag (ver1.5.3)

Initial Comment:
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 at 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?

----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-11-04 11:17

Message:
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

----------------------------------------------------------------------

Comment By: Alexey Nikolaev (iamthedeath)
Date: 2009-10-30 14:59

Message:
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.

----------------------------------------------------------------------

Comment By: Alexey Nikolaev (iamthedeath)
Date: 2009-10-30 13:41

Message:
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?

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-10-30 12:58

Message:
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

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2889312&group_id=232389



More information about the Devel mailing list