Surely available... variable containing last extension

This must exist…

A system variable holding the value of the extension you’ve just come from. I know you can get ${INVALID_EXTEN} when in the default i extension but what about when you jump from one extension to ‘s’ in another context… ${EXTEN} will just return ‘s’.

I know you could set your own variable before moving to each new extension but that would be quite a big code rewrite for me.

Hi

why not send it to:

[context]
exten => sXXXX,1,Noop(${EXTEN:1})

with

exten => XXXX,1,Goto(context,s${EXTEN},1)