Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[asterisk-users] Asterisk (PJSIP) registers with sips Contact URI, but why?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
damm at sipgate.de
Guest





PostPosted: Tue May 03, 2016 10:40 am    Post subject: [asterisk-users] Asterisk (PJSIP) registers with sips Contac Reply with quote

Hi,

I'm registering an Asterisk against my TLS capable service, using
res_pjsip. My config looks like this:

[devtrunk_reg]
type=registration
outbound_auth=devtrunk_auth
server_uri=sip:example.org\;transport=tls
client_uri=sip:1234567@example.org\;transport=tls
outbound_proxy=sip:dev.example.org\;transport=tls\;lr
contact_user=1234567
retry_interval=60
expiration=600
line=yes
endpoint=222

[devtrunk_auth]
type=auth
auth_type=userpass
username=1234567
password=secret
realm=example.org


It registers fine, but this is what the REGISTER request looks like:

<--- Transmitting SIP request (903 bytes) to TLS:1.2.3.4:5061 --->
REGISTER sip:example.org;transport=tls SIP/2.0
Via: SIP/2.0/TLS
9.8.7.6:55664;rport;branch=z9hG4bKPjNlqlgmSOP7O4LqOTUqJtFZB8fTmc0ZKL;alias
Route: <sip:dev.example.org;transport=tls;lr>
From: <sip:1234567@example.org>;tag=vhDrzKtv9lMR53ZJFgVTnvGcACJiN6Aa
To: <sip:1234567@example.org>
Call-ID: nzgHdLyliuBwecmae2Y..0oY2DqYjH0V
CSeq: 14861 REGISTER
Contact: <sips:1234567@9.8.7.6:55664;transport=TLS;line=dhslasr>
Expires: 600
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL,
UPDATE, PRACK, MESSAGE, REFER, REGISTER
Max-Forwards: 70
User-Agent: Asterisk PBX 13.8.2
Content-Length: 0

What I really don't like is the Contact line. It starts with sips
instead of sip. This makes inbound calls not work because the server
sends a sip Contact header instead of sips. And Asterisk rejects that.

In the header of the 480 response I see this line:

Warning: 381 SIP "SIPS Required"

Since I can't reconfigure the server to send sips Contact URIs, I need
Asterisk to send out a contact URI in the register, that starts with
sip: as well. Then inbound calls would work.

Is there any way to get rid of this sips URI?

Interestingly, when sending out calls, the Contact URI starts with sip
instead of sips, so outbound calls work.

Best Regards,
Sebastian

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
gjoseph at digium.com
Guest





PostPosted: Tue May 03, 2016 11:09 am    Post subject: [asterisk-users] Asterisk (PJSIP) registers with sips Contac Reply with quote

On Tue, May 3, 2016 at 9:39 AM, Sebastian Damm <damm@sipgate.de (damm@sipgate.de)> wrote:
Quote:
Hi,

I'm registering an Asterisk against my TLS capable service, using
res_pjsip. My config looks like this:

[devtrunk_reg]
type=registration
outbound_auth=devtrunk_auth
server_uri=sip:example.org\;transport=tls
client_uri=sip:1234567@example.org ([email]sip%3A1234567@example.org[/email])\;transport=tls
outbound_proxy=sip:dev.example.org\;transport=tls\;lr
contact_user=1234567
retry_interval=60
expiration=600
line=yes
endpoint=222

[devtrunk_auth]
type=auth
auth_type=userpass
username=1234567
password=secret
realm=example.org


It registers fine, but this is what the REGISTER request looks like:

<--- Transmitting SIP request (903 bytes) to TLS:1.2.3.4:5061 --->
REGISTER sip:example.org;transport=tls SIP/2.0
Via: SIP/2.0/TLS
9.8.7.6:55664;rport;branch=z9hG4bKPjNlqlgmSOP7O4LqOTUqJtFZB8fTmc0ZKL;alias
Route: <sip:dev.example.org;transport=tls;lr>
From: <sip:1234567@example.org ([email]sip%3A1234567@example.org[/email])>;tag=vhDrzKtv9lMR53ZJFgVTnvGcACJiN6Aa
To: <sip:1234567@example.org ([email]sip%3A1234567@example.org[/email])>
Call-ID: nzgHdLyliuBwecmae2Y..0oY2DqYjH0V
CSeq: 14861 REGISTER
Contact: <sips:1234567@9.8.7.6:55664;transport=TLS;line=dhslasr>
Expires: 600
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL,
UPDATE, PRACK, MESSAGE, REFER, REGISTER
Max-Forwards: 70
User-Agent: Asterisk PBX 13.8.2
Content-Length:  0

What I really don't like is the Contact line. It starts with sips
instead of sip. This makes inbound calls not work because the server
sends a sip Contact header instead of sips. And Asterisk rejects that.


res_pjsip_outbound_registration is hard-coded to send "sips" on a secure transport.
I'd suggest opening a issue at issues.asterisk.org.  We should probably use the scheme
from the registration client_uri.
 

Quote:

In the header of the 480 response I see this line:

Warning: 381 SIP "SIPS Required"

Since I can't reconfigure the server to send sips Contact URIs, I need
Asterisk to send out a contact URI in the register, that starts with
sip: as well. Then inbound calls would work.

Is there any way to get rid of this sips URI?

Interestingly, when sending out calls, the Contact URI starts with sip
instead of sips, so outbound calls work.

Best Regards,
Sebastian

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




--
George JosephDigium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk 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