[Asterisk-code-review] func_dtmfstore: New function (asterisk[master])
George Joseph
asteriskteam at digium.com
Thu Jun 24 07:29:31 CDT 2021
Attention is currently required from: N A, Joshua Colp.
George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16070 )
Change subject: func_dtmfstore: New function
......................................................................
Patch Set 1:
(3 comments)
Patchset:
PS1:
> Whoops, missed this one.
> So something like SetDTMFStore(direction,var,maxdigits) basically?
> I thought this seemed more functiony, but I don't care either way and could certainly do that.
> One consideration is this could be added via an AMI Setvar, or manipulated in other ways, presumably but that would not be possible with an application, since the channel needs to actually go there.
This is more like "taking a control action on a channel" rather than setting or getting a channel variable (especially since this function doesn't return anything) so I think an app is more appropriate. To be honest, I think the "frame drop" function probably should have been an app as well but since "frame trace" was already a function it made more sense to be consistent.
As for AMI, you could add an AMI command for this easily. Take a look at app_senddtmf for a good basic example.
File funcs/func_dtmfstore.c:
https://gerrit.asterisk.org/c/asterisk/+/16070/comment/940b0a60_85acd9b9
PS1, Line 62: =CDR(digits)
> This dictates that any digits dialed in the specified direction will by appended to this variable. So in this case, since I want them in a CDR record (custom column), I just specify this column and when the call is over, it will automatically be there with no further processing required.
> A non-CDR variable could be used, but I think CDR variables would be the most useful case.
Ah, custom column. It was the "digits" what was throwing me because I couldn't find that in the normal CDR. 😊
https://gerrit.asterisk.org/c/asterisk/+/16070/comment/08894d75_b62cb912
PS1, Line 168: remove_dtmf_store(chan); /* reached max digit count, stop now */
> The digits go directly into the variable during the callback, so if maximum # of digits is reached (e.g., the database column only stores X digits), then we may as well get rid of this entirely at this point so it won't do anything useful for us afterwards. Destroying the framehook doesn't modify the collected digits because they are not stored as part of it, but in the specified variable.
Ah yeah, gotcha. You're just disabling any further gathering of digits.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16070
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I51aa93fc9507f7636ac44806c4420ce690423e6f
Gerrit-Change-Number: 16070
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Thu, 24 Jun 2021 12:29:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Comment-In-Reply-To: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210624/5d03e411/attachment.html>
More information about the asterisk-code-review
mailing list