Cursos Asterisk en México

SIP/2.0 401 Unauthorized

Colapsar

Anuncio

Colapsar
No hay anuncio todavía.
X
 
  • Filtrar
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes

  • SIP/2.0 401 Unauthorized

    Hola a todos! Tengo un problema que literalmente me esta volviendo loco.

    Este es el panorama.

    1 Servidor Asterisk 1.6 (Core)
    Telefonos Cisco SPA 301

    Tengo unas VPN entre las sucursales con Fortigate 60c.

    El problema es un error SIP/2.0 401 Unauthorized. Lo confuso es que si tengo 2 usuarios en la VPN uno se conecta y el otro no y en algunas estaciones ninguno, y en otras los dos si se conectan sin ningun problema, las configuraciones de los telefonos y usuarios sip sn identicas y si tomo un usuario que no se conecte y lo pruebo con un softphone dentro de la red local de asterisk, este se conecta sin ningun problema.

    Les paso mi debug y configuracion.

    <------------>
    Scheduling destruction of SIP dialog 'db9c8273-d5d7e108@192.168.0.105' in 32000 ms (Method: REGISTER)

    <--- SIP read from UDP:192.168.0.105:5060 --->
    REGISTER sip:10.1.11.6:6512 SIP/2.0
    Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK-99533825
    From: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=cdd23179640b94ebo0
    To: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>
    Call-ID: db9c8273-d5d7e108@192.168.0.105
    CSeq: 35766 REGISTER
    Max-Forwards: 70
    Contact: "Eco Toreo" <sip:ECOTJTOR@192.168.0.105:5060>;expires=3600
    User-Agent: Cisco/SPA301-7.5.2b
    Content-Length: 0
    Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE
    Supported: replaces


    <------------->
    --- (12 headers 0 lines) ---
    Sending to 192.168.0.105 : 5060 (NAT)

    <--- Transmitting (NAT) to 192.168.0.105:5060 --->
    SIP/2.0 401 Unauthorized
    Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK-99533825;received=192.168.0.105
    From: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=cdd23179640b94ebo0
    To: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=as1f3fbb2c
    Call-ID: db9c8273-d5d7e108@192.168.0.105
    CSeq: 35766 REGISTER
    Server: Asterisk PBX 1.6.2.17.2
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
    Supported: replaces, timer
    WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="29943bbb"
    Content-Length: 0


    ------------------
    SIP.CONF

    [general]
    context=ECO
    allowoverlap=yes
    disallow=all
    allow=ulaw
    allow=alaw
    bindaddr=0.0.0.0


    [ECOTJTOR]
    deny=0.0.0.0/0.0.0.0
    dtmfmode=rfc2833
    canreinvite=no
    type=friend
    username=ECOTJTOR
    secret=123456
    host=dynamic
    nat=yes
    qualify=yes
    port=5060
    permit=0.0.0.0/0.0.0.0
    context=ECO

    [ECOTJVR]
    deny=0.0.0.0/0.0.0.0
    dtmfmode=rfc2833
    canreinvite=no
    type=friend
    username=ECOTJVR
    secret=123456
    host=dynamic
    nat=yes
    qualify=yes
    port=5060
    permit=0.0.0.0/0.0.0.0
    context=ECO

  • #2
    Re: SIP/2.0 401 Unauthorized

    El primer SIP/2.0 401 Unauthorized es normal en una transacción SIP, este envía el "nonce" para calcular el md5 y así validar a la extensión correctamente.

    Podrías poner el debug completo? Si ese es todo tu debug entonces quiere decir que tu teléfono jamas responde con las credenciales a tu PBX, por lo que el problema estará en las configuraciones NAT del PBX y/o de las rutas del router.

    Comentario


    • #3
      Re: SIP/2.0 401 Unauthorized

      Me inclino a pensar que es un problema de enrutamiento. ¿Puedes hacer ping en ambos sentidos? Creo que como dice navaismo, tus teléfonos nunca responden después de recibir el challenge de parte de Asterisk, lo que podría ocasionar que falle.
      dCAP Christian Cabrera R.
      Para aprender a usar Asterisk, asiste a uno de mis cursos Asterisk
      Si deseas asesoría pagada, por favor contáctame

      Comentario


      • #4
        Re: SIP/2.0 401 Unauthorized

        Si hay ping en ambos lados!
        Y lo confuso, es que en una misma estacion, uno si se conecta sin ningun problema y el otro, me da el 401...

        Comentario


        • #5
          Re: SIP/2.0 401 Unauthorized

          <------------>
          Scheduling destruction of SIP dialog 'db9c8273-d5d7e108@192.168.0.105' in 32000 ms (Method: REGISTER)

          <--- SIP read from UDP:192.168.0.105:5060 --->
          REGISTER sip:10.1.11.6:6512 SIP/2.0
          Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK-99533825
          From: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=cdd23179640b94ebo0
          To: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>
          Call-ID: db9c8273-d5d7e108@192.168.0.105
          CSeq: 35766 REGISTER
          Max-Forwards: 70
          Contact: "Eco Toreo" <sip:ECOTJTOR@192.168.0.105:5060>;expires=3600
          User-Agent: Cisco/SPA301-7.5.2b
          Content-Length: 0
          Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE
          Supported: replaces


          <------------->
          --- (12 headers 0 lines) ---
          Sending to 192.168.0.105 : 5060 (NAT)

          <--- Transmitting (NAT) to 192.168.0.105:5060 --->
          SIP/2.0 401 Unauthorized
          Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK-99533825;received=192.168.0.105
          From: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=cdd23179640b94ebo0
          To: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=as1f3fbb2c
          Call-ID: db9c8273-d5d7e108@192.168.0.105
          CSeq: 35766 REGISTER
          Server: Asterisk PBX 1.6.2.17.2
          Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
          Supported: replaces, timer
          WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="29943bbb"
          Content-Length: 0


          <------------>
          Scheduling destruction of SIP dialog 'db9c8273-d5d7e108@192.168.0.105' in 32000 ms (Method: REGISTER)
          Reliably Transmitting (NAT) to 10.1.11.107:5060:
          OPTIONS sip:ECOTJINSU@10.1.11.107:5060 SIP/2.0
          Via: SIP/2.0/UDP 10.1.11.6:6512;branch=z9hG4bK4fab7401;rport
          Max-Forwards: 70
          From: "asterisk" <sip:asterisk@10.1.11.6:6512>;tag=as0b6fe338
          To: <sip:ECOTJINSU@10.1.11.107:5060>
          Contact: <sip:asterisk@10.1.11.6:6512>
          Call-ID: 44716c9f534c2e3e7a6dcc1d6cfcd551@10.1.11.6
          CSeq: 102 OPTIONS
          User-Agent: Asterisk PBX 1.6.2.17.2
          Date: Fri, 10 Aug 2012 21:05:37 GMT
          Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
          Supported: replaces, timer
          Content-Length: 0


          ---
          Retransmitting #1 (NAT) to 10.1.11.107:5060:
          OPTIONS sip:ECOTJINSU@10.1.11.107:5060 SIP/2.0
          Via: SIP/2.0/UDP 10.1.11.6:6512;branch=z9hG4bK4fab7401;rport
          Max-Forwards: 70
          From: "asterisk" <sip:asterisk@10.1.11.6:6512>;tag=as0b6fe338
          To: <sip:ECOTJINSU@10.1.11.107:5060>
          Contact: <sip:asterisk@10.1.11.6:6512>
          Call-ID: 44716c9f534c2e3e7a6dcc1d6cfcd551@10.1.11.6
          CSeq: 102 OPTIONS
          User-Agent: Asterisk PBX 1.6.2.17.2
          Date: Fri, 10 Aug 2012 21:05:37 GMT
          Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
          Supported: replaces, timer
          Content-Length: 0


          ---
          Retransmitting #2 (NAT) to 10.1.11.107:5060:
          OPTIONS sip:ECOTJINSU@10.1.11.107:5060 SIP/2.0
          Via: SIP/2.0/UDP 10.1.11.6:6512;branch=z9hG4bK4fab7401;rport
          Max-Forwards: 70
          From: "asterisk" <sip:asterisk@10.1.11.6:6512>;tag=as0b6fe338
          To: <sip:ECOTJINSU@10.1.11.107:5060>
          Contact: <sip:asterisk@10.1.11.6:6512>
          Call-ID: 44716c9f534c2e3e7a6dcc1d6cfcd551@10.1.11.6
          CSeq: 102 OPTIONS
          User-Agent: Asterisk PBX 1.6.2.17.2
          Date: Fri, 10 Aug 2012 21:05:37 GMT
          Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
          Supported: replaces, timer
          Content-Length: 0


          ---

          <--- SIP read from UDP:192.168.0.105:5060 --->
          REGISTER sip:10.1.11.6:6512 SIP/2.0
          Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK-99533825
          From: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=cdd23179640b94ebo0
          To: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>
          Call-ID: db9c8273-d5d7e108@192.168.0.105
          CSeq: 35766 REGISTER
          Max-Forwards: 70
          Contact: "Eco Toreo" <sip:ECOTJTOR@192.168.0.105:5060>;expires=3600
          User-Agent: Cisco/SPA301-7.5.2b
          Content-Length: 0
          Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE
          Supported: replaces


          <------------->
          --- (12 headers 0 lines) ---
          Sending to 192.168.0.105 : 5060 (NAT)

          <--- Transmitting (NAT) to 192.168.0.105:5060 --->
          SIP/2.0 401 Unauthorized
          Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK-99533825;received=192.168.0.105
          From: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=cdd23179640b94ebo0
          To: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=as1f3fbb2c
          Call-ID: db9c8273-d5d7e108@192.168.0.105
          CSeq: 35766 REGISTER
          Server: Asterisk PBX 1.6.2.17.2
          Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
          Supported: replaces, timer
          WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="29943bbb"
          Content-Length: 0


          <------------>
          Scheduling destruction of SIP dialog 'db9c8273-d5d7e108@192.168.0.105' in 32000 ms (Method: REGISTER)
          Retransmitting #3 (NAT) to 10.1.11.107:5060:
          OPTIONS sip:ECOTJINSU@10.1.11.107:5060 SIP/2.0
          Via: SIP/2.0/UDP 10.1.11.6:6512;branch=z9hG4bK4fab7401;rport
          Max-Forwards: 70
          From: "asterisk" <sip:asterisk@10.1.11.6:6512>;tag=as0b6fe338
          To: <sip:ECOTJINSU@10.1.11.107:5060>
          Contact: <sip:asterisk@10.1.11.6:6512>
          Call-ID: 44716c9f534c2e3e7a6dcc1d6cfcd551@10.1.11.6
          CSeq: 102 OPTIONS
          User-Agent: Asterisk PBX 1.6.2.17.2
          Date: Fri, 10 Aug 2012 21:05:37 GMT
          Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
          Supported: replaces, timer
          Content-Length: 0


          ---
          Retransmitting #4 (NAT) to 10.1.11.107:5060:
          OPTIONS sip:ECOTJINSU@10.1.11.107:5060 SIP/2.0
          Via: SIP/2.0/UDP 10.1.11.6:6512;branch=z9hG4bK4fab7401;rport
          Max-Forwards: 70
          From: "asterisk" <sip:asterisk@10.1.11.6:6512>;tag=as0b6fe338
          To: <sip:ECOTJINSU@10.1.11.107:5060>
          Contact: <sip:asterisk@10.1.11.6:6512>
          Call-ID: 44716c9f534c2e3e7a6dcc1d6cfcd551@10.1.11.6
          CSeq: 102 OPTIONS
          User-Agent: Asterisk PBX 1.6.2.17.2
          Date: Fri, 10 Aug 2012 21:05:37 GMT
          Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
          Supported: replaces, timer
          Content-Length: 0


          ---
          Really destroying SIP dialog '44716c9f534c2e3e7a6dcc1d6cfcd551@10.1.11.6' Method: OPTIONS

          <--- SIP read from UDP:192.168.0.105:5060 --->
          REGISTER sip:10.1.11.6:6512 SIP/2.0
          Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK-99533825
          From: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=cdd23179640b94ebo0
          To: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>
          Call-ID: db9c8273-d5d7e108@192.168.0.105
          CSeq: 35766 REGISTER
          Max-Forwards: 70
          Contact: "Eco Toreo" <sip:ECOTJTOR@192.168.0.105:5060>;expires=3600
          User-Agent: Cisco/SPA301-7.5.2b
          Content-Length: 0
          Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE
          Supported: replaces


          <------------->
          --- (12 headers 0 lines) ---
          Sending to 192.168.0.105 : 5060 (NAT)

          <--- Transmitting (NAT) to 192.168.0.105:5060 --->
          SIP/2.0 401 Unauthorized
          Via: SIP/2.0/UDP 192.168.0.105:5060;branch=z9hG4bK-99533825;received=192.168.0.105
          From: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=cdd23179640b94ebo0
          To: "Eco Toreo" <sip:ECOTJTOR@10.1.11.6>;tag=as1f3fbb2c
          Call-ID: db9c8273-d5d7e108@192.168.0.105
          CSeq: 35766 REGISTER
          Server: Asterisk PBX 1.6.2.17.2
          Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
          Supported: replaces, timer
          WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="29943bbb"
          Content-Length: 0

          Comentario


          • #6
            Re: SIP/2.0 401 Unauthorized

            Veo retransmisiones en el debug lo que puede indicar que el problema esta entre las rutas de contacto. Tienes definidas las vpn como localnet?

            Comentario


            • #7
              Re: SIP/2.0 401 Unauthorized

              Ya intente definiendo las vpn localnet.192.168.0.0/255.255.255.0 y tambien con el localnet=0.0.0.0/0.0.0.0 .. sigo teniendo el mismo error. Gracias por su tiempo!

              Comentario


              • #8
                Re: SIP/2.0 401 Unauthorized

                Puedes revisar que no este habilitada la opcion SIP ALG en los ruteadores que estan involucrados.

                Como es la topologia de la red que involucra esas extensiones? El ruteo lo haces en el pbx añadiendo rutas estaticas o lo hacen los ruteadores? Lo que veo es que despues del register se pierde el contacto entre PBX y extension.

                Comentario


                • #9
                  Re: SIP/2.0 401 Unauthorized

                  1

                  Comentario


                  • #10
                    Re: SIP/2.0 401 Unauthorized

                    Gracias por su ayuda!
                    Di con el clavo.. definitivamente como ustedes comentaban era un problema de red, sin embargo se hacia muy confuso ya que algunos telefonos provenientes de la misma red se firmaban y otros simplemente no.
                    Utilizan un fortigate 60c, y resulta que platicando con un colega que trabaja Fortinet, me comento que los nuevos productos fortinet estan diseñados para incorporar un sistema de VOIP por medio de SIP de la misma marca, por default vienen con el session-helper del protocolo sip activado, lo que "segun" ellos va a rutear el trafico SIP, pero pues no funciona muy bien ya que algunas sesiones las firma y otras las filtra y por consecuencia las bloquea, "NO se que criterio utiliza para filtrar y dejar pasar unos si y unos no." en fin por medio de la consola de comando en el fortigate lo desactive, borrando la linea del protocolo sip en el session-helper. Se reinicio el Firewall principal que hospeda las VPN y wala! se firmaron todos los telefonos... Lo que me dio una gran satisfaccion!! Me esta volviendo loco con este problema... ya estaba buscando chamba de barrendero o algo asi.. de tanto stress.. jaja ... Gracias por su ayuda!

                    Comentario

                    Principales Usuarios Activos

                    Colapsar

                    No hay usuarios activos superiores.
                    Trabajando...
                    X