How to determine if Caller ID contains the number of the alias

Hello there,
What I wanna do is to determine if the caller ID of my SIP provider contains the alias phone number I bought.
What’s actually is that I have two alias, both transfered to my VOIP line number. But one of them is directly ringing my phone only and not all the phone through the standard. I have an option in my provider client manager to provide both inbound caller id+caller id of the alias the fact is that now when someone calls me the phone rings successfully but showing the alias number for sure because it calls the VOIP number and I use it to recognize the call and transfers it only to my phone. But now, I want to have the caller ID number of the person who’s trying to reach me because for the moment I can’t know it.

Does anyone has a solution? Here is my actual conf in extensions.

exten => s,1,GotoIf($["${CALLERID(num)}" = "042284"]?dial1)
exten => s,n,GotoIf($["${CALLERID(num)}" != "042241"]?10)
exten => s,n(dial1),Set(CALLFILENAME=${CALLERID(num)}${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
exten => s,n,MixMonitor(/var/spool/asterisk/recording/${CALLFILENAME}.wav,bW(3))
exten => s,n,Playback(IVR-013)
exten => s,n,Dial(SIP/100,25)
exten => s,n,Playback(IVR-012)
exten => s,10,Goto(home,8002,1)
exten => s,n,Hangup()


Please provide a copy of the INVITE from the provider, with numbers present marked as caller ID or “alias name”.

If I’ve correctly deciphered what you mean by alias, this would normally be in the To header, not the From header. However, if the From header is in use for this, you would need to see if they are sending valid P-Asserted-Identity, or Remote-Party-ID headers, and, if so set the appropriate pjsip.conf (or sip.conf, if you are not using the fully supported channel driver) option to honour that.

Alternatively, find a better supplier.

I didn’t described so well what I want. The fact is, that the only one line is registered in sip.conf is my VOIP line of my provider but in this same provider I bought only “numbers” without any subscription to call and which ones I can’t register on Asterisk. The only way I can use them is to transfer them to the VOIP line number then in the extensions I detect if the call is coming from the alias which I call “general” then I redirect it to the vocal server, and if it’s coming from my personal number redirecting it only to my phone without to choose any choices. Am I be clearer?

I’m afraid I’m still confused.

Ok, I’m gonna try to explain you better the situation:

Here is my conf:

0100000000 - VOIP line

0200000000 - number transfers to vocal server with choices
0200000001 - number transfers to my phone

Both numbers when they are called call the VOIP LINE. Now, what I wanna do, is to have the caller ID number which the one I have when we call me on the 0200000000 but I don’t have when I’m called on the 0200000001 because the only way I found to detect a call is coming from this number is to set Gotoif caller ID is 020000001. But now, I want to make caller id contains 0200000001 and not is 0200000001. In order to have the caller ID of the PERSON who is trying to reach me. I hope I was clearer.

EDIT : both numbers are not lines you can register on sip.conf as SIP peers which means I can’t register these numbers on asterisk otherwise I would have done it. The only way I can use these numbers is to transfers them to the 01000000000 and recognize in extensions which number goes where I want.

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