<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello, using opensips3.1 I don't arrive at catching event
      E_UL_CONTACT_INSERT. <br>
    </p>
    <p>As you can see in below logs, <br>
    </p>
    <p>the route seems to be correctly armed, but the event is not
      triggered on the registration of the user. <br>
    </p>
    <p>Can somebody give a hint on what I am overlooking ? <br>
    </p>
    <p>Do I need to enable the events in usrloc ? <br>
    </p>
    <p><br>
    </p>
    <p>wkr, <br>
    </p>
    <p>    xlog("callid=$ci: Route[userlocation]:avp(messagepn)
      [$avp(messagepn)] avp(callpn) [$avp(callpn)]");<br>
          if (($avp(callpn)!="null") or ($avp(messagepn)!=null))<br>
          {<br>
              xlog("callid=$ci: Route[userlocation]:we call t_newtran
      and subscribe for E_UL_CONTACT_INSERT");<br>
              # prepare transaction for branch injection; it is
      mandatory<br>
              # to create the transaction before the subscription,
      otherwise<br>
              # the EBR module will not pass the transaction ID into the<br>
              # notification route<br>
              t_newtran();<br>
              # keep the transaction alive (even if all branches will <br>
              # terminate) until the FR INVITE timer hits (we want to
      wait<br>
              # for new possible contacts being registered)<br>
              t_wait_for_new_branches();<br>
              # subscribe to new contact registration event,<br>
              # but for our callee only<br>
              <b>$avp(filter) = "aor=" + $tU + "@" + $td;</b><br>
              #$avp(filter) = "aor=*";<br>
              xlog("callid=$ci: Route[userlocation]: filter avp(filter)
      [$avp(filter)]");<br>
              async( wait_for_event("E_UL_CONTACT_INSERT",$avp(filter),
      40), "fork_call");<br>
             
      #notify_on_event("E_UL_CONTACT_INSERT",$avp(filter),"fork_call",
      "180");<br>
          }<br>
    </p>
    <p><br>
      route[fork_call]<br>
      {<br>
          xlog("callid=$ci: Route[fork_call]:user $avp(aor) registered a
      new contact $avp(uri), injecting\n");<br>
          # take the contact described by the E_UL_CONTACT_INSERT<br>
          # event and inject it as a new branch into the original<br>
          # transaction<br>
          t_inject_branches("event");<br>
      }</p>
    <p><br>
    </p>
    <p>route[0]</p>
    <p>{</p>
    <p>... <br>
    </p>
    <p>    if (is_method("REGISTER"))<br>
          {<br>
              #TLS<br>
              if (isflagset("SRC_TLS"))<br>
              {<br>
                  setbflag("DST_TLS");<br>
              }<br>
              #TLS end TLS<br>
              if (!www_authorize("", "subscriber"))<br>
              {<br>
                  www_challenge("", "auth");<br>
                  exit;<br>
              }<br>
              <br>
              if (!save("location")){            <br>
                  sl_reply_error();<br>
                  exit;<br>
              }<br>
              xlog("callid=$ci: Route[0]: REGISTER comes in from fU
      $fU");<br>
              exit;<br>
          }<br>
      }<br>
    </p>
    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<br>
    Aug 21 12:53:09 ns365555 /data/opensips/sbin/opensips[18730]:
    callid=AmrM407AUsLjipDqbtNFjQ..: Route[userlocation]: filter
    avp(filter) [<a class="moz-txt-link-abbreviated" href="mailto:aor=1002@46.105.105.119">aor=1002@46.105.105.119</a>]<br>
    Aug 21 12:53:11 ns365555 /data/opensips/sbin/opensips[18729]:
    callid=KFzAmny6Ot: Route[0]: REGISTER comes in from fU 1002<br>
  </body>
</html>