Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asterisk anti ex-girlfriend Dial plan?

Tags:

asterisk

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
like image 275
Rev Avatar asked Sep 02 '10 07:09

Rev


2 Answers

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

like image 165
Shrikant Soni Avatar answered Oct 19 '22 11:10

Shrikant Soni


You do not have a step 2 for other callerids and autofalltrhough is enabled, which means (in 1.6) that the call will be dropped after step 1.

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

Edit: Are you sure the callerID is EXACTELLY 9999? Try replacing that line with

exten => s, 2, NoOp((${CALLERID(all)})

then look in the console and see what the callerID is.

use:

 asterisk -r 

then enter:

 core set verbose 5

also, enter:

show dialplan

and see if the dialplan is correctly loaded into asterisk

like image 40
Radu094 Avatar answered Oct 19 '22 12:10

Radu094