Callerid based on trunk

Been searching forums, but haven’t found a solution form me yet.

Here is my "problem"
I have 2 trunks (ISDN and SIP).
I have an outbound callerid set for each extension, witch works great.
But when the extension tries to call from SIP trunk, when ISDN trunk is not availabile, then logicly my sip provider blocks my calls, because the callerid’s on SIP trunk are diferent.

Is it posibile to have an outbound callerid based on the trunk witch is used for each extension?
Ex: ext. 45 (outbound CID from ISDN 4522445, outbound CID from SIP trunk 059678833)

Thank you

Which version of FreePBX are you using? In 2.5.1 (and possibly some earlier versions) you can set the callerid on the trunk itself, so that the SIP trunk always shows “059678833” and the ISDN trunk always shows “4522445”. No need to set the callerid on each extension in that case.

Then you can create outbound rules to determine which trunk to dial out on.

Or, if each extension needs to show its own callerid (for example your staff each have their own direct dial number), then you will need to talk to your SIP provider and ask them to allow you to display your own callerid.

Some providers, by default, will not allow their customers to set their own callerid due to dishonest telemarketing companies sending fake callerid information. However, if your SIP provider is reasonable and you explain why you need to set your own callerid, they may allow it.

Hope that helps.


I know I can set the callerID on each trunk, but I want to use different callerid for each extension (i have 30 numbers). The problem is that if I set the callerid for isdn trunk it only works on isdn trunk but not on sip trunk (because the numbers are different)if isdn fails - and the other way around.
I wan’t to set different (two - SIP and ISDN) callerid’s for every extension, so it uses the ISDN callerid when calling from ISDN trunk and SIP callerid when calling from SIP trunk.
The only solution I found is that, if I only set callerid on trunk (not on ext.), but then all extensions have the same callerid.

There is currently no other solution.

If you want to dig into doing some custom coding I’m sure it can be done. There are hooks for each trunk that get called before the actual placement of a call using that trunk so if you came up with a system where you could translate the extension to a external CID number then you could probably do it there.

But there is not a pre-built system in place

So, if I am understanding correctly then, sebek72, you have 30 different numbers and 30 different extensions. Each extension has its own number to use. For example: extension 1001 = 6155551212, extension 1002 = 6155552323, etc. Presumably people calling those numbers would then be directed to the appropriate extension. Yes?

It also sounds like you want to dial out on the ISDN trunk most of the time, but want to failover to the SIP trunk. (Or, always dial out on the SIP trunk and failover to ISDN)

Your ISDN provider is allowing you to set the callerid. (Did all of the numbers come from the ISDN provider?)

Your SIP provider is not allowing you to set the callerid.

In order to maintain consistency when calling out, regardless of trunk used, you need each extension to always show their own assigned number as their callerid (for example: extension 1001 should always broadcast 6155551212, regardless of the trunk used).

If this is what you are trying to accomplish, then talk with your SIP provider to see if they will allow you to set your own callerid. Maybe they have a web interface where you can make that change yourself? Maybe you have to get their permission to do it. Depends who you are with. If they are reasonable and you can assure them you are not breaking any laws by setting your own callerid, then hopefully they will allow it.

If your SIP provider will not allow the change, then fskrotzki’s suggestion about custom coding sounds like the only other choice. (Aside from getting a different SIP provider who is a little more flexible. :wink: )

Hopefully you find a solution that works for you.


yes i’m using isdn provider gives me 30 number to use, and SIP provider gives me 30 numbers.
If i set the isdn callerid for extension and call goes to sip, the provider refuses the call because the callerid doesn’t match my 30 SIP callerid’s, and the other way around.

Is it possible to make 30 SIP and 30 isdn trunks, and set the callerid there, and then link the extensions to that trunks? Then the problem would be solved :slight_smile:

Or maybe make additional 30 extensions, so one phone uses two ext., and then if SIP provider falls out, you just have to choose to call outside, from another extension. Sounds the best solution for me :slight_smile:

Um, ok. So, both providers refuse calls when presented with a callerid that is not theirs?

What number do you want to display when your people call out from their extension? Is this for use in a business? Home use? Virtual PBX?


What number do you want to display when your people call out from their extension? Is this for use in a business? Home use? Virtual PBX?

It’s for business use. I just wan to normally call when a provider falls out so i don’t need to change outbound cid’s.