asterisk anti ex-girlfriend Dial plan?

Rev picture Rev · Sep 2, 2010 · Viewed 7.1k times · Source

I wrote simple dial plan in asterisk. This dial-plan target is to check caller-id of incoming call and for specific hangup :) !

but this dial-plan hangup all incoming call with diffrent caller-id.
So what do i do? ;(

   [general]  
    static=yes  
    writeprotect=yes  
    autofallthrough=yes  
    clearglobalvars=no  
    priorityjumping=yes  
    include "exten_gvars.inc"  

    [macro-queue]
    exten => s, 1, Queue(${ARG1})

    [default]  
    exten => s, 1, Answer  
    exten => s/9999, 2 ,Hangup  
    exten => s, 2, BackGround(welcome)  
    exten => s, 3, Macro(queue,operator)  

Edit

i change my dial plan to this but it not working, incoming call hangup after two beep(i know it occur cuz a mistake in my dial plan)!

    [general]
static=yes
writeprotect=yes
autofallthrough=yes
clearglobalvars=no
priorityjumping=yes
#include "exten_gvars.inc"

[macro-monitor]
exten => s, 1, MixMonitor(${UNIQUEID}.wav)
exten => s, 2, SetCIDName(${UNIQUEID}#${CALLERIDNAME},a)

[macro-defaultLine]
exten => s, 1, Macro(monitor)
exten => s, 2, Dial(SIP/${ARG1},60,T)

[macro-queue]
exten => s, 1, Macro(monitor)
exten => s, 2, Queue(${ARG1})

[inbound]
exten => _XX, 1, Macro(defaultLine,${EXTEN})

[default]
exten => 123,1,GotoIf($[${CALLERID(num)} = XX]?reject:allow)
exten => 123,n(allow),Answer
exten => 123,n,BackGround(welcome)
exten => 123,n,Macro(queue,operator)
exten => 123,n(reject),BackGround(WTF)
exten => 123,n,Hangup()
include => inbound

Answer

Shrikant Soni picture Shrikant Soni · Sep 13, 2010

Here is your anti ex-girlfriend Dailplan, assuming xxxxx is your ex-girlfriends number

exten => 123,1,GotoIf($[${CALLERID(num)} = xxxxx]?reject:allow)
exten => 123,n(allow),Dial(Zap/4)
exten => 123,n,Hangup()
exten => 123,n(reject),Playback(abandon-all-hope)
exten => 123,n,Hangup()

Hope this helps you