datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
271 stars 227 forks source link

Example of response to 407 Proxy Auth required on INVITE #120

Open WhiteyDude opened 5 years ago

WhiteyDude commented 5 years ago

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!

datso commented 5 years ago

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

mdiflorio commented 5 years ago

@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.

datso commented 5 years ago

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

mdiflorio commented 5 years ago

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?

datso commented 5 years ago

Is that done automatically using the registered account by PJSIP?

Yeah it should

peacefixation commented 2 years ago

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?

Abbe-Engers commented 1 year ago

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