FreePBX - How to Run Applications from from-pstn-custom context

Hi all.

Can anyone tell me why the first extension below works but the second one doesn’t ? Both are specified in the extensions_custom.conf file. The first one works fine, the second one runs the first line, then won’t run the rest. Both extension are exactly the same except for the extension number, but one is in from-internal-custom context and the other one is in from-pstn-custom context.

[from-internal-custom]

exten => 600,1(start),Gotoif($[ “${LEN(${extensao})}” < “3”]?collect:pstn)
exten => 600,n,NoOp(Executing - ${extensao} - )
exten => 600,n(collect),Read(digito,1)
exten => 600,n,SayDigits(${digito})
exten => 600,n,Set(extensao=${extensao}${digito})
exten => 600,n,GoTo(start)
exten => 600,n(pstn),GoTo(from-pstn-custom,s,1)
exten => 600,n,hangup()

[from-pstn-custom]

exten => 0398967500,1,Swift(Oh my god it works, yay, yay, and more yays !)
exten => 0398967500,1(start),Gotoif($[ “${LEN(${extensao})}” < “3”]?collect:pstn)
exten => 0398967500,n,NoOp(Executing - ${extensao} - )
exten => 0398967500,n(collect),Read(digito,1)
exten => 0398967500,n,SayDigits(${digito})
exten => 0398967500,n,Set(extensao=${extensao}${digito})
exten => 0398967500,n,GoTo(start)
exten => 0398967500,n(pstn),GoTo(from-pstn-custom,s,1)
exten => 0398967500,n,hangup()

Regards.

Andrew.

Do you have swift installed and working?

Yes

Is it because you have two 1? in those lines?

Hi Mikael, thanks for replying.

I have found the problem - nothing to do with contexts or lines of code after all. The second extension is an inbound route from a sip trunk connection to an fxo gateway. Problem was that i had the gateway dtmf mode set to in-audio rather than rfc-2833 - Asterisk read cmd was telling me the truth ! - no dtmf tones received. I changed this and now it all works. Thanks again !

Regards.

Andrew.