Hello, using opensips3.1 I don't arrive at catching event E_UL_CONTACT_INSERT.

As you can see in below logs,

the route seems to be correctly armed, but the event is not triggered on the registration of the user.

Can somebody give a hint on what I am overlooking ?

Do I need to enable the events in usrloc ?


wkr,

    xlog("callid=$ci: Route[userlocation]:avp(messagepn) [$avp(messagepn)] avp(callpn) [$avp(callpn)]");
    if (($avp(callpn)!="null") or ($avp(messagepn)!=null))
    {
        xlog("callid=$ci: Route[userlocation]:we call t_newtran and subscribe for E_UL_CONTACT_INSERT");
        # prepare transaction for branch injection; it is mandatory
        # to create the transaction before the subscription, otherwise
        # the EBR module will not pass the transaction ID into the
        # notification route
        t_newtran();
        # keep the transaction alive (even if all branches will
        # terminate) until the FR INVITE timer hits (we want to wait
        # for new possible contacts being registered)
        t_wait_for_new_branches();
        # subscribe to new contact registration event,
        # but for our callee only
*$avp(filter) = "aor=" + $tU + "@" + $td;*
        #$avp(filter) = "aor=*";
        xlog("callid=$ci: Route[userlocation]: filter avp(filter) [$avp(filter)]");         async( wait_for_event("E_UL_CONTACT_INSERT",$avp(filter), 40), "fork_call");
#notify_on_event("E_UL_CONTACT_INSERT",$avp(filter),"fork_call", "180");
    }


route[fork_call]
{
    xlog("callid=$ci: Route[fork_call]:user $avp(aor) registered a new contact $avp(uri), injecting\n");
    # take the contact described by the E_UL_CONTACT_INSERT
    # event and inject it as a new branch into the original
    # transaction
    t_inject_branches("event");
}


route[0]

{

...

    if (is_method("REGISTER"))
    {
        #TLS
        if (isflagset("SRC_TLS"))
        {
            setbflag("DST_TLS");
        }
        #TLS end TLS
        if (!www_authorize("", "subscriber"))
        {
            www_challenge("", "auth");
            exit;
        }

        if (!save("location")){
            sl_reply_error();
            exit;
        }
        xlog("callid=$ci: Route[0]: REGISTER comes in from fU $fU");
        exit;
    }
}

Aug 21 12:53:09 ns365555 /data/opensips/sbin/opensips[18730]: callid=AmrM407AUsLjipDqbtNFjQ..: Route[userlocation]:we call t_newtran and subscribe for E_UL_CONTACT_INSERT Aug 21 12:53:09 ns365555 /data/opensips/sbin/opensips[18730]: callid=AmrM407AUsLjipDqbtNFjQ..: Route[userlocation]: filter avp(filter) [[email protected]] Aug 21 12:53:11 ns365555 /data/opensips/sbin/opensips[18729]: callid=KFzAmny6Ot: Route[0]: REGISTER comes in from fU 1002
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to