Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

RetryFirstIntervalSec and RetryIntervalSec were added to be used in SipUser() #212

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Pod/Classes/Configurations/VSLAccountConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,40 @@ typedef NS_ENUM(NSUInteger, VSLContactRewriteMethod) {
*/
@property (nonatomic) BOOL sipRegisterOnAdd;

/**
* Specify interval of auto registration retry upon registration failure
ludivinefafournoux marked this conversation as resolved.
Show resolved Hide resolved
* (including caused by transport problem), in second. Set to 0 to
* disable auto re-registration. Note that if the registration retry
* occurs because of transport failure, the first retry will be done
* after \a firstRetryIntervalSec seconds instead. Also note that
* the interval will be randomized slightly by some seconds (specified
* in \a reg_retry_random_interval) to avoid all clients re-registering
* at the same time.
*
* See also \a firstRetryIntervalSec and \a randomRetryIntervalSec
* settings.
*
* Default: PJSUA_REG_RETRY_INTERVAL
*/
@property (nonatomic) unsigned int retryIntervalSec;

/**
* Specify interval of auto registration retry upon registration failure
* (including caused by transport problem), in second. Set to 0 to
* disable auto re-registration. Note that if the registration retry
* occurs because of transport failure, the first retry will be done
* after \a firstRetryIntervalSec seconds instead. Also note that
* the interval will be randomized slightly by some seconds (specified
* in \a reg_retry_random_interval) to avoid all clients re-registering
* at the same time.
*
* See also \a firstRetryIntervalSec and \a randomRetryIntervalSec
* settings.
*
* Default: PJSUA_REG__FIRST_RETRY_INTERVAL
*/
@property (nonatomic) unsigned int retryFirstIntervalSec;

/**
* If YES, the account presence will be published to the server where the account belongs.
*/
Expand Down
3 changes: 3 additions & 0 deletions Pod/Classes/VSLAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ - (BOOL)configureWithAccountConfiguration:(VSLAccountConfiguration * _Nonnull)ac
acc_cfg.id = [[accountConfiguration.sipAddress stringByAppendingString:transportString] prependSipUri].pjString;
acc_cfg.reg_uri = [[accountConfiguration.sipDomain stringByAppendingString:transportString] prependSipUri].pjString;
acc_cfg.register_on_acc_add = accountConfiguration.sipRegisterOnAdd ? PJ_TRUE : PJ_FALSE;

acc_cfg.reg_first_retry_interval = accountConfiguration.retryFirstIntervalSec ? accountConfiguration.retryFirstIntervalSec : 10;
acc_cfg.reg_retry_interval = accountConfiguration.retryIntervalSec ? accountConfiguration.retryIntervalSec : 300;
acc_cfg.publish_enabled = accountConfiguration.sipPublishEnabled ? PJ_TRUE : PJ_FALSE;
acc_cfg.reg_timeout = VSLAccountRegistrationTimeoutInSeconds;
acc_cfg.drop_calls_on_reg_fail = accountConfiguration.dropCallOnRegistrationFailure ? PJ_TRUE : PJ_FALSE;
Expand Down
7 changes: 7 additions & 0 deletions Pod/Classes/VialerSIPLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ typedef NS_ENUM(NSUInteger, VialerSIPLibErrors) {
*/
@property (readonly, nonatomic) BOOL sipRegisterOnAdd;


@property (readonly, nonatomic) unsigned int retryIntervalSec;
@optional


@property (readonly, nonatomic) unsigned int retryFirstIntervalSec;
@optional
/**
* When set to YES, calls will be dropped after registration fails.
*
Expand Down
8 changes: 8 additions & 0 deletions Pod/Classes/VialerSIPLib.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ - (VSLAccount *)createAccountWithSipUser:(id<SIPEnabledUser> _Nonnull __autorel
if ([sipUser respondsToSelector:@selector(sipRegisterOnAdd)]) {
accountConfiguration.sipRegisterOnAdd = sipUser.sipRegisterOnAdd;
}

if ([sipUser respondsToSelector:@selector(retryFirstIntervalSec)]) {
accountConfiguration.retryFirstIntervalSec = sipUser.retryFirstIntervalSec;
}

if ([sipUser respondsToSelector:@selector(retryIntervalSec)]) {
accountConfiguration.retryIntervalSec = sipUser.retryIntervalSec;
}

if ([sipUser respondsToSelector:@selector(dropCallOnRegistrationFailure)]) {
accountConfiguration.dropCallOnRegistrationFailure = sipUser.dropCallOnRegistrationFailure;
Expand Down
2 changes: 1 addition & 1 deletion VialerSIPLib.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "VialerSIPLib"
s.version = "3.7.1"
s.version = "3.7.2"
ludivinefafournoux marked this conversation as resolved.
Show resolved Hide resolved
s.summary = "Vialer SIP Library for iOS"
s.description = "Objective-C wrapper around PJSIP."
s.homepage = "https://github.com/VoIPGRID/VialerSIPLib"
Expand Down