I want to use same trunk on multiple tenants.
I found a workaround for this:
For outbound create a PJSIP trunk on the master account and then creating a Custom trunk on the Tenants account and in the interface specify the full PJSIP string like PJSIP/trunkname, this works for outgoing calls.
For Inbound calls we create an entry in the incalls with Custom action and give action as Goto(<tenant’s incoming context>, CALLERID(dnid), 1). This routes the call to the particular tenant’s incall context where we can handle it further.
Inbound is ok, but for outbound there is a constraint in the API and DB that it allows only unique interface values in custom trunks. So if I create a custom trunk with interface = PJSIP/trunkname in one tenant, I am not allowed to use the same interface value for creating a custom trunk on another tenant.
Please let me know in case there is a work around for this. I have tried removing the constraint from the DB in usercustom table and inserting values straight to DB works fine. But not sure if this will break something elsewhere.