Set x-tennant id in SIP header based on Outbound Caller ID

Greetings all,

I’ve searched and not been able to find an example for my use case, so I’m reaching out here to see anyone can provide me some guidance.

We’re using Skyetel as our SIP trunk provider, and would like to take advantage of the tenant system for ease of billing. Now 99% of our customer base is 1 PBX to 1 Customer, so billing is cake. We have a handful of customers that run multiple businesses from one PBX, and would like their billing split out accordingly. Skyetel handles the inbound portion of that swimmingly. In order to track the outbound part, we need to inject x-tenant id into the SIP header on outbound calls.

So in this scenario, my pbx is split between two businesses. Business One (tenant ID business.one) and Business Two (tenant ID business.two). Each business has two separate DIDs.

I need to have it set so when a call originates from one of the DIDs assigned to Business One, x-tenant business.one is inserted into the SIP header. Likewise for Business Two.

I’ve seen one example where they were able to make the caller ID itself as the x-tennant ID. That would work fine if it was a 1:1 DID to tenant scenario. In my case I have multiple DIDs to match to tenants.

Can anyone guide me in the right direction?

Step by step guide I wrote when it was introduced

1 Like

I saw your how to. However your scenario is 1:1. 1 DID to one tenant. I need to map multiple DIDs to one tenant.

No, it’s not. It maps an Outbound Route to a tenant. If your tenants are using the same Outbound Routes, fix that. For example, have two routes, the first with the CallerID field matching the extension range of Business One. Calls from Business Two won’t match and will fall through to the second route.

You guys were right. I don’t know what I was looking at. Anyhow, I had to pair this with the extension routing module to get it to work right, but that’s cheap and no big deal. I trimmed out the code where it was looking for a Skyetel trunk, because I’m only using one trunk in my scenario. Rest of the code worked fine. Thanks!

No you did not. Nothing wrong with that, but you did not have to.

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