tags:

views:

72

answers:

1

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  A: 

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.
sipwiz
I'm quite sure the credentials are ok.And its wierd because if the password/username/nonce were not accurate the whole session wont be accepted. Instead i get a good response after trying 4-5 times it depends on pure luck oOHere is a typical log of the communication session:(I changed my host into host.com on the log text)http://pastebin.com/MweshW03
supersk
It looks like your authentication is working to me. The repeated 407's you're getting are re-transmits, you can see which request each 407 is for by looking at the CSeq number. The cause of the re-transmits will be down to the server not accpeting your ACK. The ACk looks ok to me so it's either a bug at the server, a routing issue or a NAT or SIP ALG screwing with your packet.
sipwiz