Asterisk won't work as diaplan says

I recently started a asterisk project and I wanted to play a sound file when I receives a call to my PSTN line. Actually using Obi110 I convert it to VoIP and transfer to raspberry pi which runs FreePBX and asterisk. However I registered Obi110 device on FreePBX and when I opened sip_addictional.conf , it shows Obi110 context is from-trunk. So I added;

exten => s,1,Answer()
exten => s,n,Playback(hello-world)
exten => s,n,Hangup

this to extension_custom.conf. However after that reloading the dialplan in asterisk, I made a call to PSTN line, but it doesn’t work as this says. Just rings. Am I doing something wrong?

from-trunk already exists so you’d need to be that into the override file not the custom file. Also be careful because you could override future updates.

Hello. Thank you. I actually changed the extensions.conf file after extensions_custom.conf failed to show any success. But still nothing happens. Just rings.

Did you change the override file? Or just extensions.conf.

I changed the extension.conf file and changed content under from-trunk. But had no luck.

You need to use the overrides file like I originally stated. “extensions_override_freepbx.conf”

Still have no luck. This is what I’m working on. I want to transfer incoming PSTN call to my Mobile kinda project but with more features. So I’ve configured FreePBX to transfer incoming call to softphone. So to verify it’s working correctly I configured it using FreePBX GUI. It works perfectly now. But now I want to run AGI python script when a call comes. So I have to use exten => s,1,AGI( to do that. But I had no luck on running that extension. So thought to test diaplan using simple command like playing a sound file. But still I cannot run a simple dialplan like this.

My incoming call from Obi110 comes in context=from-trunk. So changed and put,

exten => s,1,Answer()
exten => s,n,Playback(hello-world)
exten => s,n,Hangup

code under extensions.conf , extensions_custom.conf and extensions_override_freepbx.conf in different tries. But still call clearly goes to my softphone rather than automatically answer and play the sound file. So any help?

Don’t do that. Andrew has already told you twice why this won’t work.

You need to create a new context. Call it “[from-obi110]” and put the context code in either extensions_override_freepbx.conf or extensions_custom.conf.