Link to home
Start Free TrialLog in
Avatar of jkockler
jkocklerFlag for United States of America

asked on

Asterisk syntax for blocking caller id

Hello,

  In a scenario where I am setting the caller id for peers in my sip.conf file, is there a way to make asterisk not send the caller id information, if it receives *67 for example in the number dialed ?  To clarify, this scenario is if I am NOT using caller id settings on the actual peer device, but in Asterisk.  I would think there would be a way to setup a variable in the extensions.conf dial plan, to not send caller id if it sees something like *67 in the number.  

I am using Asterisk 1.4.23
ASKER CERTIFIED SOLUTION
Avatar of Member_2_1968385
Member_2_1968385
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jkockler

ASKER

Awesome, I will give it a shot. My voip provider is pretty laid back, so it should work.  I will let you know how I do.  thanks!
This is really a comment on your more recent post about *67 on the Linksys SPA942. I haven't checked, but presume that *67 is a recognised prefix for "withhold caller ID". It must be that the Linksys is using this prefix to toggle a mode that effects all subsequent calls. There is probably another code that toggles it back again.

The Asterisk dial plan snippet that I posted in my earlier answer is telling Asterisk to recognise any call dialled with a *67 prefix as one where the Caller ID should be overwritten. The code does not have to be "*67". It could be anything, provided it is unique within the dial plan. So, perhaps you should choose a different prefix (one that the Linksys does not recognise) and modify the dial plan in Asterisk accordingly. Then only those calls with the new prefix will have Caller ID overwritten.

If this fixes the problem, I suggest you delete the other more recent question.
I've just looked at SPA941 Admin Guide. The Linksys phone recognises a wide range of star codes (Linksys refer to them as "Vertical Service Activation Codes". *67 is "Block CID on ALL outbound calls". *66 will unblock the CID. *81 is "Block CID on the next outbound call".

You need to be clear if you want the phone or the Asterisk server to block the CLI. You can use any prefix in front of the number, program the dialplan in Asterisk to detect it (as shown in my sample code above) and that will do the job on a "per call" basis. Alternatively, you can use the Linksys star codes such as *67, but these are not normally used as a prefix in front of a dialled number - they are just used on their own. They instruct the phone to do something, not the Asterisk server, so you would want Asterisk to ignore them if it receives them.
Thanks Fepitas.  Thanks for finding out what turns off the *67 from the phone.  I posted the other thread so I know how to do it both ways.  If I have asterisk doing it for a particular context, I will disable the feature on the phone, otherwise the phone does not send the *67 over to Asterisk.  The reason for wanting to do it both ways is, just in case one particular scenario, I absolutely have to have the commands executed from the phones.  I would always prefer to do it from the Asterisk side though because I believe it to be more powerful and flexible.  Thanks for all your help !
You should paste your explanation on turning off *67 on the phone to my other post, so you credit for answering both questions.  It was a legitimate need to know both ways so I see no reason for you not to get 1000 points.
Fepitas,

  Sorry for the long lag on getting back to this one, as I just now got around to testing it.  

So far I am having an issue the Linksys spa942, not sending the *67 .. I have disabled block CID everywhere I can find it in the phone, and even changed the Block CID vertical service code.  No matter what I do, the phone sends only *67 to asterisk,  and drops off the rest of the number.  I can see it right on the display of the phone.  I push *6744444444, hit dial, and the phone drops to fast busy, and only shows *67 on the display as last number dialed.

Asterisk verbose shows that it rejected "*67" extension, so I know that is did not get the rest of the number.  
Well I was able to get it working, I had to actually modify the dial plan within the phone, at the bottom of the extension tab, to look like this

([*x1-6,8,9]|*67[1-9]xxxxxx[3469]11|0|00|*67[2-9]xxxxxx|*67xxx[2-9]xxxxxx|*671xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)

Then change the vertical service code in regional to something other than *67 ... I chose *99....

Then I used your dial plan from above, but slightly modified to be more specific, in cases where people forget to dial a 1, which then makes a case for having to add an entry for people who do dial a 1, and this is what it looks like.

exten => _*67NXXXXXXXXX,1,Set(CALLERID(num)="")
exten => _*67NXXXXXXXXX,n,Set(CALLERID(name)="Anon")
exten => _*67NXXXXXXXXX,n,Dial(SIP/1${EXTEN:3}@my_service_provider)

exten => _*671NXXXXXXXXX,1,Set(CALLERID(num)="")
exten => _*671NXXXXXXXXX,n,Set(CALLERID(name)="Anon")
exten => _*671NXXXXXXXXX,n,Dial(SIP/1${EXTEN:4}@my_service_provider)

And of course the "imaginary" voip local calls:

exten => _*67NXXXXXX,1,Set(CALLERID(num)="")
exten => _*67NXXXXXX,n,Set(CALLERID(name)="Anon")
exten => _*67NXXXXXX,n,Dial(SIP/1***${EXTEN:3}@my_service_provider)

where *** is the local area code for the caller.  Works like a charm!!!

Thanks Fepitas!