Dialplan does not continue after caller hangs up

I sencerely believe that this is a very stupid question again, but after searching the internet for 2 days could not find the answer.

In a nutshell - I am initiating the call (the calling party), using linux soft phone “linphone”. After I hang up (press the red button in my linphone program), commands after DIAL are NOT executed. Should it be this way? How do I make them work?

The details are
version: Asterisk 10.5.0-rc1

== extenstions.conf ==

[gsm]
exten => _X.,1,system(echo "START" >> /asterisk-timing.txt)
exten => _X.,2,Dial(SIP/8881/11${EXTEN},60,g)
exten => _X.,3,system(echo "END" >> /asterisk-timing.txt)
exten => _X.,4,Hangup()

So, after the call is finished (my softphone is the one with ID 144), there is a line START in /asterisk-timing.txt file but there is no END line.

== sip.conf ==
[144]
type=friend
host=dynamic
username=144
secret=*********
context=gsm
disallow=all
allow=alaw

[8881]
type=friend
host=dynamic
username=8881
secret=**********
context=testgsm
disallow=all
allow=alaw
canreinvite=no

the CLI says

    -- Registered SIP '144' at 136.155.112.100:5060
  == Using SIP RTP CoS mark 5
    -- Executing [0500@gsm:1] System("SIP/144-000000a5", "echo "START" >> /asterisk-timing.txt") in new stack
    -- Executing [0500@gsm:2] Dial("SIP/144-000000a5", "SIP/8881/110500,60,g") in new stack
  == Using SIP RTP CoS mark 5
    -- Called SIP/8881/110500
    -- SIP/8881-000000a6 is ringing
    -- SIP/8881-000000a6 is making progress passing it to SIP/144-000000a5
    -- SIP/8881-000000a6 answered SIP/144-000000a5
    -- Locally bridging SIP/144-000000a5 and SIP/8881-000000a6
  == Spawn extension (gsm, 0500, 2) exited non-zero on 'SIP/144-000000a5'

So, no indication that commands

exten => _X.,3,system(echo "END" >> /asterisk-timing.txt) exten => _X.,4,Hangup()
are executed ((

p.s. By the way, do I need to use command Hangup() at all here? The reason for the question is that I have a feeling that after I press hangup on my softphone, it LOOKS like the call on the other side does not stop. Namely - if I call the same number again right after finishing the call asterisk writes “CONGESTION” in CLI

It looks like posting on this forum clears up my head a lot. I think I’ve found the solution. Please correct me if I am wrong

exten => _X.,1,system(echo "START" >> /asterisk-timing.txt)
exten => _X.,n,Dial(SIP/8881/11${EXTEN},60,g)
exten => h,1,system(echo "END" >> /asterisk-timing.txt)

But I would like to know the answer to my last question: do I have to add the Hangup command like this?

exten => _X.,1,system(echo "START" >> /asterisk-timing.txt)
exten => _X.,n,Dial(SIP/8881/11${EXTEN},60,g)
exten => h,1,system(echo "END" >> /asterisk-timing.txt)
exten => h,2,Hangup()

Hangup is not needed there.