Commit a09056f8 authored by Simon Morlat's avatar Simon Morlat

Merge branch 'fix/one-to-one-chatroom'

parents ae4b36ee 75c9e34e
Pipeline #2781 passed with stages
in 64 minutes and 51 seconds
......@@ -6,6 +6,9 @@ job-archlinux-latest-makefile-gcc:
tags: [ "docker-archlinux-latest" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-archlinux:latest
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Unix Makefiles
CC: gcc
......@@ -18,6 +21,9 @@ job-archlinux-latest-makefile-clang:
tags: [ "docker-archlinux-latest" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-archlinux:latest
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Unix Makefiles
CC: clang
......@@ -33,6 +39,9 @@ job-archlinux-latest-ninja-gcc:
tags: [ "docker-archlinux-latest" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-archlinux:latest
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Ninja
CC: gcc
......@@ -44,8 +53,11 @@ job-archlinux-latest-ninja-clang:
tags: [ "docker-archlinux-latest" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-archlinux:latest
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Ninja
CC: clang
CXX: clang++
extends: .job-linux
\ No newline at end of file
extends: .scheduled-job-linux
\ No newline at end of file
......@@ -6,12 +6,15 @@ job-centos7-makefile-gcc:
tags: [ "docker-centos7" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos:7
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Unix Makefiles
CC: gcc
CXX: g++
ADDITIONAL_BUILD_OPTIONS: -j$MAKEFILE_JOBS
extends: .job-linux
extends: .scheduled-job-linux
job-centos7-makefile-clang:
......
......@@ -6,6 +6,9 @@ job-debian8-makefile-gcc:
tags: [ "docker-debian8" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian:8
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Unix Makefiles
CC: gcc
......@@ -18,6 +21,9 @@ job-debian8-makefile-clang:
tags: [ "docker-debian8" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian:8
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Unix Makefiles
CC: clang
......@@ -33,6 +39,9 @@ job-debian8-ninja-gcc:
tags: [ "docker-debian8" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian:8
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Ninja
CC: gcc
......@@ -48,7 +57,7 @@ job-debian8-ninja-clang:
CMAKE_GENERATOR: Ninja
CC: clang
CXX: clang++
extends: .job-linux
extends: .scheduled-job-linux
#################################################
# DEB
......
......@@ -6,6 +6,9 @@ job-debian9-makefile-gcc:
tags: [ "docker-debian9" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian:9
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Unix Makefiles
CC: gcc
......@@ -18,6 +21,9 @@ job-debian9-makefile-clang:
tags: [ "docker-debian9" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian:9
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Unix Makefiles
CC: clang
......@@ -33,11 +39,14 @@ job-debian9-ninja-gcc:
tags: [ "docker-debian9" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian:9
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Ninja
CC: gcc
CXX: g++
extends: .job-linux
extends: .scheduled-job-linux
job-debian9-ninja-clang:
......
......@@ -6,6 +6,9 @@ job-ubuntu-rolling-makefile-gcc:
tags: [ "docker-ubuntu-rolling" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-ubuntu:rolling
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Unix Makefiles
CC: gcc
......@@ -18,6 +21,9 @@ job-ubuntu-rolling-makefile-clang:
tags: [ "docker-ubuntu-rolling" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-ubuntu:rolling
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Unix Makefiles
CC: clang
......@@ -33,6 +39,9 @@ job-ubuntu-rolling-ninja-gcc:
tags: [ "docker-ubuntu-rolling" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-ubuntu:rolling
except:
variables:
- $DEPLOY_RUN
variables:
CMAKE_GENERATOR: Ninja
CC: gcc
......@@ -48,4 +57,4 @@ job-ubuntu-rolling-ninja-clang:
CMAKE_GENERATOR: Ninja
CC: clang
CXX: clang++
extends: .job-linux
\ No newline at end of file
extends: .scheduled-job-linux
\ No newline at end of file
......@@ -85,6 +85,9 @@ job-flexisip-deb-image-deploy:
stage: image
tags: [ "linux-deploy" ]
except:
variables:
- $DEPLOY_RUN
only:
- schedules
dependencies:
......
......@@ -2,6 +2,9 @@
stage: build
tags: [ "macosx" ]
except:
variables:
- $DEPLOY_RUN
script:
- ccache -s
......@@ -48,6 +51,9 @@ job-macosx-xcode:
stage: build
tags: [ "macosx" ]
except:
variables:
- $DEPLOY_RUN
only:
- schedules
script:
......
Subproject commit 7be5e0451622687204e591cd8bb906e31cd9b94a
Subproject commit 5fe80b27b6a724292c73d31a90c4dc32721857bf
......@@ -228,6 +228,7 @@ void FlexisipAuthModule::processResponse(AuthenticationListener &l) {
switch (l.result()) {
case PASSWORD_FOUND:
case PASSWORD_NOT_FOUND:
if (mPassworFetchResultCb) mPassworFetchResultCb(l.result() == PASSWORD_FOUND);
l.authStatus().passwordFound(l.result() == PASSWORD_FOUND);
checkPassword(l.authStatus(), l.challenger(), *l.response(), l.password().c_str());
finish(l.authStatus());
......@@ -292,10 +293,8 @@ int FlexisipAuthModule::checkPasswordForAlgorithm(FlexisipAuthStatus &as, auth_r
string a1;
if (passwd) {
// ++*getModule()->mCountPassFound;
a1 = passwd;
} else {
// ++*getModule()->mCountPassNotFound;
a1 = auth_digest_a1_for_algorithm(&ar, "xyzzy");
}
......@@ -316,12 +315,10 @@ int FlexisipAuthModule::checkPasswordMd5(FlexisipAuthStatus &as, auth_response_t
passwd = NULL;
if (passwd) {
// ++*getModule()->mCountPassFound;
strncpy(a1buf, passwd, sizeof(a1buf)-1); // remove trailing NULL character
a1buf[sizeof(a1buf)-1] = '\0';
a1 = a1buf;
} else {
// ++*getModule()->mCountPassNotFound;
auth_digest_a1(&ar, a1buf, "xyzzy"), a1 = a1buf;
}
......
......@@ -39,10 +39,14 @@ namespace flexisip {
*/
class FlexisipAuthModule : public FlexisipAuthModuleBase {
public:
using PasswordFetchResultCb = std::function<void(bool)>;
FlexisipAuthModule(su_root_t *root, const std::string &domain, const std::string &algo): FlexisipAuthModuleBase(root, domain, algo) {}
FlexisipAuthModule(su_root_t *root, const std::string &domain, const std::string &algo, int nonceExpire): FlexisipAuthModuleBase(root, domain, algo, nonceExpire) {}
~FlexisipAuthModule() override = default;
void setOnPasswordFetchResultCb(const PasswordFetchResultCb &cb) {mPassworFetchResultCb = cb;}
private:
class AuthenticationListener : public AuthDbListener {
public:
......@@ -86,6 +90,8 @@ private:
static std::string sha256(const std::string &data);
static std::string sha256(const void *data, size_t len);
static std::string toString(const std::vector<uint8_t> &data);
PasswordFetchResultCb mPassworFetchResultCb;
};
}
\ No newline at end of file
}
......@@ -156,7 +156,7 @@ void OwnRegistrationSubscription::onContactRegistered(const std::shared_ptr<Reco
shared_ptr<ExtendedContact> ct = r->extractContactByUniqueId(uid);
if (!ct){
LOGE("OwnRegistrationSubscription::onContactRegistered(): no contact with uuid %s", uid.c_str());
LOGI("OwnRegistrationSubscription::onContactRegistered(): no contact with uuid %s, it has unregistered.", uid.c_str());
return;
}
shared_ptr<Address> pubGruu = getPubGruu(r, ct);
......
......@@ -184,20 +184,15 @@ void Authentication::onLoad(const GenericStruct *mc) {
}
for (const string &domain : mDomains) {
if (mDisableQOPAuth) {
mAuthModules[domain].reset(
new FlexisipAuthModule(getAgent()->getRoot(),
domain,
mAlgorithms.front())
);
} else {
mAuthModules[domain].reset(
new FlexisipAuthModule(getAgent()->getRoot(),
domain,
mAlgorithms.front(),
nonceExpires)
);
}
FlexisipAuthModule *authModule =
mDisableQOPAuth ?
new FlexisipAuthModule(getAgent()->getRoot(), domain, mAlgorithms.front()) :
new FlexisipAuthModule(getAgent()->getRoot(), domain, mAlgorithms.front(), nonceExpires);
authModule->setOnPasswordFetchResultCb(
[this](bool passFound){passFound ? mCountPassFound++ : mCountPassNotFound++;}
);
mAuthModules[domain].reset(authModule);
SLOGI << "Found auth domain: " << domain;
}
......
......@@ -94,8 +94,7 @@ void OnRequestBindListener::onRecordFound(const shared_ptr<Record> &r) {
addEventLogRecordFound(mEv, mContact);
mModule->reply(mEv, 200, "Registration successful", r->getContacts(ms->getHome(), now));
const sip_expires_t *expires = mEv->getMsgSip()->getSip()->sip_expires;
if (mContact && expires && expires->ex_delta > 0) {
if (mContact) {
string uid = Record::extractUniqueId(mContact);
string topic = mModule->routingKey(mSipFrom->a_url);
RegistrarDb::get()->publish(topic, uid);
......@@ -124,12 +123,10 @@ void OnResponseBindListener::onRecordFound(const shared_ptr<Record> &r) {
const shared_ptr<MsgSip> &ms = mEv->getMsgSip();
time_t now = getCurrentTime();
if (r) {
const sip_expires_t *expires = mCtx->reqSipEvent->getMsgSip()->getSip()->sip_expires;
if (!expires || expires->ex_delta > 0) {
string uid = Record::extractUniqueId(mCtx->mContacts);
string topic = mModule->routingKey(mCtx->mFrom->a_url);
RegistrarDb::get()->publish(topic, uid);
}
string uid = Record::extractUniqueId(mCtx->mContacts);
string topic = mModule->routingKey(mCtx->mFrom->a_url);
RegistrarDb::get()->publish(topic, uid);
const sip_contact_t *dbContacts = r->getContacts(ms->getHome(), now);
// Replace received contacts by our ones
auto &reMs = mEv->getMsgSip();
......@@ -434,16 +431,7 @@ bool ModuleRegistrar::isManagedDomain(const url_t *url) {
}
string ModuleRegistrar::routingKey(const url_t *sipUri) {
ostringstream oss;
if (sipUri->url_user) {
oss << sipUri->url_user << "@";
}
if (mUseGlobalDomain) {
oss << "merged";
} else if (sipUri->url_host) {
oss << sipUri->url_host;
}
return oss.str();
return Record::defineKeyFromUrl(sipUri);
}
void ModuleRegistrar::reply(shared_ptr<RequestSipEvent> &ev, int code, const char *reason,
......
......@@ -726,8 +726,9 @@ void PresenceServer::processSubscribeRequestEvent(const belle_sip_request_event_
mConnPool,
mThreadPool
);
#endif
#else
goto error;
#endif
} else if ( // case of rfc5367 (list subscription with resource list in body)
content_disposition &&
(strcasecmp(belle_sip_header_content_disposition_get_content_disposition(content_disposition), "recipient-list") == 0) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment