Help me with a dialplan

Hi.
I have this:

exten=>s,1,Answer()
exten=>s,n,MixMonitor(/root/wav/demo.wav,b)
exten=>s,n,Wait(23)
exten=>s,n,Hangup()

exten=>h,1,Hangup()

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.
Example
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:

[global]
CONNECTIONS=0

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

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

the-asterisk-book.com/1.6/besond … 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

Hi

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

Ian

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 sinet.bt.com/351v4p5.pdf

I think that he is still trying to solve the hangup issue that he has for more than a year in his system. http://forums.asterisk.org/viewtopic.php?f=13&t=83859&p=177463#p177463