[asterisk-users] Asterisk pjsip registration issues

2017-09-26 Thread Bryant Zimmerman
Hey all
  
 I am hoping someone can assist I have now spent over a week trying to 
figure out what is going on with PJSIP registrations. 
  
 I am able to register handsets against an asterisk 13 server running 
pjsip, but I am not able to get pjsip to register out to an older chan_sip 
asterisk server. 
 If I drop the registration I can make things work, but when I have to 
register the asterisk - pjsip server against another server the 
registration completes, but I can not send any calls across the 
registration, nor will it handle options correctly as well. 
  
 We keep getting ... No auth credentials for realm(s) 
'aster...@xxx.xxx.xxx.xxx' in challenge.
in one form or another, and I have been unable to find any definitive 
documentation on what is at cause for this. In some areas I have seen 
responses saying it is an issue with realms so I have tried with and 
without but no success. 
  
 I really need some direction on this. This is the last issue I know of 
that is holding up us from moving to pjsip. If I can't get asterisk / pjsip 
to register and send authenticated  messages than it can't work for 
replacing chan_sip in all situations.   
  
 What am I doing wrong. 
  
  
  [zktech_trunk]
type=registration
 endpoint=zktech_trunk
transport=udp-nat
outbound_auth=zktech_trunk
server_uri=sip:acct.8...@xxx.xxx.xxx.xxx
client_uri=sip:acct.8...@xxx.xxx.xxx.xxx
contact_user=zktech_trunk
retry_interval=60
forbidden_retry_interval=600
expiration=3600
line=yes
  
 [zktech_trunk]
type=auth
auth_type=userpass
password=rossi72v8qr
username=ACCT.8009
realm=aster...@xxx.xxx.xxx.xxx
  
 [zktech_trunk]
 type=aor
max_contacts=1
contact=sip:acct.8...@privxxx.xxx.xxx.xxx:5060
qualify_frequency=60

  
 Thanks

Bryant 

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] Asterisk pjsip registration issues

2017-09-26 Thread Joshua Colp
On Tue, Sep 26, 2017, at 10:33 AM, Bryant Zimmerman wrote:
> Hey all
>   
>  I am hoping someone can assist I have now spent over a week trying to 
> figure out what is going on with PJSIP registrations. 
>   
>  I am able to register handsets against an asterisk 13 server running 
> pjsip, but I am not able to get pjsip to register out to an older
> chan_sip 
> asterisk server. 
>  If I drop the registration I can make things work, but when I have to 
> register the asterisk - pjsip server against another server the 
> registration completes, but I can not send any calls across the 
> registration, nor will it handle options correctly as well. 
>   
>  We keep getting ... No auth credentials for realm(s) 
> 'aster...@xxx.xxx.xxx.xxx' in challenge.
> in one form or another, and I have been unable to find any definitive 
> documentation on what is at cause for this. In some areas I have seen 
> responses saying it is an issue with realms so I have tried with and 
> without but no success. 
>   
>  I really need some direction on this. This is the last issue I know of 
> that is holding up us from moving to pjsip. If I can't get asterisk /
> pjsip 
> to register and send authenticated  messages than it can't work for 
> replacing chan_sip in all situations.   
>   
>  What am I doing wrong. 

Break this down further because you have some conflicting and confusing
information. Does the outbound registration work or not work? Does it
show as registered in PJSIP? If you leave out the "realm" option what
happens? When you say "can't send any calls across the registration"
what does that mean? Are you referring to inbound calls or outbound
calls?

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


Re: [asterisk-users] Asterisk pjsip registration issues

2017-09-26 Thread Dave Platt

> Hey all
>
>  I am trying to register a PJSIP server on our office to an Asterisk 11
> chan_sip server in a datacenter.
>
>  I keep getting
>   WARNING[18084]: res_pjsip_outbound_authenticator_digest.c:178
> digest_create_request_with_auth_from_old: Host: 'XXX.XXX.XXX.XXX:5060':
> Unable to create request with auth. No auth credentials for realm(s)
> 'asterisk' in challenge.
>
>  Any insights would be appreciated I have been banging my head for
several
> days now.

I ran into a very similar problem when I tried to switch my PJSIP
service with Vitelity from "fixed IP address" to "registration-based".
I would try to place a call, and it would simply time out and then get
a "busy here" error from Vitelity.

Calls to a similar Vitelity sub-account from a Zoiper soft-phone worked
just fine.

I wiresharked the sessions and found that the critical difference seemed
to be in the From: and Contact: headers.  Zoiper set these to the
Vitelity sub-account name (the registration name) while PJSIP just set
them to "asterisk".

I checked the PJSIP wizard file, and found that the outbound
authentication object had the right username information in it,
so that wasn't the problem.

After stumbling around for hours, I found that it's necessary to
set the "from_user" parameter in the endpoint object to match the
username in the outbound authentication object.  This causes PJSIP
to send this value (rather than "asterisk") in the From and Contact
fields of the INVITE, and this apparently gives the far end the
information it needs to issue a proper credentials challenge.

