Using std::chrono for passing durations #34
Replies: 2 comments 2 replies
-
Thank you very much @ferchor2003 for commenting here. I'm a big fan of using the right types (instead of basic types!) whenever possible. Especially for time durations.
With
However, checking again the ARIs documentation, I guess the first two options are the same (i.e., no ARI parameter or 0 both mean: "no limit", in this case, I could consider using For what concerned Thanks, |
Beta Was this translation helpful? Give feedback.
-
So I had to write a similar Channel::Snoop() function for Visual Studio 2015: #if __cplusplus <= 201103L
// Simpler version working on C++ 11
Proxy& Snoop(const std::string& app,
const std::string& spy = "none",
const std::string& whisper = "none",
const std::string& appArgs = {}, const std::string& snoopId = {}) const
{
return Proxy::Command(
Method::post,
"/ari/channels/" + id + "/snoop?"
"app=" + app +
"&spy=" + spy +
"&whisper=" + whisper +
(appArgs.empty() ? "" : "&appArgs=" + appArgs) +
(snoopId.empty() ? "" : "&snoopId=" + snoopId),
client
);
}
#else
// C++ 17 version
#endif |
Beta Was this translation helpful? Give feedback.
-
I wanna share something that I have found really useful in my usage of the library.
I have found that in my code I have configuration parameters that are sometimes expressed in milliseconds and sometimes in seconds; I want to make sure that when reading the code I know what time units I'm dealing with. Also, I'm using Visual Studio 2015 which supports C++ 11, so I had to get rid of the nice TerminationDtmf type 👎
I have modified the Channel::Record for this purpose like this:
Beta Was this translation helpful? Give feedback.
All reactions