Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app_record: Add RECORD_TIME output variable. #549

Merged

Conversation

InterLinked1
Copy link
Contributor

This adds the RECORD_TIME variable to Record(),
which is set to the recording duration before
the application returns.

Resolves: #548

@InterLinked1
Copy link
Contributor Author

InterLinked1 commented Jan 22, 2024

cherry-pick-to: none

Copy link
Member

@jcolp jcolp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A user note should be added to the commit message about the addition of this dialplan variable.

apps/app_record.c Show resolved Hide resolved
@seanbright
Copy link
Contributor

This could clobber an existing variable. Maybe it should be master only?

@jcolp
Copy link
Member

jcolp commented Jan 23, 2024

This could clobber an existing variable. Maybe it should be master only?

Ooh, excellent point I hadn't considered. That or turning it into a dialplan function which can pull info about the recording just done.

This adds the RECORD_TIME variable to Record(),
which is set to the recording duration before
the application returns.

Resolves: asterisk#548

UpgradeNote: The RECORD_TIME variable now contains
the duration of Record() recordings in milliseconds.
Copy link
Member

@gtjoseph gtjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a UserNote (new feature) not UpgradeNote (possible breaking change).

@InterLinked1
Copy link
Contributor Author

Should be a UserNote (new feature) not UpgradeNote (possible breaking change).

It was requested this be master only because it "could" be breaking, that's why I removed the cherry picks and made it an upgrade note. Should it still be a user note?

@jcolp
Copy link
Member

jcolp commented Jan 23, 2024

Should be a UserNote (new feature) not UpgradeNote (possible breaking change).

It was requested this be master only because it "could" be breaking, that's why I removed the cherry picks and made it an upgrade note. Should it still be a user note?

Since there could be a conflict in variable usage, I think UpgradeNote is appropriate.

@seanbright
Copy link
Contributor

seanbright commented Jan 29, 2024

Is there another way this information could be made available without creating a channel variable? If it was a dialplan function as @jcolp mentioned you could make other information available too (recording format, file size, etc.) and that could be easily extendable in the future.

Edit: And then it would be a candidate for cherry picking which would be good,

Edit edit: Although I suppose a dialplan function have the same naming collision problem. I'm not sure if you can have a variable and a dialplan function with the same name.

@asteriskteam
Copy link
Contributor

This PR has been marked stale because it has been in "Changes Requested" or "submitter-action-required" state for 28 days or more. Please make the requested changes within 14 days or the PR will be closed.

@InterLinked1
Copy link
Contributor Author

Is there another way this information could be made available without creating a channel variable? If it was a dialplan function as @jcolp mentioned you could make other information available too (recording format, file size, etc.) and that could be easily extendable in the future.

Edit: And then it would be a candidate for cherry picking which would be good,

Edit edit: Although I suppose a dialplan function have the same naming collision problem. I'm not sure if you can have a variable and a dialplan function with the same name.

Yeah, aside from that, a function to get the time feels kind of disjoint (at least to me), a variable is more consistent with the other things that are saved. Making it a function would probably also mean now a datastore is now needed to keep track of that, which seems like overkill for just exposing one piece of information. A function could be useful anyways but seems like it should be its own project to expose different information.

Personally I don't really feel like changing this if it's only a suggestion, but if you feel this should absolutely be a function, then I can do so.

@seanbright
Copy link
Contributor

Edit edit: Although I suppose a dialplan function have the same naming collision problem. I'm not sure if you can have a variable and a dialplan function with the same name.

I just tested this and you can have a variable and a function with the same name - there is no conflict:

same =     n,NoOp(${CURL})
same =     n,Set(CURL=hello-${EXTEN})
same =     n,NoOp(${CURL})
same =     n,Hangup()

Personally I don't really feel like changing this if it's only a suggestion, but if you feel this should absolutely be a function, then I can do so.

This PR is not waiting on my review as far as I can tell.

My opinion is that new functionality should not create channel variables that could trample those set by the user. It's a suggestion.

@jcolp
Copy link
Member

jcolp commented Mar 25, 2024

I agree regarding not using dialplan variables. Older things use dialplan variables because at the time there was no other way. For inclusion I will require it to be a dialplan function.

Copy link
Member

@gtjoseph gtjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UpgradeNotes should be for changes in existing behavior a user should be aware of. This should be a UserNote.
Nevermind. But, the upgrade note should explain the possible conflict.

@asteriskteam
Copy link
Contributor

This PR has been marked stale because it has been in "Changes Requested" or "submitter-action-required" state for 28 days or more. Please make the requested changes within 14 days or the PR will be closed.

Copy link

Successfully merged to branch master.

@seanbright
Copy link
Contributor

Um. What?

@jcolp
Copy link
Member

jcolp commented Apr 30, 2024

@gtjoseph Yes... what?

@jcolp
Copy link
Member

jcolp commented Apr 30, 2024

When did I actually approve this... why... looks back

@jcolp
Copy link
Member

jcolp commented Apr 30, 2024

Oh, I never unapproved when we had our discussion. That explains it. I'm reverting this and reopening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[improvement]: Get Record() audio duration/length
6 participants