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
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:
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
On Fri, Sep 4, 2009 at 1:19 AM, Brian West<brian@freeswitch.org> wrote:
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?
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
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:
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?
On Fri, Sep 4, 2009 at 4:45 PM, Brian West<brian@freeswitch.org> wrote:
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?
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
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>
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:
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
show me your XML for the gateway please. /b 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).
On Sat, Sep 5, 2009 at 1:08 AM, Brian West<brian@freeswitch.org> wrote:
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.
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
participants (2)
-
Brian West
-
Dmitry Bely