0
votes

After sending an INVITE request I receive a trying answer, and immidietly after that I receive error 407 (proxy authentication required). After sending ACK & another INVITE with the proxy header I receive session progress about 1/4 of the time! Other times it just sends 407 error again & again.

Any ideas?

1
Getting the Trying's normal. If you keep getting 407s, are you sure you're sending the correct credentials? What are the Reason-Phrases of the 183s? What do the subsequent 407s look like? (In particular, are they different from the first?) (And take a good look at RFC 2617.)Frank Shearar

1 Answers

1
votes

The 407 responses are part of the SIP challenge-response authentication mechanism, see this SIP INVITE example.

If you get a 407 response to an INVITE request that you HAVE sent with an authentication header (for example WWW-Authenticate) it means the SIP server that received the request was not happy with it and wants you to try again. Common reasons for the authentication header failing are:

  • Wrong password,
  • Wrong or stale nonce. The first INVITE is usually sent without an authenitcation header and the 407 response contains the nonce that should be used in the susbsequent authenticated INVITE request,
  • A bug in the code that's constructing the authentication header,
  • A non-existent username, although in this case most SIP servers will respond with a 403 Forbidden or 404 Not Found response.