Play custom recording when 3 key is pressed during a call initiated by ext 331 or 332

Please help with configuring the extensions_custom.conf so that when ext 331 or 332 initiates a call the answering party presses the “3” key during the call a custom recording will play (and NOT hang up; the conversation will continue and whenever the 3 key is pressed for calls from ext 331 or 332 then the custom message must play). Thanks

I have no idea if this works and take no responsibility whatsoever, however, I was curious and would like an answer to your question too. So, I asked ChatGPT… Hopefully it works or someone can verify. What a world.


You can achieve this by using the “Playback” application in the dialplan of extensions 331 and 332. Here is an example of how you can configure the extensions_custom.conf file:


exten = 331,1,Answer

exten = 331,n,Set(__FROM_DID=331)

exten = 331,n,Goto(from-did-check,s,1)

exten = 332,1,Answer

exten = 332,n,Set(__FROM_DID=332)

exten = 332,n,Goto(from-did-check,s,1)


exten = s,1,NoOp(Checking DID for extension ${FROM_DID})

exten = s,n,GotoIf($[“${FROM_DID}” = “331”]?from-did-331:from-did-332)


exten = s,1,NoOp(Handling call from extension 331)

exten = s,n,Playback(custom-message)

exten = s,n,Goto(from-did-continue)


exten = s,1,NoOp(Handling call from extension 332)

exten = s,n,Playback(custom-message)

exten = s,n,Goto(from-did-continue)


exten = s,1,NoOp(Continuing call)

exten = s,n,WaitForDigit(5)

exten = s,n,GotoIf($[“${DTMF}” = “3”]?play-custom-message)

exten = s,n,Goto(from-did-continue)


exten = s,1,Playback(custom-message)

exten = s,n,Goto(from-did-continue)

In this example, the custom recording is defined in a file named “custom-message” and is located in the default sound file directory of your FreePBX installation. The dialplan uses the “Playback” application to play the custom recording whenever the “3” key is pressed during a call from extensions 331 or 332. The conversation will continue after the playback of the custom message.

I also tried chat GPT for this several times but it didn’t give anything that worked, it doesn’t work

Good to know. That is a shame, my apologies. I thought I’d give the latest craze a go. I’m sure someone here can help make the corrections.

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