Context Not Being Included: app-anouncement-xx-custom

asterisk
configuration
Tags: #<Tag:0x00007f702840c0f0> #<Tag:0x00007f70288ebd78>

(Jerry Riggin) #1

On FreePBX 14 Distro, at the end of extensions_custom.conf I have

#include announcement-custom.conf

In announcement-custom.conf (owned by asterisk) I have

[app-announcement-16-custom]
exten => s,1,NoOp(NightMode Dispo)
exten => s,n,AGI(nightmode.php)

However, the NoOp message never displays and the AGI is never called when announcement 16 plays. When dialplan is reloaded, every announcement EXCEPT 16 has the CLI line

Context ‘app-announcement-3’ tries to include nonexistent context ‘app-announcement-3-custom’

I need to have the AGI run before the announcement because if customer hangs up on announcement the announcement destination is never executed.

Anyone have any ideas?


#2

You will get to a context exten => s,1 . . . . way before your includes, (the call will follow the first s,1 it finds in the dialplan)


(Jerry Riggin) #3

Thanks, @dicko. The extensions_addional.conf for announcement 16 is

 [app-announcement-16]
include => app-announcement-16-custom
exten => s,1,GotoIf($["${CHANNEL(state)}" = "Up"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Noop(Playing announcement MSG_9-9-M-F)
exten => s,n,Playback(custom/NightMode/MSG_9-9-M-F,noanswer)
exten => s,n,Goto(ext-miscdests,1,1)

(misc dest 1 executes the AGI, but does not run if customer hangs up on announcement)

So it seems my [app-announcement-16-custom] should be called first, and it should be the first “1” – but that does not seem to be the case. I tried putting

#include announcement-custom.conf

in extensions_override_freepbx.conf but it still didn’t work. The file announcement-custom.conf is created via automation.

Any idea how can I get the AGI to run BEFORE the announcement?


#4

after a diaplan reload

rasterisk -x 'dialplan reload'                                          
rasterisk -x 'dialplan show @app-announcement-16'                                          


(Jerry Riggin) #5

And therein lies the problem:

[root@agents ~]# rasterisk -x 'dialplan show @app-announcement-16'
[ Context 'app-announcement-16' created by 'pbx_config' ]
  'fax' =>          1. Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)}) [pbx_config]
  's' =>            1. GotoIf($["${CHANNEL(state)}" = "Up"]?begin) [pbx_config]
                    2. Answer()                                   [pbx_config]
                    3. Wait(1)                                    [pbx_config]
     [begin]        4. Noop(Playing announcement MSG_9-9-M-F)     [pbx_config]
                    5. Playback(custom/NightMode/MSG_9-9-M-F,noanswer) [pbx_config]
                    6. Goto(ext-miscdests,1,1)                    [pbx_config]
  Include =>        'app-announcement-16-custom'                  [pbx_config]

-= 2 extensions (7 priorities) in 1 context. =-

The custom file is included AFTER the announcement.

I re-wrote my application to put the whole [app-announcement-XX] in extensions_override_freepbx.conf and that finally made it work. It updates about 600 announcements to run an AGI BEFORE the announcement.


(Itzik) #6

I just tested this, it includes it just fine.

[root@yptest asterisk]# asterisk -x"dialplan show s@app-announcement-1"
[ Context 'app-announcement-1' created by 'pbx_config' ]
  's' =>            1. GotoIf($["${CHANNEL(state)}" = "Up"]?begin) [extensions_additional.conf:101]
                    2. Answer()                                   [extensions_additional.conf:102]
                    3. Wait(1)                                    [extensions_additional.conf:103]
     [begin]        4. Noop(Playing announcement Test Announcement ) [extensions_additional.conf:104]
                    5. Playback(custom/MainNight01&custom/speech_2291,noanswer) [extensions_additional.conf:105]
                    6. Goto(app-blackhole,hangup,1)               [extensions_additional.conf:106]
[ Included context 'app-announcement-1-custom' created by 'pbx_config' ]
  's' =>            1. Noop(Custom Context)                               [announcement-custom.conf:2]
                    2. Set(foo=A)  [announcement-custom.conf:3]
                    3. Set(boo=B) [announcement-custom.conf:4]
                    4. Hangup()                                   [announcement-custom.conf:5]