[OpenSER-Users] scope of openser flags

Hugo.Koblmueller at comneon.com Hugo.Koblmueller at comneon.com
Wed Apr 16 13:54:44 CEST 2008


high.bogdan!

well i wasn't aware of that, thanks. :)
so i applied a reply ID and added the t_on_reply() function, but i still have the same problem - the flags are not set in the reply route?
see ...

route {
...
    if (src_ip == 172.xx.xx.xx) {
#       relay request to *
        if (!t_relay("udp:172.xx.xx.xx:5060")) {
            sl_reply_error();
        }
    }
    else {
#       relay request to OCS
        if (!t_relay("tcp:172.xx.xx.xx:5060")) {
            sl_reply_error();
        }
    }

#   use a non-generic reply route to be able to use transaction flags
    t_on_reply("1");

    if (method == INVITE) setflag(3);
    xlog("L_INFO","$Cyb$rm: mf=$mf, bf=$bf, sf=$sf$Cxx\n");
    exit;
}

onreply_route[1] {
    xlog("L_INFO","$Cyr$rs($rr): mf=$mf, bf=$bf, sf=$sf$Cxx\n");
}


still get the output:
10(11658) INVITE: mf=8, bf=0, sf=0
 5(11653) 100(Trying): mf=0, bf=0, sf=0
 7(11655) 180(Ringing): mf=0, bf=0, sf=0
 8(11656) 200(OK): mf=0, bf=0, sf=0
10(11658) ACK: mf=0, bf=0, sf=0
 6(11654) BYE: mf=0, bf=0, sf=0
11(11659) 200(OK): mf=0, bf=0, sf=0

any ideas on that?

thx & cheers
-hugo


-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan at voice-system.ro]
Sent: Wednesday, April 16, 2008 1:31 PM
To: Hugo Koblmueller
Cc: users at lists.openser.org
Subject: Re: [OpenSER-Users] scope of openser flags

Hi Hugo,

The flags you mention are per transaction flags and they are visible as time the route is in a transaction context. Unfortunately you came across the only exception. You are using the generic "onreply_route"
where there is no transaction contect (openser has no idea -yet- about the transaction the reply belongs to). A reply route with transaction context is onreply_route[x] - this is set per transaction by t_on_reply().

Regards,
Bogdan

Hugo Koblmueller wrote:
> high.*!
>
> i'm using openser v1.2 and am a bit confused about the scope of the
> flag. just for information about my setup: i use openser as gateway
> between OCSmediation server and asterisk.
>
> i learned that the message flags are transaction persistent, which
> means that if i set some flags while processing the INVITE request,
> these flags must be visible also when we process all other requests
> and replies in scope of the same transaction.
>
> and i also learned, that the flags which are set for INVITE are
> visible only when processing 100 (Trying), 180 (Ringing), and 487
> (Request Cancelled). however, the flags are not visible when
> processing CANCEL, 200 (OK), and ACK.
> thats for the theory.
>
> now i have two problems:
> first (as i mentioned above) i experienced, that 'my' flags are not
> that visible as they should be. means e.g. i set flag 3 in request
> route and print it out in onreply_route, where it seems not to be set.
> see my code below:
>
> route {
> ...
>     if (src_ip == 172.xx.xx.xx) {
> #       relay request to *
>         if (!t_relay("udp:172.xx.xx.xx:5060")) {
>             sl_reply_error();
>         }
>     }
>     else {
> #       relay request to OCS
>         if (!t_relay("tcp:172.xx.xx.xx:5060")) {
>             sl_reply_error();
>         }
>     }
>     if (method == INVITE) setsflag(3);
>     xlog("L_INFO","$Cyb$rm: mf=$mf, bf=$bf, sf=$sf$Cxx\n");
>     exit;
> }
>
> onreply_route {
>     xlog("L_INFO","$Cyr$rs($rr): mf=$mf, bf=$bf, sf=$sf$Cxx\n"); }
>
>
> the output is the following:
> 10(10569) INVITE: mf=0, bf=0, sf=8
>  7(10566) 100(Trying): mf=0, bf=0, sf=0
>  5(10564) 180(Ringing): mf=0, bf=0, sf=0
>  8(10567) 200(OK): mf=0, bf=0, sf=0
> 10(10569) ACK: mf=0, bf=0, sf=0
>  6(10565) BYE: mf=0, bf=0, sf=0
> 11(10570) 200(OK): mf=0, bf=0, sf=0
>
> as you can see the flag 3 is only set, while processing the INVITE but
> after this is stays reset.
>
> any ideas which problem i'm facing here?
>
>
> my second problem is, that i need to identify the reply "200 OK" which
> is answered to the relayed INVITE message. as i mentioned above, this
> will not be covered by the flags scope anyways. Sad
> is there any possibility to have kind of (real) global variables in
> openser.cfg?
>
> thx & cheers
> -hugo
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.openser.org
> http://lists.openser.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list