mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-06 21:33:08 +00:00
Several fixes for calls.
This commit is contained in:
parent
5781fcbde2
commit
1896eff9fe
5 changed files with 24 additions and 10 deletions
|
|
@ -532,6 +532,7 @@ void linphone_core_set_log_level(OrtpLogLevel loglevel) {
|
|||
void linphone_core_set_log_level_mask(unsigned int loglevel) {
|
||||
//we only have 2 domain for now ortp and belle-sip
|
||||
bctbx_set_log_level_mask(ORTP_LOG_DOMAIN, (int)loglevel);
|
||||
bctbx_set_log_level_mask("mediastreamer", (int)loglevel);
|
||||
bctbx_set_log_level_mask("bzrtp", (int)loglevel); /*need something to set log lvel for all domains*/
|
||||
sal_set_log_level((OrtpLogLevel)loglevel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,11 +38,13 @@ L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(Call,
|
|||
_linphone_call_constructor, _linphone_call_destructor,
|
||||
bctbx_list_t *callbacks; /* A list of LinphoneCallCbs object */
|
||||
LinphoneCallCbs *currentCbs; /* The current LinphoneCallCbs object used to call a callback */
|
||||
char *authenticationTokenCache;
|
||||
LinphoneCallParams *currentParamsCache;
|
||||
LinphoneCallParams *paramsCache;
|
||||
LinphoneCallParams *remoteParamsCache;
|
||||
LinphoneAddress *remoteAddressCache;
|
||||
char *remoteContactCache;
|
||||
char *remoteUserAgentCache;
|
||||
/* TODO: all the fields need to be removed */
|
||||
struct _LinphoneCore *core;
|
||||
LinphoneErrorInfo *ei;
|
||||
|
|
@ -713,14 +715,13 @@ const LinphoneErrorInfo *linphone_call_get_error_info (const LinphoneCall *call)
|
|||
}
|
||||
|
||||
const char *linphone_call_get_remote_user_agent (LinphoneCall *call) {
|
||||
#if 0
|
||||
if (call->op){
|
||||
return sal_op_get_remote_ua (call->op);
|
||||
}
|
||||
return nullptr;
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
string ua = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getRemoteUserAgent();
|
||||
if (ua.empty())
|
||||
return nullptr;
|
||||
if (call->remoteUserAgentCache)
|
||||
bctbx_free(call->remoteUserAgentCache);
|
||||
call->remoteUserAgentCache = bctbx_strdup(ua.c_str());
|
||||
return call->remoteUserAgentCache;
|
||||
}
|
||||
|
||||
const char * linphone_call_get_remote_contact (LinphoneCall *call) {
|
||||
|
|
@ -734,7 +735,13 @@ const char * linphone_call_get_remote_contact (LinphoneCall *call) {
|
|||
}
|
||||
|
||||
const char *linphone_call_get_authentication_token (LinphoneCall *call) {
|
||||
return L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(call)->getAuthenticationToken());
|
||||
string token = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getAuthenticationToken();
|
||||
if (token.empty())
|
||||
return nullptr;
|
||||
if (call->authenticationTokenCache)
|
||||
bctbx_free(call->authenticationTokenCache);
|
||||
call->authenticationTokenCache = bctbx_strdup(token.c_str());
|
||||
return call->authenticationTokenCache;
|
||||
}
|
||||
|
||||
bool_t linphone_call_get_authentication_token_verified (const LinphoneCall *call) {
|
||||
|
|
|
|||
|
|
@ -475,6 +475,11 @@ const MediaSessionParams *Call::getRemoteParams () const {
|
|||
return static_cast<MediaSession *>(d->getActiveSession().get())->getRemoteParams();
|
||||
}
|
||||
|
||||
string Call::getRemoteUserAgent () const {
|
||||
L_D();
|
||||
return d->getActiveSession()->getRemoteUserAgent();
|
||||
}
|
||||
|
||||
float Call::getSpeakerVolumeGain () const {
|
||||
L_D();
|
||||
return static_cast<const MediaSession *>(d->getActiveSession().get())->getSpeakerVolumeGain();
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ public:
|
|||
std::string getRemoteAddressAsString () const;
|
||||
std::string getRemoteContact () const;
|
||||
const MediaSessionParams *getRemoteParams () const;
|
||||
std::string getRemoteUserAgent () const;
|
||||
float getSpeakerVolumeGain () const;
|
||||
LinphoneCallState getState () const;
|
||||
LinphoneCallStats *getStats (LinphoneStreamType type) const;
|
||||
|
|
|
|||
|
|
@ -926,7 +926,7 @@ int MediaSessionPrivate::selectFixedPort (int streamIndex, pair<int, int> portRa
|
|||
int MediaSessionPrivate::selectRandomPort (int streamIndex, pair<int, int> portRange) {
|
||||
for (int nbTries = 0; nbTries < 100; nbTries++) {
|
||||
bool alreadyUsed = false;
|
||||
int triedPort = (static_cast<int>(ortp_random()) % (portRange.second - portRange.first) + portRange.first) & ~0x1;
|
||||
int triedPort = static_cast<int>((ortp_random() % (portRange.second - portRange.first) + portRange.first) & ~0x1);
|
||||
if (triedPort < portRange.first) triedPort = portRange.first + 2;
|
||||
for (const bctbx_list_t *elem = linphone_core_get_calls(core); elem != nullptr; elem = bctbx_list_next(elem)) {
|
||||
LinphoneCall *lcall = reinterpret_cast<LinphoneCall *>(bctbx_list_get_data(elem));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue