PJSIP Multi trunks to single host - Multitenant system

I assumed bind for transport is only used for devices connecting too my PBX.

I didn’t have a transports specified on my trunks.

EDIT:
I changed the transport on both trunks and they are using different ports. The Invite from the provider side still doesn’t make a difference.

INVITE sip:0123456789@192.168.1.2 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.1:5060;branch=z9hG4bK6932c5b4;rport
Max-Forwards: 70
From: “Test” sip:01111111111@192.168.1.1;tag=as5dfa7816
To: sip:0123456789@192.168.1.2
Contact: <sip: 01111111111@192.168.1.1:5060>
Call-ID: 48c2d85326e506891e68103940cf4cba@192.168.1.1:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 15.4.1
Date: Wed, 23 Feb 2022 15:54:27 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 262

Provider gave me this:
client1trunk/client1trunk 192.168.1.2 D Yes Yes 1024 OK (3 ms)
client2trunk/client2trunk 192.168.1.2 D Yes Yes 1025 OK (3 ms)

I am going to put this down as a provider problem and use the accountcode as suggested.

It applies to anything that can send any SIP packet to Asterisk (as well as anything to which Asterisk can send a SIP packet)

I think chan_pjsip defaults to the first configured transport, in that case.

SIP has no concept of trunks, so PJSIP has no concept of trunks. As such a local device and a “trunk” are no different at a basic SIP level, although, typically trunks support multiple calls (that’s where the term comes from) and expect to have dialled digits in user part of the URI

Also, a common recommendation is to not use port 5060, to reduce the number of toll fraud attempts that you receive, so knowing how to change the bind port is important.

Show the configs. Are you using identify sections?

I am using Realtime Setup:

/etc/asterisk/sorcery.conf
[res_pjsip]
endpoint=realtime,ps_endpoints
auth=realtime,ps_auths
aor=realtime,ps_aors
domain_alias=realtime,ps_domain_aliases
contact=realtime,ps_contacts

[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips

Below is the identifier setup:
select * from ps_endpoint_id_ips;
±--------------±--------------±----------------±------------±-------------+
| id | endpoint | match | srv_lookups | match_header |
±--------------±--------------±----------------±------------±-------------+
| client2trunk | client2trunk | 192.168.1.1 | NULL | NULL |
| client1trunk | client1trunk | 192.168.1.1 | NULL | NULL |
±--------------±--------------±----------------±------------±-------------+

Yeah. There is your problem. They both match to the same source IP. That always wins. So you need to stop that. I still dont know why you need two trunks. There are better ways to deal with billing it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.