суббота, 1 февраля 2014 г.

Asterisk 11. Failed to authenticate device

Надоели Failed to authenticate device zxcf<sip:zxcf@ip.ser.vera.com>;tag=483581ae в Asterisk 11.x.0?

cd /usr/src/asterisk-11*

vi channels/chan_sip.c

:? Failed to authenticate device 
меняем следующие строки ( минус - то что было, + на то что надо поменять) 

 примерная строка номер 18520       

   return;

        }        

if (res < 0) { /* Something failed in authentication */ 

-       ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", sip_get_header(req, "From")); 

+         ast_log(LOG_NOTICE, "Failed to authenticate device %s (%s)\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));

           transmit_response(p, "403 Forbidden", req);

           sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);

           return; 

Строка примерно 24616  

      return 0;

        }        if (res < 0) { /* Something failed in authentication */ 

-         ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", sip_get_header(req, "From")); 

+         ast_log(LOG_NOTICE, "Failed to authenticate device %s (%s)\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));

           transmit_response(p, "403 Forbidden", req);

           sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);

           return 0; 

 Строка примерно 25279

           goto request_invite_cleanup;

        }        if (res < 0) { /* Something failed in authentication */ 

-         ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", sip_get_header(req, "From")); 

+         ast_log(LOG_NOTICE, "Failed to authenticate device %s (%s)\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));

           transmit_response_reliable(p, "403 Forbidden", req);

           p->invitestate = INV_COMPLETED;

           sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); 

Строка примерно 27325

      p->lastinvite = seqno;

        return 0;

     } else if (auth_result < 0) { 

-      ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", sip_get_header(req, "From")); 

+      ast_log(LOG_NOTICE, "Failed to authenticate device %s (%s)\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));

        transmit_response(p, "403 Forbidden", req);

        sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);        ast_string_field_set(p, theirtag, NULL);

  

Строка примерно 27540

      if (res == AUTH_CHALLENGE_SENT)   /* authpeer = NULL here */           return 0;

        if (res != AUTH_SUCCESSFUL) { 

-         ast_log(LOG_NOTICE, "Failed to authenticate device %s for SUBSCRIBE\n", sip_get_header(req, "From")); 

+         ast_log(LOG_NOTICE, "Failed to authenticate device %s for SUBSCRIBE (%s)\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));

           transmit_response(p, "403 Forbidden", req);

           pvt_set_needdestroy(p, "authentication failed");

 

Строки Failed to authenticate device on .... менять не нужно

Комментариев нет:

Отправить комментарий