Re: [Asterisk-Users] h extension seems to wipe variables?
Brian West wrote: Correct me if i'm wrong but doesn't the cdr modules log the call duration? If you look at the last sentence of my post: Storing stuff using the cdr isn't really an option. This is because I want to add other things to my call log that CDR doesn't support (for custom IVR apps and the like), and I'd rather not have to write scripts to pull stuff from the CDR database and sync it with a table in another database, which would be really ugly. -- Alastair Maw <[EMAIL PROTECTED]> MX Telecom - Systems Analyst http://www.mxtelecom.com ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] h extension seems to wipe variables?
At 11:50 13-8-2003 -0500, you wrote: Correct me if i'm wrong but doesn't the cdr modules log the call duration? True, but in some cases you would want to do more. I have built IVR's that require some after-call handling. For this I tried to use variables as well, but failed. The solution in my case was to pass the variables from the extensions.conf and passing them as arguments to the AGI script rather then reading them inside the AGI script. > I'm trying to do some custom call logging, and I want to call an AGI > script from a hangup handler to log call durations and things. Although > the script executes, it isn't retrieving variables from the AGI > interface. Looking closer, I realised the variables are actually getting > unset before the h extension is reached. > > [foo] > s,1,SetVar,foo=bar > s,2,Play(audio/a-long-prompt) > h,1,AGI(log-call-duration.pl) > > When I do an $agi->get_variable("foo") from the perl, I get the string > "noresponse" returned. > > This all works fine if I don't call the AGI from the hangup extension, > but from a normal one instead. Met vriendelijke groet, Florian Overkamp ObSimRef BV (http://www.obsimref.com/) ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] h extension seems to wipe variables?
Correct me if i'm wrong but doesn't the cdr modules log the call duration? bkw On Wed, 13 Aug 2003, Alastair Maw wrote: > Hi. > > I'm trying to do some custom call logging, and I want to call an AGI > script from a hangup handler to log call durations and things. Although > the script executes, it isn't retrieving variables from the AGI > interface. Looking closer, I realised the variables are actually getting > unset before the h extension is reached. > > [foo] > s,1,SetVar,foo=bar > s,2,Play(audio/a-long-prompt) > h,1,AGI(log-call-duration.pl) > > When I do an $agi->get_variable("foo") from the perl, I get the string > "noresponse" returned. > > This all works fine if I don't call the AGI from the hangup extension, > but from a normal one instead. > > Does anyone have any idea how I might fix or work around this? It's > important for us to log call durations (and other things), which > obviously needs to be done when the users hangs up. Storing stuff using > the cdr isn't really an option. > > -- > Alastair Maw <[EMAIL PROTECTED]> > MX Telecom - Systems Analyst > http://www.mxtelecom.com > > ___ > Asterisk-Users mailing list > [EMAIL PROTECTED] > http://lists.digium.com/mailman/listinfo/asterisk-users > ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] h extension seems to wipe variables?
I would imagine that using some sort of variable temp structure might help you. However, the trick is keying the database tree so that in the event of multiple calls at the same time, you're looking at the "right" tree during your post-call processing. Hmm... is ${CHANNEL} getting erased in the h context? That would be the "best" key, I suppose. JT At 8:47 AM +0200 8/14/03, Florian Overkamp wrote: At 11:50 13-8-2003 -0500, you wrote: Correct me if i'm wrong but doesn't the cdr modules log the call duration? True, but in some cases you would want to do more. I have built IVR's that require some after-call handling. For this I tried to use variables as well, but failed. The solution in my case was to pass the variables from the extensions.conf and passing them as arguments to the AGI script rather then reading them inside the AGI script. > I'm trying to do some custom call logging, and I want to call an AGI script from a hangup handler to log call durations and things. Although the script executes, it isn't retrieving variables from the AGI interface. Looking closer, I realised the variables are actually getting unset before the h extension is reached. [foo] s,1,SetVar,foo=bar s,2,Play(audio/a-long-prompt) h,1,AGI(log-call-duration.pl) When I do an $agi->get_variable("foo") from the perl, I get the string "noresponse" returned. This all works fine if I don't call the AGI from the hangup extension, but from a normal one instead. Met vriendelijke groet, Florian Overkamp ObSimRef BV (http://www.obsimref.com/) ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] h extension seems to wipe variables?
Once the call has hungup the AGI functions stop working, so executing an AGI from an h extension will not do what you expect. but you can still do all kinds of perl stuff there, so you could stick the info in mysql or somewhere else James On Wed, 13 Aug 2003, Alastair Maw wrote: > Hi. > > I'm trying to do some custom call logging, and I want to call an AGI > script from a hangup handler to log call durations and things. Although > the script executes, it isn't retrieving variables from the AGI > interface. Looking closer, I realised the variables are actually getting > unset before the h extension is reached. > > [foo] > s,1,SetVar,foo=bar > s,2,Play(audio/a-long-prompt) > h,1,AGI(log-call-duration.pl) > > When I do an $agi->get_variable("foo") from the perl, I get the string > "noresponse" returned. > > This all works fine if I don't call the AGI from the hangup extension, > but from a normal one instead. > > Does anyone have any idea how I might fix or work around this? It's > important for us to log call durations (and other things), which > obviously needs to be done when the users hangs up. Storing stuff using > the cdr isn't really an option. > ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users