anchor.diff:              false
       end.
       
  +default_value(Name, Data, Default) ->
  +    case lists:keysearch(Name, 1, Data) of
  +        {value, {_, Possible}} ->
  +            case is_list(Possible) of
  +                true -> Possible;
  +                _    -> Default
  +            end;
  +        _ ->
  +            Default
  +    end.
  +    
   process_request(Request, IP) ->
       {_, _, Response} = ejabberd_http_bind:process_request(Request, IP),
       xml_stream:parse_element(lists:flatten(Response)).
  
positive.code:             {value,{_,Pass}} = lists:keysearch(password, 1, DecodedData),
              case is_list(SJID) andalso is_list(Pass) of
                  true  ->
                      case bind(SJID, Pass, IP) of
                          false   -> badrequest();
                          Binding -> success(Binding)
                      end;
  
negative.code:             unauthorized
      end.
      
  bind(SJID, Password, IP, Data) ->
      #jid{user = User, server = Server, resource = Resource} = jlib:string_to_jid(SJID),
      
      Lang        = default_value( lang,         Data, ?LANG         ),
      Wait        = default_value( wait,         Data, ?WAIT         ),
      Hold        = default_value( hold,         Data, ?HOLD         ),
      Window      = default_value( window,       Data, ?WINDOW       ),
      Content     = default_value( content,      Data, ?CONTENT      ),
      Ver         = default_value( ver,          Data, ?VER          ),
      XMPPVersion = default_value( xmpp_version, Data, ?XMPP_VERSION ),
      
      RidSessionCreate  = list_to_integer(randoms:get_string()),
      RidAuth           = RidSessionCreate  + 1,
      RidSessionRestart = RidAuth           + 1,
  