› VitalPBX Community Support › General Discussion › How Tenant work when multiples trunks to same remote sip server
- This topic has 9 replies, 2 voices, and was last updated 1 year, 5 months ago by
vitorcosta.
- Post
-
- June 23, 2019 at 10:03 pm
I have some tenants in on Vital server, each tenant have a diferent number and account on same sip server (telephony company), so remote host is same.
When a inbound call come Vital always select same Tenant no matter if come from other tenant trunk.
Lets sai i have 2 trunks: TA (NumberA) and TB (NumberB), both registered on same sip host, (sip.remote.com).
If i dial from my cell phone NumberA call go to TA, and if i dial NumberB call go to TA too.
0
- Replies
-
- June 23, 2019 at 10:39 pm
The behavior you are describing is normal, especially for trunks that use insecure=port,invite(or insecure=invite). When a SIP call comes into Asterisk, it makes several evaluations. One of the first evaluations is whether the call is coming from a valid Trunk. It does this by comparing the IP address where the call is coming from with the host=IP addresses of the Trunks you have set-up. Ordinarily, it would also ensure that the originating port and the username and password are correct as well. However, if you have insecure=port, invite set in a trunk, then Asterisk makes no effort to match the username/password/port on incoming calls. Rather, as long as the host matches, then Asterisk accepts the call as coming in on that trunk. Trunks are compared in alphanumeric order, so if you have several trunks set up to the same host, every incoming call will match to the trunk with the lowest alphanumic name, i.e. 1111 before 2222, and aaaa before bbbb. If the call matches ANY of your trunks, that’s good enough for Asterisk, and it moves the call on to the next level of processing, which is to compare the DID sent with the call with your inbound routes. It appears to process then in alphanumeric order, so whichever Trunk matches first will end up listed in the CDR.
0- June 24, 2019 at 3:17 am
- June 24, 2019 at 3:30 pm
- June 24, 2019 at 7:53 pm
I fix arround this way:
– set a trunk to target external sip host on root Tenant (out side tenant)
– create a trunk type tenant from root to desired tenant
– create a inbound route on root sending to tenent trunk based on did
Seens all all work as Vital check root trunk ips before go to tenant trunks
A little anoying but ok.
Maybe u guys can just create a did global rule for each trunk create in tenant, and using it to send to correct tenant and not use remote ip for it
0- June 24, 2019 at 11:05 pm
We just released a new update of VitalPBX to fix this issue and others. Check more about it in the link below on “Release 2” section.
0- June 25, 2019 at 2:31 am
- June 25, 2019 at 11:29 pm
- June 25, 2019 at 11:58 pm
This how it works:
Suppose you have two trunks with Telnyx, one for the main tenant, and the second one for the additional tenant.
In both tenants, you must create their respective trunks with its credentials.
After this, you must define in the inbound routes its respective DID Number(s) on each tenant.
For example:
- 12345678 (On Main Tenant)
- 98765321 (On Secondary Tenant)
0- August 4, 2019 at 4:19 pm
- You must be logged in to reply to this topic.