Blocklist [NOT BLACKLIST]

Is it possible to create a blocklist for FreePBX?

What I’m talking about is an external file on the fliesystem that contains wildcard strings?.. or a non-blocking call out to a web service?

I ask because I have over sixty number blocks that I want to “Terminate Call - Hangup” on. I have been creating “Inbound Routes” for them but its getting a little bit tedious so create or maintain more the 60 “Inbound Routes” just to “Terminate Call - Hangup” on.

The format would be similar to:

_4259538NXX
_5034571NXX
_5034685NXX
_5035630NXX
_5035922NXX
_5037702NXX
_5037730NXX
.
.
.

Or, if this is something I’d have to code myself, where would I place the hook?

Thanks…

from bash:-

rasterisk -x “database put blacklist 312NXXXXXX 1”

would deny Chicago.

echo “
4259538NXX
034571NXX
5034685NXX
5035630NXX
5035922NXX
5037702NXX
5037730NXX
” >> your_file

a one-liner:-

for i in cat your_file;do rasterisk -x “database put blacklist $i 1”;done

to check

rasterisk -x 'database show blacklist ’

One important distinction from blacklist is I need to “black hole” the call as in “Terminate Call - Hangup” which is not what blacklist does.

I believe the destination is known as ‘app-blackhole,hangup,1’.

I suspect that FreePBX does not contain functionality to do this and I’ll need to find a 3rd party module or write my own, but I don’t know for sure.

Or possibly preempting system blacklist and manually checking the blacklist database with

then terminating the call as I please?

[Edit] Just checked with Asterisk, you cannot use wildcards in lookupblacklist() you will need to add the numbers individually, so go with the from-pstn-custom which will be in you extensions custom file idea I guess . . .

[from-pstn-custom]
exten => _43434NXXXX,1,hangup()
.
.
.

should be easy to do. just remember to

rasterisk -x reload

after writing to the _custom file


In black-hole you can hangup, zapateller,musiconhold congestion give busy or ring

which context do you want to send your blocked numbers to ?

you can add whatever you want in the contxt from-pstn-custom in your custom file.

[app-blackhole]
include => app-blackhole-custom
exten => hangup,1,Noop(Blackhole Dest: Hangup)
exten => hangup,n,Hangup
exten => zapateller,1,Noop(Blackhole Dest: Play SIT Tone)
exten => zapateller,n,Answer
exten => zapateller,n,Zapateller()
exten => musiconhold,1,Noop(Blackhole Dest: Put caller on hold forever)
exten => musiconhold,n,Answer
exten => musiconhold,n,MusicOnHold()
exten => congestion,1,Noop(Blackhole Dest: Congestion)
exten => congestion,n,Answer
exten => congestion,n,Playtones(congestion)
exten => congestion,n,Congestion(20)
exten => congestion,n,Hangup
exten => busy,1,Noop(Blackhole Dest: Busy)
exten => busy,n,Answer
exten => busy,n,Playtones(busy)
exten => busy,n,Busy(20)
exten => busy,n,Hangup
exten => ring,1,Noop(Blackhole Dest: Ring)
exten => ring,n,Answer
exten => ring,n,Playtones(ring)
exten => ring,n,Wait(300)
exten => ring,n,Hangup

; end of [app-blackhole]

black-list
###############################################################################

[app-blacklist-check]
include => app-blacklist-check-custom
exten => s,1(check),LookupBlacklist()
exten => s,n,GotoIf($["${LOOKUPBLSTATUS}"=“FOUND”]?blacklisted)
exten => s,n,Set(CALLED_BLACKLIST=1)
exten => s,n,Return()
exten => s,n(blacklisted),Answer
exten => s,n,Wait(1)
exten => s,n,Zapateller()
exten => s,n,Playback(ss-noservice)
exten => s,n,Hangup

There is the 3rd party module, Swiss Army Knife which adds whitelist/blacklist by regex pattern in addition to other features. It was developed for FreePBX 2.9 and is not fully compatible with FreePBX 2.10, I don’t know if the black/white list features are working in 2.10 or not, but it will certainly give you an excellent place to start.

Dev site is here: https://github.com/POSSA/freepbx-swiss-army-knife

Discussion is here: http://pbxinaflash.com/community/index.php?threads/freepbx-swiss-army-knife-module.10802/

Ok, so I’m actually looking for this right:

