Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
407 Proxy Authentication Required on BYE
Author Message
dstu
Brekeke Talented


Joined: 06 Feb 2006
Posts: 72

PostPosted: Wed Oct 14, 2015 9:24 pm    Post subject: 407 Proxy Authentication Required on BYE Reply with quote

1. Brekeke Product Name and Version:
Brekeke SIP Server , Version 3.2.4.3 Advanced

2. Java version:
1.7.0_40

3. OS type and the version:
Linux 3.2.0-4-686-pae (Debian)

4. UA (phone), gateway or other hardware/software involved:
Asterisk

5. Your problem:
I'm using The Brekeke proxy for through Registration. Asterisk registers to the Brekeke and I use the following rule to register to the ITSP (keyyo):
Matching Patterns
$request = ^REGISTER
To = sip:(33175XXXXXX)@

Deploy Patterns
To = sip:%1@keyyo.net


Then, I use this rule to route the incoming calls to another server in my LAN:
Matching Patterns
$request = ^INVITE
$addr = xx.xxx.xx[1-4]..{1,3}
To = sip:(331.{8})@

Deploy Patterns
To = sip:%1@ivr1
$session = failover sip:%1@ivr2 sip:%1@ivr3


The problem is that when the ITSP sends a call to the registered number, if my IVR is the one that ends the call, they reject the BYE and send a "407 Proxy Authentication Required" request.

In the next BYE, I send it, but the username we send is empty, so it's rejected again:
Code:
Proxy-Authorization: Digest username="",realm="keyyo.net",nonce="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",uri="sip:33177YYYYYYYY@ZZ.ZZ.ZZ.ZZ:5060",response="NNNNNNNNNNNNNNNNNNNNNN",algorithm=MD5,cnonce="SSSSSSS",qop=auth,nc=00000001.


How can I fix that?

Thanks,

David
Back to top
View user's profile
Tata
Brekeke Master Guru


Joined: 27 Jan 2008
Posts: 223

PostPosted: Thu Oct 15, 2015 11:40 am    Post subject: Reply with quote

> The problem is that when the ITSP sends a call to the registered number, if my IVR is the one that ends the call, they reject the BYE and send a "407 Proxy Authentication Required" request.


Are you using Asterisk as IVR?
Does it send BYE to the ITSP through the Brekeke?
And then the ITSP rejected the BYE with "407"? Is it correct?
Back to top
View user's profile
Tata
Brekeke Master Guru


Joined: 27 Jan 2008
Posts: 223

PostPosted: Thu Oct 15, 2015 11:41 am    Post subject: Reply with quote

> The problem is that when the ITSP sends a call to the registered number, if my IVR is the one that ends the call, they reject the BYE and send a "407 Proxy Authentication Required" request.


Are you using Asterisk as IVR?
Does it send BYE to the ITSP through the Brekeke?
And then the ITSP rejected the BYE with "407"? Is it correct?
Back to top
View user's profile
dstu
Brekeke Talented


Joined: 06 Feb 2006
Posts: 72

PostPosted: Fri Oct 16, 2015 6:52 am    Post subject: Reply with quote

Tata wrote:

Are you using Asterisk as IVR?
Does it send BYE to the ITSP through the Brekeke?


No. Asterisk sends the REGISTERs that the Brekeke forwards. The IVR is a separate machine that gets the incoming calls and sends the BYE.

Tata wrote:

And then the ITSP rejected the BYE with "407"? Is it correct?

Yes. That's exactly what happens
Back to top
View user's profile
Tata
Brekeke Master Guru


Joined: 27 Jan 2008
Posts: 223

PostPosted: Fri Oct 16, 2015 10:12 am    Post subject: Reply with quote

Since the ITSP returned "407" to request a credential, the IVR should retries BYE with the credential.

but.. it seems the IVR doesn't know the username/password because the REGISTER was generated by the Asterisk.

so is it possible to forward a call through Asterisk?
I mean that Brekeke forwards ITSP's incoming call to the Asterisk (instead of the IVR directly) and then the Asterisk forwards the call to the IVR. If so, the Asterisk might handle "407".

Are you using the Asterisk for registration purpose only?
Back to top
View user's profile
dstu
Brekeke Talented


Joined: 06 Feb 2006
Posts: 72

PostPosted: Tue Oct 20, 2015 5:27 am    Post subject: Reply with quote

Tata wrote:
Since the ITSP returned "407" to request a credential, the IVR should retries BYE with the credential.

but.. it seems the IVR doesn't know the username/password because the REGISTER was generated by the Asterisk.

so is it possible to forward a call through Asterisk?
I mean that Brekeke forwards ITSP's incoming call to the Asterisk (instead of the IVR directly) and then the Asterisk forwards the call to the IVR. If so, the Asterisk might handle "407".

Are you using the Asterisk for registration purpose only?


You're absolutely right. I tried that and then I also tried from the Asterisk to the ITSP directly. Regardless of the username I sent in the digest, it kept insisting on sending 407s to my BYEs.

I gave up on this provider. Their support was answering me things I told them. I think they do that on purpose to limit asterisk connections.

Thanks for your advice.

David
Back to top
View user's profile
Tata
Brekeke Master Guru


Joined: 27 Jan 2008
Posts: 223

PostPosted: Tue Oct 20, 2015 11:21 am    Post subject: Reply with quote

I think Asterisk supports BYE's authentication.

Does the Asterisk retries BYE with the Proxy-Authorization: or Authorization: header?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1