anchor.diff:      ok.
   
   launch_unregister(AppId, Reg)->
  +
  +    lager:warning("LAUNCH UNREGISTER"),
  +
       #sipreg{
           ruri = RUri,
           opts = Opts, 
           cseq = CSeq,
           call_id = CallId,
  -        pid = Pid
  +        conn_pid = Pid
       } = Reg,
       Opts1 = [
           make_contact, {call_id, CallId}, {cseq, CSeq}, {expires, 0}
  
positive.code: 
  %% @private
  terminate(_Reason, #state{app_id=AppId, regs=Regs}) ->  
      lists:foreach(fun(Reg) -> launch_unregister(AppId, Reg) end, Regs).
  
  
  
negative.code:     end,
      {Proto, Ip, Port} = nksip_lib:get_value(remote, Meta),
      Require = nksip_lib:get_value(parsed_require, Meta),
      % 'fails' is not updated until the connection confirmation arrives
      % (or process down)
      Reg1 = Reg#sipreg{
          ok = true,
          cseq = nksip_lib:get_value(cseq_num, Meta) + 1,
          from = undefined,
          next = nksip_lib:timestamp() + Interval
      },
      case lists:member(<<"outbound">>, Require) of
          true ->
              case nksip_transport:get_connected(AppId, Proto, Ip, Port) of
                  [{_, Pid}|_] -> 
                      Secs = case nksip_lib:get_integer(<<"Flow-Timer">>, Meta) of
                          FT when FT > 5 -> FT;
                          _ when Proto==udp -> ?DEFAULT_UDP_KEEPALIVE;
                          _ -> ?DEFAULT_TCP_KEEPALIVE
                      end,
                      Ref = {'$nksip_register_notify', RegId},
                      case nksip_transport_conn:start_refresh(Pid, Secs, Ref) of
                          ok -> 
                              Mon = erlang:monitor(process, Pid),
                              Reg1#sipreg{conn_monitor=Mon, conn_pid=Pid};
                          _ -> 
                              Reg1
                      end;
                  [] -> 
                      Reg1
              end;
          false ->
              Reg1
      end;
  
  update_register(Reg, Code, Meta, #state{app_id=AppId, base_time=BaseTime}) ->
      #sipreg{conn_monitor=Monitor, fails=Fails, from=From} = Reg,
      case From of
          undefined -> ok;
          _ -> gen_server:reply(From, {ok, false})
  