react-native-pjsip icon indicating copy to clipboard operation
react-native-pjsip copied to clipboard

Example of response to 407 Proxy Auth required on INVITE

Open WhiteyDude opened this issue 6 years ago • 7 comments

Fantastic project!

I'm playing with a UAC that requires authentication on INVITE - you send the INVITE and the response is a 407. From there we need to respond to the digest using the nonce and authentication (just the same as normal registration).

Can anyone provide an example or point me in the right direction?

I'm guessing I can do this from the makeCall function in pjsip.js (https://github.com/datso/react-native-pjsip-app/blob/master/app/modules/pjsip.js#L392) by checking the response from endpoint.makeCall, however I'm unsure what to do to resend the INVITE with auth.

Thanks!

WhiteyDude avatar Aug 22 '18 03:08 WhiteyDude

Hey, you want to have a custom action for the response of INVITE ? Doesn't pjsip send another INVITE with authorization header ?

datso avatar Aug 28 '18 14:08 datso

@datso

We're trying to create the correct authorisation header using the nonce and realm which is sent by the SIP server.

PJSIP does send another invite, but it's not with the correct authorisation header.

mdiflorio avatar Aug 28 '18 15:08 mdiflorio

You have custom authorization algorithm ? I cannot get how not with the correct authorization header possible

datso avatar Aug 28 '18 15:08 datso

Perhaps, I've misunderstood how it works. We don't have a custom authorisation algorithm.

My impression was that on INVITE the SIP server sends a 407 Proxy Authentication Requirement, then the PJSIP client uses the nonce and realm along with the user credentials to generate a auth header and the client sends it as a response.

Is there nothing that needs to be done to create the auth header? Is that done automatically using the registered account by PJSIP?

mdiflorio avatar Aug 28 '18 15:08 mdiflorio

Is that done automatically using the registered account by PJSIP?

Yeah it should

datso avatar Aug 28 '18 15:08 datso

I'm stuck on this. When I try to make a call via proxy, the SIP server responds with 407 Proxy Authentication Required and PJSIP drops the call instead of responding with the Proxy-Authenticate header.

Has anyone been able to get this working?

peacefixation avatar Jun 30 '22 07:06 peacefixation

I'm stuck on this. When I try to make a call via proxy, the SIP server responds with 407 Proxy Authentication Required and PJSIP drops the call instead of responding with the Proxy-Authenticate header.

Has anyone been able to get this working?

Same exact issue

Abbe-Engers avatar Feb 05 '23 00:02 Abbe-Engers