[OpenSER-Users] scope of openser flags
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Wed Apr 16 13:31:21 CEST 2008
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 sr-users
mailing list