S
S
Sergey2015-10-13 14:19:08
PHP
Sergey, 2015-10-13 14:19:08

Can't write authorization for sip-proxy?

Authorization in sip proxy does not pass. Here is the code.

$nc = 00000001;
        $clnonce = md5($nonce);
        $A1 = md5($this->username . ':' . $realm . ':' . $this->password);
        $A2 = md5($this->method . ':' . $this->uri);
        $valid_response = md5($A1 . ':' . $nonce . ':' . $nc . ':' . $clnonce . ':' . $qop . ':' . $A2);
        ///////////
        $this->auth = 'Proxy-Authorization: Digest username="' . $this->username . '",realm="' . $realm . '",nonce="' . $nonce . '",uri="' . $this->uri . '",response="' . $valid_response . '",cnonce="' . $clnonce . '",nc='.$nc.',qop=' . $qop . ',algorithm=md5,opaque="' . $opaque;

The digest is calculated as follows: $valid_response = md5($A1 . ':' . $nonce . ':' . $nc . ':' . $clnonce . ':' . $qop . ':' . $A2);
But apparently he is not correct. Maybe someone knows the rules of the digest scheme?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2015-10-13
@r3l0c

better to look here and around

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question