Once I added this one line to my definition and restarted, outbound
calls worked like a charm.

So, in pjsip_wizard, one would write something like

[peername]
type = wizard
transport = transport-udp
remote_hosts = outbound.peer.com
sends_auth = yes
endpoint/context = outbound
endpoint/from_user = MYNAME
outbound_auth/username = MYNAME
outbound_auth/password = MYPASSWORD

Modify and embellish as required.  If you're writing your PJSIP
objects individually rather than via the wizard, just set the
fields in those objects appropriately.



-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


[asterisk-users] asterisk pjsip as voip client with multiple registrations

2017-09-26 Thread marek cervenka

hi,

i want use asterisk+pjsip as voip client with multiple registrations 
(perf testing)


i'm using this example configuration for one account

[308]
type=registration
outbound_auth=308
server_uri=sip:3...@example.com:5060
client_uri=sip:3...@example.com:5060

[308](auth-userpass)
username=308
password=pass

[308](aor-single-reg)
contact=sip:example.com:5060

[308](endpoint-basic)
outbound_auth=308
aors=308

[308]
type=identify
endpoint=308
match=example.com


my problem is contact on the other side (is same for all endpoints)

Addr->IP : 1.1.1.1:5060
Reg. Contact : sip:s@1.1.1.1:5060

all incoming calls from PBX to my Asterisk are routed to only one 
account  (because of same ip address/port ?)


how can i specify different source port or different contact address for 
asterisk pjsip client with registration?


Marek



--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


Re: [asterisk-users] asterisk pjsip as voip client with multiple registrations

2017-09-26 Thread Joshua Colp
On Tue, Sep 26, 2017, at 05:29 PM, marek cervenka wrote:
> hi,
> 
> i want use asterisk+pjsip as voip client with multiple registrations 
> (perf testing)
> 
> i'm using this example configuration for one account
> 
> [308]
> type=registration
> outbound_auth=308
> server_uri=sip:3...@example.com:5060
> client_uri=sip:3...@example.com:5060
> 
> [308](auth-userpass)
> username=308
> password=pass
> 
> [308](aor-single-reg)
> contact=sip:example.com:5060
> 
> [308](endpoint-basic)
> outbound_auth=308
> aors=308
> 
> [308]
> type=identify
> endpoint=308
> match=example.com
> 
> 
> my problem is contact on the other side (is same for all endpoints)
> 
> Addr->IP : 1.1.1.1:5060
> Reg. Contact : sip:s@1.1.1.1:5060
> 
> all incoming calls from PBX to my Asterisk are routed to only one 
> account  (because of same ip address/port ?)
> 
> how can i specify different source port or different contact address for 
> asterisk pjsip client with registration?

The "contact_user" option configures the user portion of the Contact
that is sent in the REGISTER. You can set it to a different value for
each registration.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] Asterisk pjsip registration issues - Solved

2017-09-26 Thread Bryant Zimmerman
Dave
  
 from_user  fixed the issue. 
  
 Thank You Thank You Thank You 
  
 I was about ready to chuck pjsip. The lack of good / complete 
documentation is a real problem. 
 Man you saved me another late night. 

Thanks

Bryant
  


 From: "Dave Platt" 
Sent: Tuesday, September 26, 2017 3:28 PM
To: asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] Asterisk pjsip registration issues   

> Hey all
>
> I am trying to register a PJSIP server on our office to an Asterisk 11
> chan_sip server in a datacenter.
>
> I keep getting
> WARNING[18084]: res_pjsip_outbound_authenticator_digest.c:178
> digest_create_request_with_auth_from_old: Host: 'XXX.XXX.XXX.XXX:5060':
> Unable to create request with auth. No auth credentials for realm(s)
> 'asterisk' in challenge.
>
> Any insights would be appreciated I have been banging my head for
several
> days now.

I ran into a very similar problem when I tried to switch my PJSIP
service with Vitelity from "fixed IP address" to "registration-based".
I would try to place a call, and it would simply time out and then get
a "busy here" error from Vitelity.

Calls to a similar Vitelity sub-account from a Zoiper soft-phone worked
just fine.

I wiresharked the sessions and found that the critical difference seemed
to be in the From: and Contact: headers. Zoiper set these to the
Vitelity sub-account name (the registration name) while PJSIP just set
them to "asterisk".

I checked the PJSIP wizard file, and found that the outbound
authentication object had the right username information in it,
so that wasn't the problem.

After stumbling around for hours, I found that it's necessary to
set the "from_user" parameter in the endpoint object to match the
username in the outbound authentication object. This causes PJSIP
to send this value (rather than "asterisk") in the From and Contact
fields of the INVITE, and this apparently gives the far end the
information it needs to issue a proper credentials challenge.

Once I added this one line to my definition and restarted, outbound
calls worked like a charm.

So, in pjsip_wizard, one would write something like

