Play announcement on ALL inbound routes then go to normal routing

I have about 400 inbound routes that need to play an announcement before being routed normally. “For quality and training purposes, this call my be monitored.”

I started working through the list but I don’t want to have to make 400 separate announcements.

I tried adding this to my “extensions_custom.conf” file and then changing my inbound trunk context to “context=inbound-play-msg-to-all” but it didn’t work. Didn’t seem to affect any incoming calls at all.

exten => s,1,NoOp(Lets play a message for all incoming messages)
same => s,Playback(quality_and_training_advisement_pro.wav)
same => s,Goto(ext-did,${EXTEN},1)
same => s,Hangup

exten => _.,1,NoOp(Lets play a message for all incoming messages)
exten => _.,n,Playback(quality_and_training_advisement_pro.wav)   ; you prob don't wan't the file ext
exten => _.,n,Goto(from-trunk,${EXTEN},1)

Thanks Lorne, I’ll try taking off the extension on the filename

That wasn’t the only change I made.

Took off the extension and it still doesn’t play anything before moving on with the call routing.

oh I missed that.

The file is also probably best referred to as

exen => _.,n,Playback(custom/quality_and_training_advisement_pro)

no extension needed and the files are ‘rooted’ in /var/lib/asterisk/sounds/

Okay here’s what my extensions_custom.conf looks like:

exten => _.,1,NoOp(Lets play a message for all incoming messages)
exten => _.,n,Playback(custom/quality_and_training_advisement_pro)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

Still not working. Just follows normal inbound route call flow.

Did you send your inbound calls to the “inbound-play-msg-to-all” context?

yes. I have two inbound trunks. Bandwidth A and Bandwidth B.

I changed both to say “context=inbound-play-msg-to-all”

post a log of an inbound call that uses one of those trunks

Ok will do. I’ll need to wait until everyone goes home first because there are so many calls incoming and outgoing I’ll need to wait until it’s quite to isolate a single call. Thanks for all your help!

You can grep out an individual call using the string between [ and ]

grep “[nnnnn]” /var/log/asterisk/full

I got it:

[2019-07-02 12:39:29] VERBOSE[2710][C-000aadc0] pbx.c: Executing [[email protected]:1] Set(“SIP/BW-SIP-A-00047331”, “GROUP()=OUT_1”) in new stack

Line 1 is the only relevant line, you have not configured the trunk to use your new context. If you have separate inbound and outbound peer details, configure both with the context line.

That worked! Thanks Lorne and Dicko! I was only adding context to inbound. You guys are great!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.