Maybe I misunderstood your answer, but I could not get what I wanted to do.
I created a test context. Now it contains only common command to all extensions.
[my-test]
exten => _X.,1,NoOp(Call from '${CALLERID(all)}' to '${EXTEN}')
In sip.conf I describe this context, an outgoing for the test SIP-terminal.
And I call on еxtension 700.
-- Executing [700@my-test:1] NoOp("SIP/sip-t26p_1-0000018d", "Call from '"Ogogon !!!" <600>' to '700'") in new stack
-- Auto fallthrough, channel 'SIP/sip-t26p_1-0000018d' status is 'UNKNOWN'
So far so good. Common to all extensions commands work.
But this is not enough for me. Now I want to add commands that are specific to each extension.
[my-test]
exten => _X.,1,NoOp(Call from '${CALLERID(all)}' to '${EXTEN}')
exten => 700,1,NoOp(Exten 700)
same => n,HangUp()
Once again, I call on extension 700.
-- Executing [700@my-test:1] NoOp("SIP/sip-t26p_1-0000018c", "Exten 700") in new stack
-- Executing [700@my-test:2] Hangup("SIP/sip-t26p_1-0000018c", "") in new stack
== Spawn extension (my-test, 700, 2) exited non-zero on 'SIP/sip-t26p_1-0000018c'
Now, the general commands are not executed. Asterisk saw an explicit number, and lost interest in the templates.
Please tell me how to change my test context that executed and common commands and commands for a specific context?