tags:

views:

231

answers:

2

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
+2  A: 

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

Radu094
I change my dial plan as like you said. but now for 9999 number call didn't hangup and all call same as as 9999 number, go to background step.
Rev
thanks but is there any solution for see caller id for incoming call or online calls. i check my voip gateway and see number, and input that number in my dial plan. thanks for your attention
Rev
The NoOp(${CallerID(all)}) will display the caller id on the asterisk console when that step is executed.
Radu094
+9  A: 

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

shrikant.soni
thanks but see my edit. your solution don't work
Rev
How this answer got so many upvotes is beyond me. I see this kind of dialplan all the time. Guys,what happens when you have 2 ex-girlfriends? or 50 ? How many times did you need to screen for 1 single number. Most often it is a list of numbers and list of prefixes. The GotoIf will not work. Use the dialplan as it was intended, or move to an AGI script if you feel like programming.
Radu094