zermus
August 5, 2020, 3:44am
1
Ok so I know back in chan_sip if I had a phone with multiple lines I had to basically put something like, for the main line, register line 2. For instance if 302 was the main line and 303 was line 2 on the same device my chan_sip config would look something like this:
Note on 302 it has “register=303”
What is the PJSIP equivalent to this?
[302]
type=friend
host=dynamic
defaultuser=302
secret=xxx
context=internal-home
dtmfmode=rfc2833
canreinvite=no
callerid=302
insecure=port,invite
mailbox=302@internal
transport=tcp
force_rport=no
register=303
busylevel=4
call-limit=5
encryption_taglen=32
[303]
type=friend
host=dynamic
defaultuser=303
secret=xxx
context=internal-work
dtmfmode=rfc2833
canreinvite=no
callerid=303
insecure=port,invite
transport=tcp
mailbox=303@internal
force_rport=no
busylevel=4
call-limit=5
encryption_taglen=32
jcolp
August 5, 2020, 9:08am
2
I don’t think the “register” option did what you thought it might do in chan_sip originally and likely did nothing. Have you tried just creating two normal endpoints with auth and AOR in PJSIP[1] and having the endpoint register each line to the appropriate one?
zermus
August 5, 2020, 2:10pm
3
Yeah when I boot up the phone it’s like both endpoints come up but only for a few seconds, then the 2nd line goes down and never comes back up.
rhea*CLI> pjsip show endpoints
Endpoint: <Endpoint/CID.....................................> <State.....> <Channels.>
I/OAuth: <AuthId/UserName...........................................................>
Aor: <Aor............................................> <MaxContact>
Contact: <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
Transport: <TransportId........> <Type> <cos> <tos> <BindAddress..................>
Identify: <Identify/Endpoint.........................................................>
Match: <criteria.........................>
Channel: <ChannelId......................................> <State.....> <Time.....>
Exten: <DialedExten...........> CLCID: <ConnectedLineCID.......>
==========================================================================================
Endpoint: 301/301 Not in use 0 of 4
OutAuth: 301/301
InAuth: 301/301
Aor: 301 3
Contact: 301/sip:301@10.9.9.2:36479;transport=TCP 354027300e NonQual nan
Endpoint: 302/302 Not in use 0 of 4
OutAuth: 302/302
InAuth: 302/302
Aor: 302 3
Contact: 302/sip:302@10.9.9.3:51387;transport=TCP f697c32962 NonQual nan
Contact: 302/sip:302@10.9.9.12:5060 7f817c52a0 NonQual nan
Endpoint: 303/303 Not in use 0 of 4
OutAuth: 303/303
InAuth: 303/303
Aor: 303 3
Contact: 303/sip:303@10.9.9.3:51387;transport=TCP d4d87e3930 NonQual nan
Endpoint: 304/304 Unavailable 0 of inf
OutAuth: 304/304
InAuth: 304/304
Aor: 304 1
Endpoint: 305/305 Unavailable 0 of 4
OutAuth: 305/305
InAuth: 305/305
Aor: 305 1
Endpoint: 306/306 Unavailable 0 of 4
OutAuth: 306/306
InAuth: 306/306
Aor: 306 1
Endpoint: 307/307 Unavailable 0 of inf
OutAuth: 307/307
InAuth: 307/307
Aor: 307 1
Endpoint: VoIPms Not in use 0 of inf
OutAuth: VoIPms/xxx
InAuth: VoIPms/xxx
Aor: VoIPms 0
Contact: VoIPms/sip:xxxxx@dallas2.voip.ms e6916bed27 NonQual nan
Transport: transport-tls tls 0 0 10.9.9.13:5061
Identify: VoIPms/VoIPms
Match: 158.85.149.163/32
Objects found: 8
-- Removed contact 'sip:303@10.9.9.3:51387;transport=TCP' from AOR '303' due to shutdown
-- Removed contact 'sip:302@10.9.9.3:51387;transport=TCP' from AOR '302' due to shutdown
== Contact 303/sip:303@10.9.9.3:51387;transport=TCP has been deleted
== Endpoint 303 is now Unreachable
== Contact 302/sip:302@10.9.9.3:51387;transport=TCP has been deleted
rhea*CLI> pjsip show endpoints
Endpoint: <Endpoint/CID.....................................> <State.....> <Channels.>
I/OAuth: <AuthId/UserName...........................................................>
Aor: <Aor............................................> <MaxContact>
Contact: <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
Transport: <TransportId........> <Type> <cos> <tos> <BindAddress..................>
Identify: <Identify/Endpoint.........................................................>
Match: <criteria.........................>
Channel: <ChannelId......................................> <State.....> <Time.....>
Exten: <DialedExten...........> CLCID: <ConnectedLineCID.......>
==========================================================================================
Endpoint: 301/301 Not in use 0 of 4
OutAuth: 301/301
InAuth: 301/301
Aor: 301 3
Contact: 301/sip:301@10.9.9.2:36479;transport=TCP 354027300e NonQual nan
Endpoint: 302/302 Not in use 0 of 4
OutAuth: 302/302
InAuth: 302/302
Aor: 302 3
Contact: 302/sip:302@10.9.9.12:5060 7f817c52a0 NonQual nan
Endpoint: 303/303 Unavailable 0 of 4
OutAuth: 303/303
InAuth: 303/303
Aor: 303 3
Endpoint: 304/304 Unavailable 0 of inf
OutAuth: 304/304
InAuth: 304/304
Aor: 304 1
Endpoint: 305/305 Unavailable 0 of 4
OutAuth: 305/305
InAuth: 305/305
Aor: 305 1
Endpoint: 306/306 Unavailable 0 of 4
OutAuth: 306/306
InAuth: 306/306
Aor: 306 1
Endpoint: 307/307 Unavailable 0 of inf
OutAuth: 307/307
InAuth: 307/307
Aor: 307 1
Endpoint: VoIPms Not in use 0 of inf
OutAuth: VoIPms/xxx
InAuth: VoIPms/xxx
Aor: VoIPms 0
Contact: VoIPms/sip:xxx@dallas2.voip.ms e6916bed27 NonQual nan
Transport: transport-tls tls 0 0 10.9.9.13:5061
Identify: VoIPms/VoIPms
Match: 158.85.149.163/32
Objects found: 8
jcolp
August 5, 2020, 2:13pm
4
And what is the actual PJSIP configuration you’re using? For example in order to reuse TCP connections the “rewrite_contact” option has to be set to “yes”, otherwise Asterisk will try to establish a connection back to the device which does not always work.
zermus
August 5, 2020, 2:18pm
5
Do I put rewrite_contact on the 302 extension somehow?
;===============================================================================
;OFFICE - HOME LINE
;===============================================================================
[302]
type=aor
max_contacts = 3
[302]
type = auth
username = 302
password = xxx
[302]
type = endpoint
context = internal-home
dtmf_mode = rfc4733
disallow = all
allow = ulaw
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
direct_media = no
callerid = 302
mailboxes = 302@internal
device_state_busy_at = 4
auth = 302
outbound_auth = 302
srtp_tag_32 = yes
aors = 302
;================================================================================
;OFFICE - WORK LINE
;================================================================================
[303]
type = aor
max_contacts = 3
[303]
type = auth
username = 303
password = xxx
[303]
type = endpoint
context = internal-work
dtmf_mode = rfc4733
disallow = all
allow = ulaw
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
direct_media = no
callerid = 303
mailboxes = 303@internal
device_state_busy_at = 4
auth = 303
outbound_auth = 303
srtp_tag_32 = yes
aors = 303
jcolp
August 5, 2020, 2:22pm
6
The rewrite_contact option is already present in both endpoints. You’d most likely next need to get a SIP trace using “pjsip set logger on” to see if that sheds light on the situation.
zermus
August 5, 2020, 5:36pm
7
Turned out to be a NAT issue. Since they’re all on the same VLAN I just disabled the NAT stuff and it works.
system
Closed
September 4, 2020, 5:36pm
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.