[Home]

Summary:ASTERISK-03624: [patch] allows any DTMF to disconnect an agent, not just *
Reporter:cmaj (cmaj)Labels:
Date Opened:2005-03-03 09:11:36.000-0600Date Closed:2011-06-07 14:05:24
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_agent
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_agent_any_dtmf_disconnects.diff3.txt
Description:I wanted to try and make this a feature code by overlapping chan_features with chan_agent, but that didn't seem too feasible and would probably break agent features like # pickups.  This patch, however, adds more DTMF feature like ability to chan_agent by letting you turn off * hangups and also turn on hangups with any DTMF.  In addition, a specific DTMF can be chosen to change the wrapuptime for just that call.  This is useful if you need to jot some notes down after some calls -- but not all your calls.

If you choose 'anydtmfdisconnects' in agents.conf, the DTMF will be logged as the CDR user field.

****** ADDITIONAL INFORMATION ******

Disclaimer on file.
Comments:By: Olle Johansson (oej) 2005-03-17 08:33:22.000-0600

Anyone that knows agent and can try this patch? We need a bit of a discussion here.

/Housekeeping

By: cmaj (cmaj) 2005-03-28 16:10:24.000-0600

Updated (and tested) to work with current CVS.

By: Mark Spencer (markster) 2005-03-28 22:48:52.000-0600

Why not just transfer to another extension?

By: cmaj (cmaj) 2005-03-29 07:50:29.000-0600

Wouldn't that log out the agent ?

By: Mark Spencer (markster) 2005-03-29 13:49:45.000-0600

Not if you # transfer.

By: cmaj (cmaj) 2005-03-29 15:16:17.000-0600

Yes, but Agents I have setup to use this patch enjoy the one-touch ability.  (It's the simple stuff that keeps them happy.)

By: Kevin P. Fleming (kpfleming) 2005-04-01 19:52:02.000-0600

Notes:

+/* This has to be -1 because that's not a valid DTMF */
+static int longwrapupdtmf = -1;

This not necessary; all DTMF are ASCII characters, so you can safely let this variable default to zero.

All of the new globals need to be set to their default values at the beginning of the read_agent_config function, in case they had been changed previously but are no longer present in agents.conf.

tmpdtmf needs to be only 2 characters long, and can be initialized to zeros. Then you can just directly set tmpdtmf[0] to f->subclass, instead of using snprintf for a single character.

You need to check the result of ast_cdr_alloc() for NULL; if it cannot allocate a CDR structure, this code will segfault.

+ }
ast_frfree(f);
f = &answer_frame;
+ f = NULL;

This looks wrong; why set f to &answer_frame, only to change it to NULL?

Don't call pbx_builtin_getvar_helper three times for the same variable; just call it once and store the result in a 'char *' for later use.

Use ast_strlen_zero instead of strlen.

There is no need to 'parse' the value of DTMF_DISCO into an int variable, only to format back into being a string again. In fact, DTMF_DISCO can contain non-numeric values anyway ('#', '*', and 'A' through 'D'), so using atoi on it is wrong. If you change dtmfdisco into a char *, then you can just check dtmfdisco[0] against longwrapupdtmf. You also cannot use atoi() when setting longwrapupdtmf, again because there are non-numeric DTMF characters. Just use strchr() on AST_DIGIT_ANY to determine whether it is valid or not.

- if (p->wrapuptime && p->acknowledged) {
+ if (p->wrapuptime) {

Why was the p->acknowledged check removed here?

That's all for now :-)

By: Michael Jerris (mikej) 2005-05-02 08:16:07

cmaj: *poke*

By: cmaj (cmaj) 2005-05-09 17:40:38

diff3 is much, much cleaner, and does not reflect what's left after a CVS update over a bunch of irregularly patched files.  It incorporates many of Kevin's observations and should work with current CVS.

By: Clod Patry (junky) 2005-06-09 19:27:39

Just a 2 cents here:
Why dont we have something like:
dtmfdisconnects=10*#
why are all the allowed dtmfs to disconnects?
so we could say
dtmfdisconnects=*#
if we just want these two escape digits?

And maybe we could have a special value for all dtmfs.
Something like
dtmfdisconnects=ALL or ANY
which could by any dtmfs ?

And kevin, maybe a review on that would be intesting.

By: Clod Patry (junky) 2005-07-14 00:49:00

any feedback here?

By: Michael Jerris (mikej) 2005-07-14 06:00:33

For what it's worth I agree with junky on this one.  You could have a string of digits that could disconnect... Anyways, we need some action on this one, testing results and at least a response.

By: Clod Patry (junky) 2005-07-19 12:03:09



By: cmaj (cmaj) 2005-07-19 14:49:58

I can dig the ANY/ALL and char string formats, but my test machine is currently in production, so my development is at a stand still right now.  No ETA for when I'll get a new box online.

By: gdhgdh (gdhgdh) 2005-07-21 02:53:15

http://bugs.digium.com/view.php?id=4419 has been marked as a duplicate of this bug, so I'm putting forward the concept listed in that bug.

Rather than implementing yet another channel-specific feature to confuse people ('dtmfdisconnects'), would it not be better to use the settings already present in features.conf for atxfer and disconnect?

I can understand dealing with multiple digits rather than a single one is more work.. but the code is there already, just needing adapted for chan_agent...

By: Michael Jerris (mikej) 2005-08-13 22:44:13

suspended due to no activity.  Please re-open when updates are ready.