Skip to content

Commit

Permalink
Add PJSUA2 API
Browse files Browse the repository at this point in the history
  • Loading branch information
trengginas committed Feb 11, 2025
1 parent d0459e8 commit e1064d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pjsip/include/pjsua2/account.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,15 @@ struct AccountNatConfig : public PersistentObject
*/
int iceWaitNominationTimeoutMsec;

/**
* Specify whether to check the source address of the incoming messages.
* The source address will be compared to the remote candidate which has
* a completed connectivity check or received a connectivity check.
*
* Default value is PJ_ICE_SESS_CHECK_SRC_ADDR.
*/
unsigned iceCheckSrcAddr;

/**
* Disable RTCP component.
*
Expand Down
5 changes: 5 additions & 0 deletions pjsip/src/pjsua2/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ void AccountNatConfig::readObject(const ContainerNode &node)
NODE_READ_BOOL ( this_node, iceAggressiveNomination);
NODE_READ_UNSIGNED( this_node, iceNominatedCheckDelayMsec);
NODE_READ_INT ( this_node, iceWaitNominationTimeoutMsec);
NODE_READ_INT ( this_node, iceCheckSrcAddr);
NODE_READ_BOOL ( this_node, iceNoRtcp);
NODE_READ_BOOL ( this_node, iceAlwaysUpdate);
NODE_READ_BOOL ( this_node, turnEnabled);
Expand Down Expand Up @@ -440,6 +441,7 @@ void AccountNatConfig::writeObject(ContainerNode &node) const
NODE_WRITE_BOOL ( this_node, iceAggressiveNomination);
NODE_WRITE_UNSIGNED( this_node, iceNominatedCheckDelayMsec);
NODE_WRITE_INT ( this_node, iceWaitNominationTimeoutMsec);
NODE_WRITE_INT ( this_node, iceCheckSrcAddr);
NODE_WRITE_BOOL ( this_node, iceNoRtcp);
NODE_WRITE_BOOL ( this_node, iceAlwaysUpdate);
NODE_WRITE_BOOL ( this_node, turnEnabled);
Expand Down Expand Up @@ -668,6 +670,7 @@ void AccountConfig::toPj(pjsua_acc_config &ret) const
natConfig.iceNominatedCheckDelayMsec;
ret.ice_cfg.ice_opt.controlled_agent_want_nom_timeout =
natConfig.iceWaitNominationTimeoutMsec;
ret.ice_cfg.ice_opt.check_src_addr = natConfig.iceCheckSrcAddr;
ret.ice_cfg.ice_no_rtcp = natConfig.iceNoRtcp;
ret.ice_cfg.ice_always_update = natConfig.iceAlwaysUpdate;

Expand Down Expand Up @@ -838,6 +841,7 @@ void AccountConfig::fromPj(const pjsua_acc_config &prm,
prm.ice_cfg.ice_opt.nominated_check_delay;
natConfig.iceWaitNominationTimeoutMsec =
prm.ice_cfg.ice_opt.controlled_agent_want_nom_timeout;
natConfig.iceCheckSrcAddr = prm.ice_cfg.ice_opt.check_src_addr;
natConfig.iceNoRtcp = PJ2BOOL(prm.ice_cfg.ice_no_rtcp);
natConfig.iceAlwaysUpdate = PJ2BOOL(prm.ice_cfg.ice_always_update);
} else {
Expand All @@ -852,6 +856,7 @@ void AccountConfig::fromPj(const pjsua_acc_config &prm,
mcfg->ice_opt.nominated_check_delay;
natConfig.iceWaitNominationTimeoutMsec =
mcfg->ice_opt.controlled_agent_want_nom_timeout;
natConfig.iceCheckSrcAddr = mcfg->ice_opt.check_src_addr;
natConfig.iceNoRtcp = PJ2BOOL(mcfg->ice_no_rtcp);
natConfig.iceAlwaysUpdate = PJ2BOOL(mcfg->ice_always_update);
}
Expand Down

0 comments on commit e1064d1

Please sign in to comment.