Dialplan after hangup

F: continues execution after hangup if caller hangs up.
g: continues execution after hangup if called party hangs up.

exten =>1000,1,dial(PJSIP/1000 , , gF)
same => n,NoOp(${ANSWEREDTIME})
same => n,hangup()

when the called party is hanging up then the dial plan continues execution to the next line and types the duration of the call.

whereas when the caller hangs up, it is true that the dial plan continues execution but it is not typing the ANSWEREDTIME … it is always NULL.

F - When the caller hangs up, transfer the called party to the next priority of the current extension and start execution at that location.

Note the “start”. F doesn’t continue execution, it starts a new execution on a different channel, the B leg channel.

1 Like

ohhh true!

then how could i get the call duration if any of both parties hanged up?

Try using a hangup handler. Hangup Handlers - Asterisk Project - Asterisk Project Wiki

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.