[from-pstn-custom]
exten => _X./_6091NXXXXX,1,Goto(app-blackhole,hangup,1)
exten => _X./_9081NXXXXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_2064960NXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_2532468NXX,n,Goto(app-blackhole,hangup,1)
.
.
.

and a reload is:

rasterisk -x "core reload"

What am I doing wrong, these aren’t working:

[from-pstn-custom]
exten => _X./_2012986XXX,1,Goto(app-blackhole,hangup,1)
exten => _X./_2064960XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_2532468XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_2533829XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_3603288XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_3604743XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_3605296XXX,n,Goto(app-blackhole,hangup,1)
.
.
.

BTW, I’m getting this in the dialplan:

[ Context 'from-pstn-custom' created by 'pbx_config' ]
  '_X.' (CID match '_2012986XXX') =>  1. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_2064960XXX') =>  2. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_2532468XXX') =>  3. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_2533829XXX') =>  4. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_3603288XXX') =>  5. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_3604743XXX') =>  6. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_3605296XXX') =>  7. Goto(app-blackhole,hangup,1)               [pbx_config]
.
.
.

Any ideas?

Do a ‘dialplan show @from-pstn’ and make sure your changes are included.

You must run a ‘dialplan reload’ for these changes to take effect.

Also the trunk must truly be receiving the call so do a call trace and make sure it is arriving in the right context.

They are definitely in the dial plan. I was mostly concerned that my syntax was wrong.

The trunk context is “from-trunk” which I understand is aliased to “from-pstn”, and from looking through the configuration files what I see supports that. In the log file the call shows up in the “from-trunk” context. Everything looks like it should work, but it doesn’t… and that usually means I did something stupid that I’m looking right at and not seeing.

Not aliased directly, more included, perhaps your inbound calls come in on from-sip-external if you use IP based routing. :-

;-------------------------------------------------------------------------------
; from-trunk:
;
; Context is really just an aliax of from-pstn
;
[from-trunk]
include => from-pstn
;-------------------------------------------------------------------------------

;-------------------------------------------------------------------------------
; from-pstn:
;
; Entry context for calls from the outside world to hit FreePBX

but while I was there digging up the “authority” this context, (for +1 inbound ) might be a good template for you

[from-pstn-e164-us]
exten => +1NXXNXXXXXX/+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _+1NXXNXXXXXX/_NXXNXXXXXX,2,Goto(from-pstn,${EXTEN:2},1)
exten => +1NXXNXXXXXX/+X.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => _+1NXXNXXXXXX/_011X.,n,Goto(from-pstn,${EXTEN:2},1)
exten => _+1NXXNXXXXXX,1,Goto(from-pstn,${EXTEN:2},1)
exten => [0-9+]./+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _[0-9+]./_NXXNXXXXXX,n,Goto(from-pstn,${EXTEN},1)
exten => [0-9+]./+X.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => _[0-9+]./_011X.,n,Goto(from-pstn,${EXTEN},1)
exten => [0-9+].,1,Goto(from-pstn,${EXTEN},1)
exten => s/
+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => s/NXXNXXXXXX,n,Goto(from-pstn,${EXTEN},1)
exten => s/
+X.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => s/_011X.,n,Goto(from-pstn,${EXTEN},1)
exten => s,1,Goto(from-pstn,${EXTEN},1)
;-------------------------------------------------------------------------------

[from-pstn]
include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
include => ext-did
include => ext-did-post-custom
include => from-did-direct
include => ext-did-catchall ; THIS MUST COME AFTER ext-did
;-------------------------------------------------------------------------------

look at an incoming call to check.

Ok, so this is bizzar. I had a test rule somewhere in the middle of the list and it never got a hit. So, I moved it up to the top as the first record, and it worked. Then I moved it down 10 lines and it still worked, I moved it down another 10, and still working. I continued moving it down 10 at a time and it was working consistently. But then I checked the dial plan and see this:

  '_X.' (CID match '_6093570XXX') =>  44. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6093571XXX') =>  45. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6093574XXX') =>  46. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6097312XXX') =>  8. Goto(app-blackhole,hangup,1)               [pbx_config]
                    47. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7012171XXX') =>  48. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7012645XXX') =>  49. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7012646XXX') =>  50. Goto(app-blackhole,hangup,1)              [pbx_config]

there is something very wrong going on there and its looking less and less like its something I did.

This is the test pattern BTW: _6097312XXX

I will bet that the inbound call matched ‘_6097312XXX’ though :wink:

edit: either I missed it or you edited so it is working, be careful using 1,2,3,4 etc in a context, start at 1 then use n,n,n,n ( n for next) or you will be editing all-day like we did back in 2003

Yes it matched _6097312XXX, and has been matching it since I moved it to the top the file.

NO, I have not fixed it.

Note, I was showing the dialplan. In that n,n,n has been expanded to 1,2,3. For example, ‘extensions_custom.conf’ is

.
.
.
exten => _X./_6091XXXXXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6093570XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6093571XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6093574XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6097312XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7012171XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7012645XXX,n,Goto(app-blackhole,hangup,1)
.
.
.

however, ‘dialplan show’ looks like this:

.
.
.
 '_X.' (CID match '_6091XXXXXX') =>  43. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6093570XXX') =>  44. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6093571XXX') =>  45. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6093574XXX') =>  46. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6097312XXX') =>  8. Goto(app-blackhole,hangup,1)               [pbx_config]
                    47. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7012171XXX') =>  48. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7012645XXX') =>  49. Goto(app-blackhole,hangup,1)              [pbx_config].
.
.

and no, that isn’t a problem with my editing, the output of the ‘dialplan show’ looks corrupt.

perhaps to should post your whole custom context starting at:-

[from-pstn-custom]

until the end

your ellipses are confusing.

This is the whole thing, sorry but its kinda long:


#include extensions_aastra.conf
[from-pstn-custom]
exten => _X./_2012986XXX,1,Goto(app-blackhole,hangup,1)
exten => _X./_2064960XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_2532468XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_2533829XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_3603288XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_3604743XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_3605296XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6097312XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4062192XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4062249XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4062903XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4062908XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4063514XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4064263XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4064782XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4064787XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4065305XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4065489XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4066232XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4066233XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4066408XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4067150XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4067151XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4067202XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4068528XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4069313XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4069425XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4069486XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4069488XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4253908XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4256588XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_4259538XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5034571XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5034685XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5035630XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5035922XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5037702XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5037730XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5038372XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5038500XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5038988XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_5039028XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6091XXXXXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6093570XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6093571XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6093574XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_6097312XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7012171XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7012645XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7012646XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7013014XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7015008XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7015098XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7016252XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7016255XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7016611XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7016613XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7017120XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7017121XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7017122XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7017123XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7017124XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7019209XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7019231XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7328070XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7328076XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_7329072XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9081XXXXXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9083881XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9712089XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9712131XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9712179XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9712201XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9712488XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9712596XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9712778XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9713338XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9713431XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9713730XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9713731XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9713732XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9737861XXX,n,Goto(app-blackhole,hangup,1)
exten => _X./_9737863XXX,n,Goto(app-blackhole,hangup,1)

This is from the log as a result of the “dialplan reload”

.
.
.
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension 's' priority 14 to macro-presence-playnotification
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Registered extension context 'from-pstn-custom'; registrar: pbx_config
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 1 (CID match '_2012986XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 2 (CID match '_2064960XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 3 (CID match '_2532468XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 4 (CID match '_2533829XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 5 (CID match '_3603288XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 6 (CID match '_3604743XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 7 (CID match '_3605296XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 8 (CID match '_6097312XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 9 (CID match '_4062192XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 10 (CID match '_4062249XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 11 (CID match '_4062903XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 12 (CID match '_4062908XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 13 (CID match '_4063514XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 14 (CID match '_4064263XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 15 (CID match '_4064782XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 16 (CID match '_4064787XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 17 (CID match '_4065305XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 18 (CID match '_4065489XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 19 (CID match '_4066232XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 20 (CID match '_4066233XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 21 (CID match '_4066408XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 22 (CID match '_4067150XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 23 (CID match '_4067151XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 24 (CID match '_4067202XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 25 (CID match '_4068528XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 26 (CID match '_4069313XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 27 (CID match '_4069425XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 28 (CID match '_4069486XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 29 (CID match '_4069488XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 30 (CID match '_4253908XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 31 (CID match '_4256588XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 32 (CID match '_4259538XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 33 (CID match '_5034571XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 34 (CID match '_5034685XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 35 (CID match '_5035630XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 36 (CID match '_5035922XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 37 (CID match '_5037702XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 38 (CID match '_5037730XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 39 (CID match '_5038372XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 40 (CID match '_5038500XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 41 (CID match '_5038988XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 42 (CID match '_5039028XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 43 (CID match '_6091XXXXXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 44 (CID match '_6093570XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 45 (CID match '_6093571XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 46 (CID match '_6093574XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 47 (CID match '_6097312XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 48 (CID match '_7012171XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 49 (CID match '_7012645XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 50 (CID match '_7012646XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 51 (CID match '_7013014XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 52 (CID match '_7015008XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 53 (CID match '_7015098XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 54 (CID match '_7016252XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 55 (CID match '_7016255XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 56 (CID match '_7016611XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 57 (CID match '_7016613XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 58 (CID match '_7017120XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 59 (CID match '_7017121XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 60 (CID match '_7017122XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 61 (CID match '_7017123XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 62 (CID match '_7017124XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 63 (CID match '_7019209XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 64 (CID match '_7019231XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 65 (CID match '_7328070XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 66 (CID match '_7328076XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 67 (CID match '_7329072XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 68 (CID match '_9081XXXXXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 69 (CID match '_9083881XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 70 (CID match '_9712089XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 71 (CID match '_9712131XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 72 (CID match '_9712179XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 73 (CID match '_9712201XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 74 (CID match '_9712488XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 75 (CID match '_9712596XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 76 (CID match '_9712778XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 77 (CID match '_9713338XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 78 (CID match '_9713431XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 79 (CID match '_9713730XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 80 (CID match '_9713731XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 81 (CID match '_9713732XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 82 (CID match '_9737861XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Added extension '_X.' priority 83 (CID match '_9737863XXX') to from-pstn-custom
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Registered extension context 'from-digital'; registrar: pbx_config
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Including context 'from-pstn' in context 'from-digital'
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Registered extension context 'from-analog'; registrar: pbx_config
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Including context 'from-dahdi' in context 'from-analog'
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Registered extension context 'from-trunk'; registrar: pbx_config
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Including context 'from-pstn' in context 'from-trunk'
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Registered extension context 'from-pstn'; registrar: pbx_config
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Including context 'from-pstn-custom' in context 'from-pstn'
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Including context 'ext-did' in context 'from-pstn'
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Including context 'ext-did-post-custom' in context 'from-pstn'
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Including context 'from-did-direct' in context 'from-pstn'
[2012-08-27 18:59:56] VERBOSE[21717] pbx.c:     -- Including context 'ext-did-catchall' in context 'from-pstn'
.
.
.

and this is relevant part of “dialplan show”

.
.
.
[ Context 'from-digital' created by 'pbx_config' ]
  Include =>        'from-pstn'                                   [pbx_config]

[ Context 'from-pstn-custom' created by 'pbx_config' ]
  '_X.' (CID match '_2012986XXX') =>  1. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_2064960XXX') =>  2. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_2532468XXX') =>  3. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_2533829XXX') =>  4. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_3603288XXX') =>  5. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_3604743XXX') =>  6. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_3605296XXX') =>  7. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_4062192XXX') =>  9. Goto(app-blackhole,hangup,1)               [pbx_config]
  '_X.' (CID match '_4062249XXX') =>  10. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4062903XXX') =>  11. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4062908XXX') =>  12. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4063514XXX') =>  13. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4064263XXX') =>  14. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4064782XXX') =>  15. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4064787XXX') =>  16. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4065305XXX') =>  17. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4065489XXX') =>  18. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4066232XXX') =>  19. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4066233XXX') =>  20. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4066408XXX') =>  21. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4067150XXX') =>  22. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4067151XXX') =>  23. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4067202XXX') =>  24. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4068528XXX') =>  25. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4069313XXX') =>  26. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4069425XXX') =>  27. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4069486XXX') =>  28. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4069488XXX') =>  29. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4253908XXX') =>  30. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4256588XXX') =>  31. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_4259538XXX') =>  32. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5034571XXX') =>  33. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5034685XXX') =>  34. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5035630XXX') =>  35. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5035922XXX') =>  36. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5037702XXX') =>  37. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5037730XXX') =>  38. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5038372XXX') =>  39. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5038500XXX') =>  40. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5038988XXX') =>  41. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_5039028XXX') =>  42. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6091XXXXXX') =>  43. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6093570XXX') =>  44. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6093571XXX') =>  45. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6093574XXX') =>  46. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_6097312XXX') =>  8. Goto(app-blackhole,hangup,1)               [pbx_config]
                    47. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7012171XXX') =>  48. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7012645XXX') =>  49. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7012646XXX') =>  50. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7013014XXX') =>  51. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7015008XXX') =>  52. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7015098XXX') =>  53. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7016252XXX') =>  54. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7016255XXX') =>  55. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7016611XXX') =>  56. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7016613XXX') =>  57. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7017120XXX') =>  58. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7017121XXX') =>  59. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7017122XXX') =>  60. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7017123XXX') =>  61. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7017124XXX') =>  62. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7019209XXX') =>  63. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7019231XXX') =>  64. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7328070XXX') =>  65. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7328076XXX') =>  66. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_7329072XXX') =>  67. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9081XXXXXX') =>  68. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9083881XXX') =>  69. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9712089XXX') =>  70. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9712131XXX') =>  71. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9712179XXX') =>  72. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9712201XXX') =>  73. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9712488XXX') =>  74. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9712596XXX') =>  75. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9712778XXX') =>  76. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9713338XXX') =>  77. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9713431XXX') =>  78. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9713730XXX') =>  79. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9713731XXX') =>  80. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9713732XXX') =>  81. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9737861XXX') =>  82. Goto(app-blackhole,hangup,1)              [pbx_config]
  '_X.' (CID match '_9737863XXX') =>  83. Goto(app-blackhole,hangup,1)              [pbx_config]

[ Context 'macro-presence-playnotification' created by 'pbx_config' ]
  's' =>            1. Wait(1)                                    [pbx_config]
                    2. Set(_REALCALLERIDNUM=${REALCALLERIDNUM})   [pbx_config]
                    3. GotoIf($["${ARG1}" = ""]?play-extension:play-name-recording) [pbx_config]
     [play-name-recording] 4. Playback(${ARG1})                          [pbx_config]
                    5. Goto(available)                            [pbx_config]
     [play-extension] 6. Playback(extension)                        [pbx_config]
                    7. SayDigits(${EXTENSION})                    [pbx_config]
     [available]    8. Playback(is&available)                     [pbx_config]
                    9. GotoIf($["${ARG2}" = ""]?speech-connect:end-novm) [pbx_config]
     [speech-connect] 10. Playback(custom/would-you-like-to-connect) [pbx_config]
                    11. Read(CONNECTME,press-1,1)                 [pbx_config]
                    12. ExecIf($[${CONNECTME} = 1],Macro,user-callerid) [pbx_config]
                    13. ExecIf($[${CONNECTME} = 1],Dial,Local/${EXTENSION}@from-internal) [pbx_config]
                    14. SET(MACRO_RESULT=ABORT)                   [pbx_config]
.
.
.

Its pretty clear that it reaches the [from-pstn-custom] context, but then the behavior is somewhat unpredictable.

I have never heard of Asterisk corrupting a dial plan. What is interesting is it is parsed into the dial plan.

You didn’t mention how you built this system, where you got Asterisk and FreePBX from (distro or source) and what version numbers.

try

[from-pstn-custom]
exten => _X./_2012986XXX,1,Playback(custom/no_salescalls)
exten => _X./_2012986XXX,n,Goto(app-blackhole,hangup,1)

exten => _X./_2064960XXX,1,Playback(custom/no_people_from_the_other_side_of_thetrack)
exten => _X./_2064960XXX,n,Goto(app-blackhole,hangup,1

exten => _X./_2532468XXX,1,Goto(app-blackhole,hangup,1)

exten => _X./_2533829XXX,1,Goto(app-blackhole,zapateller,1)

exten => _X./_3603288XXX,1,Goto(app-blackhole,congestion,1)

exten => _X./_3604743XXX,1,Goto(app-blackhole,busy,1)

exten => _X./_3605296XXX,1,Goto(app-blackhole,ring,1)

exten => _X./_6097312XXX,1,Goto(app-blackhole,hangup,1)

exten => _X./_3235551212,1,System(mail -s “my wife just called ${EXTEN}” [email protected])
exten => _X./_3235551212,n,Goto(from-pstn,${EXTEN},1)

etc.

you see how each context starts at 1 and then n ?

Yea, sorry. Its FreePBX Distro 1.812.210.58-1

The hardware was pristine.

I just kicked the box, I’ve been doing reload which seems to be doing a merge and I thought maybe there was a problem with a merge, however, after the reboot the dialplan still has that strange entry. It must have been persisted somewhere.

I’m going to try taking everything out of that context, reloading, and then putting it all back.