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

Add support for dynamic timers B & C for each of the client transactions #212

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

IvanRibakov
Copy link
Contributor

Rationale

I'm evaluating Repro for it's suitability to be used as a foundation for ESRP (Emergency Service Routing Proxy). In the world of emergency service providers, it is not uncommon for providers, as well as governmental agencies overseeing those providers to express requirements for the upper bound of the call connection time. Those requirements are typically much stricter than the Timer B/Timer C values specified in the RFC 3261 and often vary based on the destination agency and a number of other call parameters.

As such, I'm looking for ability to specify custom TimerB and TimerC values for each of the Repro targets (serially forked). This PR proposes a solution to the problem.

repro/Proxy.cxx Outdated Show resolved Hide resolved
resip/stack/SipMessage.hxx Outdated Show resolved Hide resolved
repro/ResponseContext.cxx Outdated Show resolved Hide resolved
repro/ResponseContext.cxx Outdated Show resolved Hide resolved
resip/stack/SipMessage.cxx Outdated Show resolved Hide resolved
resip/stack/SipMessage.hxx Outdated Show resolved Hide resolved
@@ -75,7 +75,9 @@ SipMessage::SipMessage(const SipMessage &from, const SipMessageOptions &opts)
mCreatedTime(Timer::getTimeMicroSec())
{
init(from);
mOpts = opts;
if (opts) {
Copy link
Member

Choose a reason for hiding this comment

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

Bracket on separate line. :)

Also trying to wrap my head around why we are copying the unique_ptr. Using a unique_ptr gives the user the impression you are handing of the data to be managed by the class, so why copy here? If the copy is necessary, we should think about changing the constructor signature to perhaps just take in a raw pointer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies for going quite for some time, other work stuff came up.

Using a unique_ptr gives the user the impression you are handing of the data to be managed by the class

Not unless unique_ptr is passed by const reference (assuming no foul play by receiver of the const ref, like casting const away).

If the copy is necessary, we should think about changing the constructor signature to perhaps just take in a raw pointer.

I wanted to avoid using raw pointer to prevent it from being accidentally stored(copied) and outliving the unique_ptr that manages it.

When deciding on how best to pass SipMessageOptions to the constructor I used this SO answer for inspiration and reference. Let me know if reasoning above makes sense to you or if you'd like to switch to raw pointer approach in the end.

Copy link
Member

Choose a reason for hiding this comment

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

Let's talk first about the need to copy the SipMessageOptions class in the constructor. Perhaps the need to copy should be up to the caller to decide what they want to do. ie: Take in a std::unique_ptr by value and std::move it in the constructor. If a copy is needed, then the caller can copy the unique_ptr before passing it in. Thoughts?

Which all leads me to the next question.... The changes in this pull request support something you are enhancing repro with. Do you intend to submit a new processor or some new functionality to repro to make use of these changes publicly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a copy is needed, then the caller can copy the unique_ptr before passing it in. Thoughts?

Done


Do you intend to submit a new processor or some new functionality to repro to make use of these changes publicly?

I do not have such plans at the moment.

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

Successfully merging this pull request may close these issues.

None yet

2 participants