[peername]
type = wizard
transport = transport-udp
remote_hosts = outbound.peer.com
sends_auth = yes
endpoint/context = outbound
endpoint/from_user = MYNAME
outbound_auth/username = MYNAME
outbound_auth/password = MYPASSWORD

Modify and embellish as required. If you're writing your PJSIP
objects individually rather than via the wizard, just set the
fields in those objects appropriately.

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: 
https://community.asterisk.org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] asterisk pjsip as voip client with multiple registrations

2017-09-26 Thread marek cervenka

Dne 26/09/2017 v 22:33 Joshua Colp napsal(a):

On Tue, Sep 26, 2017, at 05:29 PM, marek cervenka wrote:

hi,

i want use asterisk+pjsip as voip client with multiple registrations
(perf testing)

i'm using this example configuration for one account

[308]
type=registration
outbound_auth=308
server_uri=sip:3...@example.com:5060
client_uri=sip:3...@example.com:5060

[308](auth-userpass)
username=308
password=pass

[308](aor-single-reg)
contact=sip:example.com:5060

[308](endpoint-basic)
outbound_auth=308
aors=308

[308]
type=identify
endpoint=308
match=example.com


my problem is contact on the other side (is same for all endpoints)

Addr->IP : 1.1.1.1:5060
Reg. Contact : sip:s@1.1.1.1:5060

all incoming calls from PBX to my Asterisk are routed to only one
account  (because of same ip address/port ?)

how can i specify different source port or different contact address for
asterisk pjsip client with registration?

The "contact_user" option configures the user portion of the Contact
that is sent in the REGISTER. You can set it to a different value for
each registration.


ok i have this configuration now
client - asterisk+pjsip (public ip 1.1.1.1)
pjsip/307
pjsip/308

server - asterisk+chan_sip (public ip 2.2.2.2)
sip/307
 Addr->IP : 1.1.1.1:5060
 Reg. Contact : sip:307@1.1.1.1:5060

sip/308
 Addr->IP : 1.1.1.1:5060
 Reg. Contact : sip:308@1.1.1.1:5060


now, every call from server to client  is received through pjsip/307 . 
but i need receive call for pjsip/308 through registration of pjsip/308. 
is it possible?

is it possible configure different source port other than 5060?


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] asterisk pjsip as voip client with multiple registrations

2017-09-26 Thread Joshua Colp
On Tue, Sep 26, 2017, at 05:53 PM, marek cervenka wrote:
> Dne 26/09/2017 v 22:33 Joshua Colp napsal(a):
> > On Tue, Sep 26, 2017, at 05:29 PM, marek cervenka wrote:
> >> hi,
> >>
> >> i want use asterisk+pjsip as voip client with multiple registrations
> >> (perf testing)
> >>
> >> i'm using this example configuration for one account
> >>
> >> [308]
> >> type=registration
> >> outbound_auth=308
> >> server_uri=sip:3...@example.com:5060
> >> client_uri=sip:3...@example.com:5060
> >>
> >> [308](auth-userpass)
> >> username=308
> >> password=pass
> >>
> >> [308](aor-single-reg)
> >> contact=sip:example.com:5060
> >>
> >> [308](endpoint-basic)
> >> outbound_auth=308
> >> aors=308
> >>
> >> [308]
> >> type=identify
> >> endpoint=308
> >> match=example.com
> >>
> >>
> >> my problem is contact on the other side (is same for all endpoints)
> >>
> >> Addr->IP : 1.1.1.1:5060
> >> Reg. Contact : sip:s@1.1.1.1:5060
> >>
> >> all incoming calls from PBX to my Asterisk are routed to only one
> >> account  (because of same ip address/port ?)
> >>
> >> how can i specify different source port or different contact address for
> >> asterisk pjsip client with registration?
> > The "contact_user" option configures the user portion of the Contact
> > that is sent in the REGISTER. You can set it to a different value for
> > each registration.
> 
> ok i have this configuration now
> client - asterisk+pjsip (public ip 1.1.1.1)
> pjsip/307
> pjsip/308
> 
> server - asterisk+chan_sip (public ip 2.2.2.2)
> sip/307
>   Addr->IP : 1.1.1.1:5060
>   Reg. Contact : sip:307@1.1.1.1:5060
> 
> sip/308
>   Addr->IP : 1.1.1.1:5060
>   Reg. Contact : sip:308@1.1.1.1:5060
> 
> 
> now, every call from server to client  is received through pjsip/307 . 
> but i need receive call for pjsip/308 through registration of pjsip/308. 
> is it possible?
> is it possible configure different source port other than 5060?

There is no ability to match to an endpoint currently based on the
transport traffic comes in on. You can try enabling the line option[1]
which may allow the inbound calls to be directed to an alternative
endpoint. If this doesn't work you'll need to match all incoming to a
single endpoint and direct things appropriately in the dialplan based on
the dialed number.

[1]
http://blogs.asterisk.org/2016/01/27/the-pjsip-outbound-registration-line-option/

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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