SetCallerPres
Set CallerID Presentation
This application performs the identical operation to CallingPres(), but accepts descriptive text names instead of numeric values.
SetCallerPres(presentation):
Set Caller*ID presentation on a call to a new value.
Always returns 0. Valid presentations are:
allowed_not_screened : Presentation Allowed, Not Screened
allowed_passed_screen : Presentation Allowed, Passed Screen
allowed_failed_screen : Presentation Allowed, Failed Screen
allowed : Presentation Allowed, Network Number
prohib_not_screened : Presentation Prohibited, Not Screened
prohib_passed_screen : Presentation Prohibited, Passed Screen
prohib_failed_screen : Presentation Prohibited, Failed Screen
prohib : Presentation Prohibited, Network Number
unavailable : Number Unavailable
CLIR
This example shows how to dial out with CLIR (Calling Line Identification Restriction)
; the SetCallerPres(prohib) work (tested on Asterisk 1.0.7 +bristuff +zaphfc)
exten 2000,1,SetCallerPres(prohib)
exten 2000,2,Dial(Zap/4/0401234567)
User example: Incoming calls
For me in the end SetCallerPres(allowed) did the trick.
exten => <msn>,n,SetCallerPres(allowed)
If an ISDN (BRI) call arrives with the flag CallerPres() set to prohib, you can change the CALLERID(num) or CALLERID(name) with the corresponding set function and the CDRs look good, but the sip channel still has something like sip:Unknown <at> 192.168.161.18 in the from field. So the Phone/Softphone only reports about Unknown number and Unknown name.
Asterisk 1.6 change
SetCallerPres is deprecated. Please use Set(CALLERPRES()=allowed) instead.
See also:
- Asterisk cmd CallingPres
- Asterisk cmd SetCIDName: For Asterisk 1.0 and earlier
- Asterisk cmd Set: For Asterisk 1.2 and newer
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