[asterisk-dev] Asterisk Bounty: Additional Dial | L options
Kaloyan Kovachev
kkovachev at varna.net
Fri Jul 7 09:32:08 MST 2006
Hi,
...
if ((c->_softhangup == AST_SOFTHANGUP_TIMEOUT) &&
(ast_exists_extension(c,c->context,"T",1,c->cid.cid_num))
...
this only sends the caler to the "T" extension, not the calee and "c-
>_softhangup" is not accesible via dial plan.
if there is some channel variable set on timeout, which in turn can be
checked in "T" (or "h" extension, or even on the next prio if "g" option is
specified) this will also work for the caler only, so there is still need of
something for the calee ... M() analog after the call (after setting
ANSWEREDTIME) seems to be the easiest way?
On Thu, 6 Jul 2006 22:55:04 -0400, Stephan A. Edelman wrote
> Hello,
>
> The internal variable chan->_softhangup is set to AST_SOFTHANGUP_TIMEOUT
> when the timeout in Dial() elapses (see ast_check_hangup() code snippet
> below).
>
> This causes Asterisk to jump to the "T" extension in your dialplan (see
> ast_pbx_run() code snippet below).
>
> In my estimation, you should simply create a "T" extension in the
> context where the Dial is executed and you should be able to catch when
> the timeout occurs.
>
> I haven't tried this, but it seems reasonable. YMMV.
>
> Regards,
>
> Stephan.
>
> int ast_check_hangup(struct ast_channel *chan)
> {
> time_t myt;
>
> /* if soft hangup flag, return true */
> if (chan->_softhangup)
> return 1;
> /* if no technology private data, return true */
> if (!chan->tech_pvt)
> return 1;
> /* if no hangup scheduled, just return here */
> if (!chan->whentohangup)
> return 0;
> time(&myt); /* get current time */
> /* return, if not yet */
> if (chan->whentohangup > myt)
> return 0;
> chan->_softhangup |= AST_SOFTHANGUP_TIMEOUT;
> return 1;
> }
>
> ast_pbx_run():
>
> ...
> if ((c->_softhangup == AST_SOFTHANGUP_TIMEOUT) &&
> (ast_exists_extension(c,c->context,"T",1,c->cid.cid_num))
> ...
>
> --
> Stephan A. Edelman, B.Eng.
> NewAce Corporation
> Toll Free: 1-877-463-9223 x221
> International: +1 519 336 4837 x221 (Outside US & Canada)
> Fax: +1 519 336 4046
> Cell: +1 519 346 1581
>
> -----Original Message-----
> From: asterisk-dev-bounces at lists.digium.com
> [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of
> webmaster at 5nf.net
> Sent: Thursday, July 06, 2006 5:56 PM
> To: asterisk-dev at lists.digium.com
> Subject: [asterisk-dev] Asterisk Bounty: Additional Dial | L options
>
> Greetings all,
>
> I'm offering a bounty of US$100 for what (as far as I know) should
> be a simple addition to asterisk. I've also posted this at
> http://www.voip-info.org/wiki/view/Asterisk+bounty+Call+Limit+Exit+Optio
> ns
> :
>
> Currently five variables are recognized by the "L" (call limit)
> option in the Dial application. These variables are used for
> playing back sound files to the callers to notify them that their
> call has begun or is going to end.
>
> I would like asterisk to recognize two more variables to specify the
> "exit
> locations" for each channel if the time limit expires. In other
> words, I would like to be able to specify where in the dialplan the
> call should go specifically if time runs out. This way we can
> distinguish in the dialplan between a caller/callee who exited
> because the other line hung up, or using a DTMF exit, and one whose
> call was ended because (s)he ran out of time.
>
> I don't care what the variables are called. Something like
> LIMIT_EXIT_CALLER and LIMIT_EXIT_CALLEE seems apropos, given the naming
> convention of the existing LIMIT variables. The variables can always
> be of the form "context,extension,priority" or
> "context|extension|priority" if necessary to avoid ambiguity. If we
> want to make context and extension sequentially optional (like the
> Goto command) that's okay with me too. If the variable is not set or
> does not match a valid form (or maybe if it's set to 0?), asterisk
> handles the channel the same way it does now.
>
> There may be technical or pragmatic considerations that I've overlooked.
>
> Feel free to e-mail me with such criticism (or with any questions,
> or if there's already a way to do this and I just don't know it, or
> if $100 is woefully inadequate for this feature, or if you have a
> patch for me to try, or anything else pertinent).
>
> Thanks for your time!
>
> Jason Burbage
> webmaster at 5nf.net
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
More information about the asterisk-dev
mailing list