Solved

Asterisk syntax for blocking caller id

Posted on 2009-04-11
8
1,826 Views
Last Modified: 2013-11-12
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
0
Comment
Question by:jkockler
  • 5
  • 3
8 Comments
 
LVL 19

Accepted Solution

by:
feptias earned 500 total points
Comment Utility
exten => _*67X.,1,Set(CALLERID(num)="")
exten => _*67X.,2,Set(CALLERID(name)="Anon")
exten => _*67X.,3,Dial(SIP/${EXTEN:3}@sip_peer_name,45)

That should work if the dialed number is prefixed with *67 and you change "sip_peer_name" to whatever peer name you have defined in sip.conf for your outbound VoIP trunk. You can set the name and number to whatever you want. However, it is possible that your VoIP service provider will replace the blank number with the number that they have assigned to your account in which case you must ask them what method is available for withholding your caller ID.
0
 
LVL 4

Author Comment

by:jkockler
Comment Utility
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!
0
 
LVL 19

Expert Comment

by:feptias
Comment Utility
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.
0
 
LVL 19

Expert Comment

by:feptias
Comment Utility
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.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 4

Author Comment

by:jkockler
Comment Utility
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 !
0
 
LVL 4

Author Comment

by:jkockler
Comment Utility
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.
0
 
LVL 4

Author Comment

by:jkockler
Comment Utility
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.  
0
 
LVL 4

Author Comment

by:jkockler
Comment Utility
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!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

The Zaptel people (www.zaptel.com) got kind of annoyed with the fact that they were getting bombarded with searches for the zaptel driver system for Asterisk (not to mention they own the trademark on zaptel). So, they kindly requested that Digium ch…
Although VoiceOver IP has been around for a while, internet connections have only recently become fast enough to provide good call quality. Now, VoIP has become a real option for businesses looking at ways to improve their business model. In this ar…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now