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

Implement OPTIONS ping #30

Merged
merged 5 commits into from
Oct 19, 2023
Merged

Conversation

maximilianfridrich
Copy link
Contributor

@maximilianfridrich maximilianfridrich commented Oct 16, 2023

qualify: add qualify module

This module implements a pinging mechanism using SIP OPTIONS to qualify the peer while a call is in the INCOMING state to ensure that the peer is reachable and we will be able to successfully answer the call.

Configuration:

qual_int      [seconds]         qualify interval
qual_to       [seconds]         qualify timeout

The OPTIONS are only sent if both options are present, both are not zero, qual_int is greater than qual_to, and the call is incoming. As soon as the call is established or closed, we stop sending OPTIONS. If we run don’t receive a response to an OPTIONS request within the specified qual_to, the call is terminated and UA_EVENT_CALL_CLOSED is triggered.

Extra account address parameters:
The module can be activated by adding both the qual_int and the qual_to parameters to the accounts parameter extra.

Example:

<sip:[email protected]>;extra=qual_int=5,qual_to=2000

Related:

A module that implements a pinging mechanism using SIP OPTIONS to
qualify the peer while a call is in the INCOMING state to ensure that
the peer is reachable and we will be able to successfully answer the
call.
* peer while a call is in the INCOMING state to ensure that the peer is
* reachable and we will be able to successfully answer the call.
*
* Configuration:
Copy link
Collaborator

@cspiel1 cspiel1 Oct 18, 2023

Choose a reason for hiding this comment

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

Instead of "Configuration:" write "Configure in address parameter extra:"
And combine with the example below. Maybe both at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

* The OPTIONS are only sent if both options are present, both are not zero,
* qualify_freq is greater than qual_to, and the call is incoming. As soon as
* the call is established or closed, we stop sending OPTIONS.
* If we run don’t receive a response to an OPTIONS request within the
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • correct this sentence
  • Avoid "we"! Use the local UA, or "is stopped", "is sent"!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

if (!qualle->offline) {
qualle->offline = true;
ua_event(call_get_ua(call), UA_EVENT_CUSTOM, call,
"Peer offline");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use module_event()! General in this module!

}


/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doxygen @param missing.

Better drop this. Its static and the return codes are not used.
Return codes are not standard codes.

@maximilianfridrich maximilianfridrich force-pushed the options_ping branch 3 times, most recently from 61a2630 to 8091431 Compare October 18, 2023 13:51
@cspiel1 cspiel1 merged commit 28f7703 into baresip:main Oct 19, 2023
6 checks passed
@maximilianfridrich maximilianfridrich deleted the options_ping branch November 22, 2023 11:25
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.

2 participants