1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you had a PIAF Forum account in the vBulletin days, log in with your old credentials. Otherwise, sign up again and we'll get you back in business as soon as we can.
  3. A serious FreePBX vulnerability has been reported. Update your Framework Module immediately. Click here for details.

Anonymous CallerID filtering - another version

Discussion in 'Add-On Install Instructions' started by klingon888, Mar 11, 2008.

  1. klingon888 Guru

    Slight twist to jeremywillden's post :

    Found this idea from another site and modified it to suit my needs. Instead of parking the call, it allows the callee to press 1 to accept call, press 2 to send call to VM or press 3 to send "do not call" msg to caller. Hope you find it useful.

    Start with NV's original version but redirect to the custom-screen macros below :

    [from-external-custom]
    exten => s,1,Zapateller(answer|nocallerid)
    exten => s,2,Wait(1)
    exten => s,3,SetMusicOnHold(default)
    exten => s,4,GotoIf($["${CALLERID(num)}" = ""]?custom-screen,s,1)
    exten => s,5,GotoIf($["foo${CALLERID(num)}" = "foo"]?custom-screen,s,1)
    exten => s,6,GotoIf($["${CALLERID(name):0:9}" = "Anonymous"]?custom-screen,s,1)
    exten => s,7,GotoIf($["${CALLERID(name):0:7}" = "Unknown"]?custom-screen,s,1)
    exten => s,8,GotoIf($["${CALLERID(num):0:7}" = "Private"]?custom-screen,s,1)
    exten => s,9,GotoIf($["${CALLERID(name):0:7}" = "Private"]?custom-screen,s,1)
    exten => s,10,GotoIf($["${CALLERID(num):0:10}" = "Restricted"]?custom-screen,s,1)
    exten => s,11,GotoIf($["${CALLERID(num):0:4}" = "PSTN"]?custom-screen,s,1)
    exten => s,12,Dial(Local/99@from-internal)
    exten => s,13,Hangup

    [custom-screen]
    exten => s,1,Background(privacy-unident)
    exten => s,n,Background(vm-rec-name)
    exten => s,n,Set(SCREEN_FILE=/tmp/${CALLERID(num)}-${EPOCH})
    exten => s,n,Record(${SCREEN_FILE}.gsm|5|8)
    exten => s,n,Wait(1)
    ;added step to discourage telemarketers etc!
    exten => s,n,Background(custom/cust-pls-press-one-to-cont) ;record your own msg - pls press one to continue call
    exten => s,n,Set(TIMEOUT(response)=10)
    exten => s,n,WaitExten(10,)
    ;if no response after 10 secs, hang up
    exten => s,n,Playback(sorry-youre-having-problems&goodbye)
    exten => 1,1,Playback(pls-wait-connect-call)
    exten => 1,2,Dial(local/200@from-internal,20,mM(screen^${SCREEN_FILE})) ;replace your extension to ring
    exten => 1,3,Goto(s,25) ;goto VM if no one answers
    exten => s,25,Background(vm-nobodyavail)
    exten => s,26,Goto(ext-local,${VM_PREFIX}200,1) ;replace with your VM ext
    exten => s,27,Hangup
    exten => s,30,Playback(privacy-stop-calling-not-welcome)
    exten => s,31,Playback(goodbye)
    exten => s,32,Hangup
    exten => h,1,System(/bin/rm ${SCREEN_FILE}.gsm)

    ;if you have friends who like to block their number, give them a code like 7 to break thru screening at beginning of custom-screen when msg is playing
    exten => 7,1,Background(pls-hold-while-try)
    exten => 7,n,Goto(ext-group,200,1) ;replace with your ring grp to ring

    [macro-screen]
    exten => s,1,noop(${ARG1})
    exten => s,n,Playback(priv-callpending)
    exten => s,n,Playback(${ARG1})
    exten => s,n,Wait(1)
    ;record your own msg - press 1 to connect, 2 to send to VM, 3 to play do not call msg
    exten => s,n,Read(ACCEPT|custom/cust-screen-callee-options|1|2|10)
    exten => s,n,Gotoif($[${ACCEPT} = 1] ?71) ;connect call
    exten => s,n,Gotoif($[${ACCEPT} = 2] ?30) ;reject to vm
    exten => s,n,Gotoif($[${ACCEPT} = 3] ?50) ;play pls do not call msg
    exten => s,30,Set(MACRO_RESULT=GOTO:custom-screen^s^25)
    exten => s,31,Goto(70)
    exten => s,50,Set(MACRO_RESULT=GOTO:custom-screen^s^30)
    exten => s,51,Goto(70)
    exten => s,70,Playback(goodbye)
    exten => s,71,System(/bin/rm ${ARG1}.gsm)
    exten => h,1,System(/bin/rm ${ARG1}.gsm)
  2. edlally New Member

    One suggestion for the script is to insert the following line before exten => s,30 in [macro-screen]:

    exten => s,n,Gotoif($[${ACCEPT} = 4] ?1) ;repeat message

    This allows the recipient to reply the introductory message and caller's name. For me at least, it was easy to miss the caller's name the first time around.

    Cheers,

    Ed

  3. chdyoung New Member

    Simply way to black private or blocked callers

    A really simple way to handle blocked and private calls:

    - Add an inbound route and put "Blocked" in the Caller ID box.

    - Check the "CID Priority Route:" box.

    - Send this route to an unused extension (and optionally turn on voice mail for that extension).

    Mouse over the "Caller ID Number:" title and make a note of the other options available such as Anonymous, Private, Restricted, etc.

    Add an incoming route for each category that you want to block, filter, or redirect.

    If this is not elegant or complex enough for your taste, then there are other options.

Share This Page