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 all 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
14 changes: 14 additions & 0 deletions Pod/Classes/Configurations/VSLAccountConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ typedef NS_ENUM(NSUInteger, VSLContactRewriteMethod) {
*/
@property (nonatomic) BOOL sipRegisterOnAdd;

/**
* Specify interval in seconds of auto registration retry upon registration failure.
*
* Default: PJSUA_REG_RETRY_INTERVAL
*/
@property (nonatomic) unsigned int retryIntervalSec;

/**
* Specify interval in seconds of the registration retry upon first registration failure.
*
* 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