anchor.diff:      
   
   %% @doc This function is called by NkSIP to process a new incoming REGISTER request. 
  -%%
  -%% If it is not defined, but `registrar' option was present in the SipApp's 
  -%% startup config, NkSIP will process the request. 
  -%% It will NOT check if <i>From</i> and <i>To</i> headers contains the same URI,
  -%% or if the registered domain is valid or not. If you need to check this,
  -%% implement this function returning `register' if everything is ok.
  -%% See {@link nksip_registrar} for other possible response codes defined in the SIP 
  -%% standard registration process.
  -%%
  -%% `Meta' will include at least the following parameters: app_id, registrar, req
  -%% Parameter `registrar' will be `true' if this `registrar' is present in
  -%% SipApp's config. Parameter `req' will have the full #sipmsg{} object.
  -%%
  -%% If this function is not defined, and no `registrar' option is found, 
  -%% a 405 <i>Method not allowed</i> would be replied. 
  -%%
  -%% You should define this function in case you are implementing a registrar server 
  -%% and need a specific REGISTER processing 
  -%% (for example to add some headers to the response).
  -%%
   -spec sip_register(Req::nksip:request(), Call::nksip:call()) ->
       {reply, nksip:sipreply()} | noreply.
   
  
positive.code: 
  
  %% @doc This function is called by NkSIP to process a new incoming PUBLISH request. 
  %%
  %% `Meta' will include at least the following parameters: app_id, aor, event,
  %% etag, parsed_expires
  %% Parameter `etag' will include the incoming <i>SIP-If-Match</i> header if present.
  %%
  %% If the event package is ok, you can use the funcion {@link nksip_publish:request}
  %% to process it according to RFC3903
  %%
  -spec sip_publish(Req::nksip:request(), Call::nksip:call()) ->
      {reply, nksip:sipreply()} | noreply.
  
  
negative.code:     end.
  
  
  %%%%%%%%%%%%%% gen_server Callbacks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  
  
  %% @doc SipApp initialization.
  %%
  %% This callback function is called when the SipApp is launched using 
  %% {@link nksip:start/4}.
  %%
  %% If `{ok, State}' or `{ok, State, Timeout}' is returned the SipApp is started with
  %% this initial state. If a `Timeout' is provided (in milliseconds) a 
  %% `timeout' message will be sent to the process 
  %% (you will need to implement {@link handle_info/2} to receive it).
  %% If `{stop, Reason}' is returned the SipApp will not start. 
  %%
  -spec init(Args::term()) ->
      {ok, State::term()} | {ok, State::term(), Timeout::timeout()} |
      {stop, Reason::term()}.
  
  init(Arg) ->
      {ok, Arg}.
  
  
  %% @doc Called when the SipApp is stopped.
  -spec terminate(Reason::term(), State::term()) ->
      ok.
  
  terminate(_Reason, _State) ->
      ok.
  
  
  %% @doc Called when a direct call to the SipApp process is made using 
  %% {@link nksip:call/2} or {@link nksip:call/3}.
  -spec handle_call(Msg::term(), From::from(), State::term()) ->
      {reply, Reply::RetType, State::term()} | 
      {reply, Reply::RetType, State::term(), Timeout::timeout()} |
      {noreply, State::term()} | 
      {noreply, State::term(), Timeout::timeout()} |
      {stop, Reason::term(), Reply::RetType, State::term()} | 
      {stop, Reason::term(), State::term()}.
  
  handle_call(Msg, _From, State) ->
      lager:warning("Unexpected handle_call in ~p: ~p", [Msg, ?MODULE]),
  