I am running a pretty current svn version of 1.6.0 so your version might be different.
If you use both options g and h on the dial command then if the called party hangs up you continue to the step after the dial. DIALSTATUS will be ANSWER so you can use that to go to some spot where you can set a variable to some value and then do Hangup() and it goes to the h extension. If the caller hangs up you go straight to the h extension. When you get to the h extension the following variables might be useful DIALSTATUS, DIALEDTIME, ANSWEREDTIME, BRIDGEPEER, DIALEDPEERNUMBER, DIALEDPEERNAME and CHANNEL -- Jim Dickenson mailto:[email protected] CfMC http://www.cfmc.com/ > From: Mindaugas Kezys <[email protected]> > Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion > <[email protected]> > Date: Sun, 22 Feb 2009 11:42:41 +0200 > To: <[email protected]> > Subject: Re: [asterisk-users] Dial() application 'g' option > > How to determine which channel hung up first? > > > Regards, > Mindaugas Kezys > http://www.kolmisoft.com > VoIP Billing and Routing Solutions > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Geoff Lane > Sent: 2009 m. vasario 22 d. 04:10 > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Dial() application 'g' option > > On Saturday, February 21, 2009, Philipp Kempgen wrote: > >> To be quite precise the documentation says >> ---cut--- >> g - Proceed with dialplan execution at the current extension if the >> destination channel hangs up. >> ---cut--- >> So I would not expect the g option to have any effect if the >> *source* channel hangs up. > >> I guess you should do any kind of logging or post-hangup calculations >> in the h extension. > > Thanks. I did wonder about that but carried out some experiments that > suggested it didn't matter which channel hung up first. I have two SIP > geographical numbers with different providers and I tried ringing one > from the other and got the same result no matter which handset I hung > up first. > > Unfortunately, by the time the call gets to the h extension, the > original dialled number in ${EXTEN} is changed to "h" - so I won't be > able to carry out the desired logging there. Also, I suspect that > ${DIALEDTIME} and ${ANSWEREDTIME} might be lost. That said, I'm only > interested in recording the accumulated time for outgoing calls via > one SIP trunk, so if I can tie that down with a channel name... > > Some further experimentation is in order! > > Thanks again, > > -- > Geoff > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
