[SR-Users] question about dlg_var
Federico Cabiddu
federico.cabiddu at gmail.com
Thu Mar 3 09:57:59 CET 2016
Hi,
If I understood correctly the original question was to identify, in a reply
route, a 200 OK coming for an initial INVITE.
In the reply route the 200 OK will always have a to tag (unless the UAS is
broken), so you cannot this condition.
Regards,
Federico
On Thu, Mar 3, 2016 at 9:05 AM, Serge S. Yuriev <me at nevian.org> wrote:
> Hi,
>
> Sorry, but why not to check has_totag again? Why we need a flag?
>
> --
> Wbr, Serge via mobile
>
> 03.03.2016, 09:31, "Federico Cabiddu" <federico.cabiddu at gmail.com>:
>
>
> Hi,
> $dlg_var is not available at this stage of the dialog:
>
>
> http://www.kamailio.org/docs/modules/devel/modules/dialog.html#idp19330392
>
>
>
> To achieve your goal you can use there an avp or a flag, which are bound
> to transactions.
> Something like:
>
>
>
> #define INIT_FLAG
>
>
> if (is_method("INVITE") && !has_totag()) {
>
> $avp(is_init_invite) = 1;
> # or
> # setflag(INIT_FLAG);
> }
>
>
> onreply_route {
> if (is_method("INVITE") && t_check_status("200") &&
> $avp(is_init_invite) == "1") {
> # or
> # if (is_method("INVITE") && t_check_status("200") &&
> isflagset(INIT_FLAG))
> #
> # do somting
> }
> }
>
>
> Regards,
>
>
> Federico
>
>
> On Thu, Mar 3, 2016 at 4:55 AM, 张顺通 <shuntongzhang at gmail.com> wrote:
>
>
> I want to distingguish 200 OK is for INVITE or reINVITE。
>
>
> so I do this:
> request_route {
> if (is_method("INVITE") && !has_totag()) {
> $dlg_var(is_init_invite) = "1";
> }
> }
>
>
> onreply_route {
> xlog("L_INFO","[$rs-$rr][is_init_invite:$dlg_var(is_init_invite)]");
> if (is_method("INVITE") && t_check_status("200") &&
> $dlg_var(is_init_invite) == "1") {
> # do somting
> $dlg_var(is_init_invite) = "0";
> }
> xlog("L_INFO","[$rs-$rr][is_init_invite:$dlg_var(is_init_invite)]");
> }
>
>
> What I confuse is:
> When I recive 100 Trying LOG is
> [100 - Trying][is_init_invite:0]
> [100 - Trying][is_init_invite:1]
>
>
>
> why is_init_invite is 0?
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160303/d1ab87f5/attachment.html>
More information about the sr-users
mailing list