anchor.diff:      end.
   
   
  +
  +%% @private
  +-spec parse_id(nksip:id()) ->
  +    {nksip:app_id(), id(), nksip_dialog:id(), nksip:call_id()}.
  +
  +parse_id(<<"U_", SubsId:6/binary, $_, DialogId:6/binary, $_, App:7/binary, 
  +         $_, CallId/binary>>) ->
  +    AppId = binary_to_existing_atom(App, latin1),
  +    {AppId, SubsId, DialogId, CallId}. 
  +
  +
   %% @private
   -spec make_id(nksip:request()) ->
       id().
  
positive.code: make_id(#sipmsg{event={Event, Opts}}) ->
      Id = nksip_lib:get_value(<<"id">>, Opts),
      nksip_lib:hash({Event, Id}).
  
  
  
  % %% @private
  % -spec id(nksip:request()|nksip:response()) ->
  %     nksip:id().
  
  % id(#sipmsg{cseq={CSeq, 'REFER'}, dialog_id=DialogId}) ->
  %     Event = {<<"refer">>, [{<<"id">>, nksip_lib:to_binary(CSeq)}]},
  %     get_id(Event, DialogId);
  
  % id(#sipmsg{event = Event, dialog_id = <<"D_", _/binary>>=DialogId}) ->
  %     get_id(Event, DialogId).
  
  
  
  %% @private Finds a event.
  
negative.code:         throw:invalid -> invalid
      end.
  
  
  
  