Identifying forwarded calls based on DID

A client has multiple DID that are forward to his cell phone via extensions.conf (exten => 3032223333,1,Dial(SIP/3032224444@provider).  When he receives the calls he will like to know which DID is the call is coming from.

I tried to mess with the Caller ID, perhaps adding a number prefix to identify the DID’s
exten => 3032223333,1,Answer
exten => 3032223333,n,Set(CALLERID(num)=2${CALLERID(num)})
exten => 3032223333,1,Dial(SIP/3032224444@provider)

But in the cell phone I receive an “Unknown Number” or “Unavailable”

Is there a way to work around this? Identifying the DID that is forwarding the call and keeping the Caller ID

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

No you cant set the CallerID to a number that you dont own. Even without any modification to the callerID the original number will try to be preserved and then rejected as it is not yours.
The only thing I think you can do is to set the callerID to the exact DID number the call came in on.
Ron MalmsteadInformation Services ManagerCommented:
I disagree with grblades on "can't set the callerid to a number you don't own".... because the truth is, it "depends" on your provider.

MOST sip providers will not allow you to control your own callerid number.  (name is never allowed to be controlled by you, attempts to set it sometimes results in rejected calls as well).

However, on most PRI line providers, and a few sip providers, you can set your callerid NUMBER only.

That being said... you are also trying to set the CID as 11 digits rather than 10
exten => 3032223333,n,Set(CALLERID(num)=2${CALLERID(num)})

Just make it...
exten => 3032223333,n,Set(CALLERID(num)=${EXTEN})

...if that doesn't work, contact your provider, and ask them what level of control you have on your own callerid.
Ron MalmsteadInformation Services ManagerCommented:
The trade off is that you don't see the number that is calling...but rather the number they called in on.
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

You can do what you are asking but you have to be running SIP, you have to have a router OS that supports Sip redirect headers and the carrier you are using supports it.
We tried the same thing and had issues where some mobile carriers would strip off the preceding digit, or send nothing all together, even if you could control the caller id.

You can have a message played to the called user indicating that it is a forwarded call and then he can determine which number the call came in on with something like: Dial(ZAP/g1/${EXTEN},A(call-from-DID-1))

The "call-from-DID-1" would be the recording to play. You can use digits if you don't feel like making a recording.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
larrytousAuthor Commented:

Very elegant solution! Thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IP Telephony

From novice to tech pro — start learning today.