Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Proxy authorization


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
dmitry.bely at gmail.com
Guest





PostPosted: Thu Sep 03, 2009 4:17 pm    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

Hi,

My SIP provider's gateway requires authorization with correct realm
specified. So I configured gateway with "realm" parameter:

<gateway name="$${default_provider}">
<param name="username" value="$${default_provider_username}"/>
<param name="password" value="$${default_provider_password}"/>
<param name="from-user" value="$${default_provider_username}"/>
<param name="from-domain" value="$${default_provider_from_domain}"/>
<param name="realm" value="$${default_provider_from_domain}"/>
<param name="proxy" value="$${default_provider}"/>
<param name="expire-seconds" value="600"/>
<param name="register" value="$${default_provider_register}"/>
<param name="retry-seconds" value="30"/>
<param name="extension" value="$${default_provider_contact}"/>
<!--<param name="contact-params" value="domain_name=$${domain}"/>-->
<param name="context" value="public"/>
</gateway>

(default_provider_register = true)

Unfortunately even after that there is no "Authorization:" header in
the REGISTER message:

REGISTER sip:1.2.3.4 SIP/2.0
Via: SIP/2.0/UDP 5.6.7.8:5080;rport;branch=z9hG4bKNBB3ygD85y3eF
Max-Forwards: 70
From: <sip:1111111@Domain;transport=udp>;tag=Nrc6Z9yrNBS3H
To: <sip:1111111@Domain;transport=udp>
Call-ID: a93d949a-98c1-11de-b6b8-8321249ad8d4
CSeq: 119885384 REGISTER
Contact: <sip:gw+1.2.3.4@5.6.7.8:5080;transport=udp>
Expires: 600
User-Agent: FreeSWITCH-mod_sofia/1.0.trunk-14707M
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO,
REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
Content-Length: 0

and the provider responds with 403 User '1111111' is disabled (as
there is no correct authorization realm there). How to force
Authorization header? Am I missing something?

- Dmitry Bely

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Thu Sep 03, 2009 4:28 pm    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

There will not be an authorization header on the first register attempt... it only happens once we are 401/407'ed and the phone comes back and registers again.

/b

On Sep 3, 2009, at 3:26 PM, Dmitry Bely wrote:
Quote:
Unfortunately even after that there is no "Authorization:" header in
the REGISTER message:

REGISTER [url=sip:1.2.3.4]sip:1.2.3.4[/url] SIP/2.0
Via: SIP/2.0/UDP 5.6.7.8:5080;rport;branch=z9hG4bKNBB3ygD85y3eF
Max-Forwards: 70
From: <[url=sip:1111111@Domain;transport=udp]sip:1111111@Domain;transport=udp[/url]>;tag=Nrc6Z9yrNBS3H
To: <[url=sip:1111111@Domain;transport=udp]sip:1111111@Domain;transport=udp[/url]>
Call-ID: a93d949a-98c1-11de-b6b8-8321249ad8d4
CSeq: 119885384 REGISTER
Contact: <[url=sip:gw+1.2.3.4@5.6.7.8:5080;transport=udp]sip:gw+1.2.3.4@5.6.7.8:5080;transport=udp[/url]>
Expires: 600
User-Agent: FreeSWITCH-mod_sofia/1.0.trunk-14707M
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO,
REGISTER, REFER, NOTIFY
Supported: timer, precondition, path, replaces
Content-Length: 0
Back to top
dmitry.bely at gmail.com
Guest





PostPosted: Fri Sep 04, 2009 3:48 am    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

On Fri, Sep 4, 2009 at 1:19 AM, Brian West<brian@freeswitch.org> wrote:
Quote:
There will not be an authorization header on the first register attempt...
it only happens once we are 401/407'ed and the phone comes back and
registers again.
/b

