My system consists of: Asterisk 11.8.1, Dahdi 2.9.1, Ubuntu Server 12.04
I have PSTN service with a 4 port Digium analog card configured as follows:
DAHDI/1 FXO connected to my provider
DAHDI/2 FXS connected to my home phones
DAHDI/3 connected to a hardware answering machine. This is where I send blocked calls
This is a cut/paste from my cdr-custom Master.csv log. I would like to block the following type of call where the first entry CDR(clid) is the same as the second entry CDR(src)
“8187896539”,“8187896539”,“s”,“DAHDI/1-1”,“DAHDI/2-1”,“Dial”,“DAHDI/2”,“2014-08-12 08:41:46”,“2014-08-12 08:42:02”,“2014-08-12 08:42:10”,“24”,“ANSWERED”
I have the following line in my dialplan. The objective is if the values of CDR(clid) is the same as CDR(src), then I want to block it (send it to DAHDI/3)
same => n,GotoIf($["${CDR(clid)}"="${CDR(src)}"]?blocked,1)
The problem I am having is that calls where it seems CDR(clid) is not the same as CDR(src) are also getting blocked. The following is an example from my log (with name and number changed) of a call that was blocked by this dialplan code.
“”“SMITH RICHARD “” <5555555555>”,“5555555555”,“blocked”,“DAHDI/1-1”,“DAHDI/3-1”,“Dial”,“DAHDI/3”,“2014-08-12 09:36:49”,“2014-08-12 09:36:59”,“2014-08-12 09:37:12”,“23”,“ANSWERED”
If I comment out the 1 line on the dial plan, then the call is no longer blocked
“”“SMITH RICHARD “” <5555555555>”,“5555555555”,“s”,“DAHDI/1-1”,“DAHDI/2-1”,“Dial”,“DAHDI/2”,“2014-08-12 09:41:53”,"",“2014-08-12 09:42:11”,“18”,“NO ANSWER”
Any ideas on how to fix this? Thanks in advance for any help.