Help me with a dialplan

I have this:



When a call from pstn go to this dialplan, the file is recorded but when the client hangup, the extensions h is not executed.

How make after record the file inmediatly the client hangup, the h be execute?

What exactly do you want do to my friend. Does not make sense this [quote]exten=>h,1,Hangup()[/quote].

The h extension
The h is the standard “hang-up” extension. The h extension, if it is configured, is called when a caller hangs up the phone. Note that as soon as this happens, the content of ${EXTEN} changes to h.
Say we want the global variable CONNECTIONS to reflect the number of currently active conversations at any given time. This means we need the value of CONNECTIONS to increase by one every time a connection is initiated and decrease by one every time someone hangs up. The following dialplan illustrates the basic idea:


exten => _X.,1,Set(CONNECTIONS=$[${CONNECTIONS} + 1]|g)
exten => _X.,2,Dial(SIP/${EXTEN})

exten => h,1,Set(CONNECTIONS=$[${CONNECTIONS} - 1]|g) … sions.html

If you call from you IP phone the extension h is executed. Right, perfect.
But when you use my example, calling from PSTN via FXO to my example, the file is recorded but the dialplan never execute the extension h after a hangup.

Is like if asterisk is ignoring the extension h


Sounds like you are not getting CPC signals on your pots line, or they are not being recognised.


I’d agree with Ian. Of course, it is possible that your service provider doesn’t offer that facility.

Asterisk can detect calling party clearing on an analogue line either because the network temporarily removes the battery voltage, or, as a less preferred option, the network puts a tone on the line. If they do neither, or you don’t configure for the correct one, there is no way that Asterisk can tell the call has been cleared.

If they put a tone on the line, you should be able to hear this on the recording. I’m not sure what sorts of tone Asterisk can detect.

BT in the UK can use one or more of three methods, two as above, and one which Asterisk can’t detect, which is simply to make the line silent, See section 7.2 of

I think that he is still trying to solve the hangup issue that he has for more than a year in his system.