Alas, I cannot change the way the provider's gateway works. It
immediately responses with 403... BTW, it's Mera Damos
(http://www.mera-systems.com ?). No workaround possible?

Quote:
On Sep 3, 2009, at 3:26 PM, Dmitry Bely wrote:

Unfortunately even after that there is no "Authorization:" header in
the REGISTER message:

  REGISTER sip:1.2.3.4 SIP/2.0
  Via: SIP/2.0/UDP 5.6.7.8:5080;rport;branch=z9hG4bKNBB3ygD85y3eF
  Max-Forwards: 70
  From: <sip:1111111@Domain;transport=udp>;tag=Nrc6Z9yrNBS3H
  To: <sip:1111111@Domain;transport=udp>
  Call-ID: a93d949a-98c1-11de-b6b8-8321249ad8d4
  CSeq: 119885384 REGISTER
  Contact: <sip:gw+1.2.3.4@5.6.7.8:5080;transport=udp>
  Expires: 600
  User-Agent: FreeSWITCH-mod_sofia/1.0.trunk-14707M
  Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO,
REGISTER, REFER, NOTIFY
  Supported: timer, precondition, path, replaces
  Content-Length: 0

- Dmitry Bely

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 04, 2009 7:58 am    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

I cannot change the way SIP Authentication works. The first register is always sent without an authorization header then is challenged. If you're getting an instant 403 then you have something wrong in your config and the remote system doesn't like it. Please contact your provider and ask them to troubleshoot it with you.

/b

On Sep 4, 2009, at 3:43 AM, Dmitry Bely wrote:
Quote:

Alas, I cannot change the way the provider's gateway works. It
immediately responses with 403... BTW, it's Mera Damos
([url=http://www.mera-systems.com ?]http://www.mera-systems.com ?[/url]). No workaround possible?
Back to top
dmitry.bely at gmail.com
Guest





PostPosted: Fri Sep 04, 2009 2:31 pm    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

On Fri, Sep 4, 2009 at 4:45 PM, Brian West<brian@freeswitch.org> wrote:
Quote:
I cannot change the way SIP Authentication works.  The first register is
always sent without an authorization header then is challenged.  If you're
getting an instant 403 then you have something wrong in your config and the
remote system doesn't like it.  Please contact your provider and ask them to
troubleshoot it with you.
/b

Well, you are right. Looks like the problem is not with authorization
but in the line

Contact: <sip:gw+1.2.3.4@5.6.7.8:5080;transport=udp>

that the gateway would like to see as

Contact: <sip:username@1.2.3.4>

I've found (almost undocumented) parameter extension-in-contact, but
it still gives

Contact: <sip:username@5.6.7.8:5080;transport=udp>

(1.2.3.4 is my IP address, 5.6.7.8 is gateway's one). Any idea how to
overcome this?

Quote:
On Sep 4, 2009, at 3:43 AM, Dmitry Bely wrote:

Alas, I cannot change the way the provider's gateway works. It
immediately responses with 403... BTW, it's Mera Damos
(http://www.mera-systems.com ?). No workaround possible?

- Dmitry Bely

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 04, 2009 2:51 pm    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

Try filling out contact-host too. But if the far end gets pissed about your contact they are broken.

/b

On Sep 4, 2009, at 2:22 PM, Dmitry Bely wrote:
Quote:
Well, you are right. Looks like the problem is not with authorization
but in the line

Contact: <[url=sip:gw+1.2.3.4@5.6.7.8:5080;transport=udp]sip:gw+1.2.3.4@5.6.7.8:5080;transport=udp[/url]>

that the gateway would like to see as

Contact: <[url=sip:username@1.2.3.4]sip:username@1.2.3.4[/url]>

I've found (almost undocumented) parameter extension-in-contact, but
it still gives

Contact: <[url=sip:username@5.6.7.8:5080;transport=udp]sip:username@5.6.7.8:5080;transport=udp[/url]>
Back to top
dmitry.bely at gmail.com
Guest





PostPosted: Fri Sep 04, 2009 3:52 pm    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

I'm started to suspect another thing.. Successful register (SIP phone) contains

REGISTER sip:Domain SIP/2.0

while unsuccessful one is

REGISTER sip:1.2.3.4 SIP/2.0

What parameter is responsible for Request-URI? Note that I need both
IP address for proxy and symbolic name for SIP domain (which is not
mapped the resolvable DNS name).

On Fri, Sep 4, 2009 at 11:37 PM, Brian West<brian@freeswitch.org> wrote:
Quote:
Try filling out contact-host too.  But if the far end gets pissed about your
contact they are broken.
/b
On Sep 4, 2009, at 2:22 PM, Dmitry Bely wrote:

Well, you are right. Looks like the problem is not with authorization
but in the line

 Contact: <sip:gw+1.2.3.4@5.6.7.8:5080;transport=udp>

that the gateway would like to see as

 Contact: <sip:username@1.2.3.4>

I've found (almost undocumented) parameter extension-in-contact, but
it still gives

 Contact: <sip:username@5.6.7.8:5080;transport=udp>

- Dmitry Bely

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 04, 2009 4:14 pm    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

show me your XML for the gateway please.

/b

On Sep 4, 2009, at 3:43 PM, Dmitry Bely wrote:
Quote:
I'm started to suspect another thing.. Successful register (SIP phone) contains

REGISTER [url=sip:Domain]sip:Domain[/url] SIP/2.0

while unsuccessful one is

REGISTER [url=sip:1.2.3.4]sip:1.2.3.4[/url] SIP/2.0

What parameter is responsible for Request-URI? Note that I need both
IP address for proxy and symbolic name for SIP domain (which is not
mapped the resolvable DNS name).
Back to top
dmitry.bely at gmail.com
Guest





PostPosted: Fri Sep 04, 2009 4:38 pm    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

On Sat, Sep 5, 2009 at 1:08 AM, Brian West<brian@freeswitch.org> wrote:
Quote:
show me your XML for the gateway please.
/b

It's fairly standard:

<!--
Shell provider account should work with most providers.

-->
<include>
<user id="$${default_provider}">
<gateways>
<gateway name="$${default_provider}">
<param name="username" value="$${default_provider_username}"/>
<param name="password" value="$${default_provider_password}"/>
<param name="from-user" value="$${default_provider_username}"/>
<param name="from-domain" value="$${default_provider_from_domain}"/>
<param name="realm" value="$${default_provider_from_domain}"/>
<param name="proxy" value="$${default_provider}"/>
<param name="expire-seconds" value="600"/>
<param name="register" value="$${default_provider_register}"/>
<param name="retry-seconds" value="30"/>
<param name="extension" value="$${default_provider_contact}"/>
<!--<param name="contact-params" value="domain_name=$${domain}"/>-->
<param name="context" value="public"/>
</gateway>
</gateways>
<params>
<param name="password" value="$${default_provider_password}"/>
</params>
</user>
</include>

default_provider_register is set to true.

In the meantime I looked into the sources. If I understand them right,
proxy address is always used in REGISTER header:

sofia.c, line 1471
gateway->register_url =
switch_core_sprintf(gateway->pool, "sip:%s", proxy);

Probably it's incorrect as RFC 3261 says:

Request-URI: The Request-URI names the domain of the location
service for which the registration is meant (for example,
"sip:chicago.com"). The "userinfo" and "@" components of the
SIP URI MUST NOT be present.

So the domain name (from-domain?) should be used there, not the proxy address.

Quote:
On Sep 4, 2009, at 3:43 PM, Dmitry Bely wrote:

I'm started to suspect another thing.. Successful register (SIP phone)
contains

REGISTER sip:Domain SIP/2.0

while unsuccessful one is

REGISTER sip:1.2.3.4 SIP/2.0

What parameter is responsible for Request-URI? Note that I need both
IP address for proxy and symbolic name for SIP domain  (which is not
mapped the resolvable DNS name).

- Dmitry Bely

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 04, 2009 4:45 pm    Post subject: [Freeswitch-users] Proxy authorization Reply with quote

Can you send it to me with the data filled out off list please.

/b

On Sep 4, 2009, at 4:33 PM, Dmitry Bely wrote:

Quote:
It's fairly standard:

<!--
Shell provider account should work with most providers.

-->


_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services