Commit 9f1fc990 authored by Simon Morlat's avatar Simon Morlat

Fix crash when redis disconnects while passing an unREGISTER.

Improved error handling when GRUU address routing fails.
Adapt to new linphone-sdk.

Allow macos build to fail.

Update linphone-sdk to fix rpms.
parent e0b237dd
Pipeline #8585 passed with stages
in 33 minutes and 18 seconds
......@@ -38,7 +38,7 @@ job-macosx-makefile:
#################################################
job-macosx-ninja:
allow_failure: true
variables:
CMAKE_GENERATOR: Ninja
extends: .job-macosx
......
......@@ -85,11 +85,11 @@ find_package(SofiaSipUa 1.13.11 REQUIRED) #find_package only allow numbers
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_ortp_CONFIG_DIR}/ORTPConfig.cmake")
else()
find_package(ORTP 0.21 REQUIRED)
find_package(ortp 0.21 REQUIRED)
endif()
find_package(BcToolbox 0.0.3 REQUIRED)
find_package(Belr REQUIRED)
find_package(bctoolbox 0.0.3 REQUIRED)
find_package(belr REQUIRED)
find_package(LibXsd)
......
Subproject commit 054b9108e0bff7ac1d7d4cfc455ebdd0b9e23f0a
Subproject commit 1eb2091f785085b89a03ffbb6a85d6f3f33e380f
......@@ -182,24 +182,23 @@ public:
~RegistrarListener(){};
void onRecordFound(const shared_ptr<Record> &r) override {
const shared_ptr<MsgSip> &ms = mEv->getMsgSip();
try {
if (!r)
throw FLEXISIP_EXCEPTION << "Record not found for ["<< mEv<< "]";
if (r->count() != 1)
throw FLEXISIP_EXCEPTION << "Too many extended contacts ["<< r->count() <<"] found for ["<< mEv<< "]";
shared_ptr<ExtendedContact> contact = *r->getExtendedContacts().begin();
time_t now = getCurrentTime();
sip_contact_t *ct = contact->toSofiaContact(ms->getHome(), now);
url_t *dest = ct->m_url;
mEv->getSip()->sip_request->rq_url[0] = *url_hdup(msg_home(ms->getHome()), dest);
mEv->getSip()->sip_request->rq_url->url_params = url_strip_param_string(su_strdup(ms->getHome(),mEv->getSip()->sip_request->rq_url->url_params) , "gr");
mModule->sendRequest(mEv,dest);
} catch (FlexisipException &e) {
SLOGD << e;
mEv->reply(500, "Internal Server Error", SIPTAG_SERVER_STR(mModule->getAgent()->getServerString()), TAG_END());
if (!r || r->count()==0){
mEv->reply(404, "Not found", SIPTAG_SERVER_STR(mModule->getAgent()->getServerString()), TAG_END());
return;
}
if (r->count() > 1){
mEv->reply(485, "Ambiguous", SIPTAG_SERVER_STR(mModule->getAgent()->getServerString()), TAG_END());
return;
}
shared_ptr<ExtendedContact> contact = *r->getExtendedContacts().begin();
time_t now = getCurrentTime();
sip_contact_t *ct = contact->toSofiaContact(ms->getHome(), now);
url_t *dest = ct->m_url;
mEv->getSip()->sip_request->rq_url[0] = *url_hdup(msg_home(ms->getHome()), dest);
mEv->getSip()->sip_request->rq_url->url_params = url_strip_param_string(su_strdup(ms->getHome(),mEv->getSip()->sip_request->rq_url->url_params) , "gr");
mModule->sendRequest(mEv,dest);
}
virtual void onError() override{
SLOGE << "RegistrarListener error";
......
......@@ -664,13 +664,18 @@ void RegistrarDbRedisAsync::sBindRetry(void *unused, su_timer_t *t, void *ud){
su_timer_destroy(data->mRetryTimer);
data->mRetryTimer = nullptr;
RegistrarDbRedisAsync *self = data->self;
if (self->isConnected()){
self->serializeAndSendToRedis(data, sHandleBindFinish);
}else{
if (!self->isConnected()){
goto fail;
}
if (data->mIsUnregister) goto fail; /* Re-submitting the HDEL is not implemented.*/
self->serializeAndSendToRedis(data, sHandleBindFinish);
return;
fail:
LOGE("Unrecoverable error while updating record fs:%s : no connection", data->mRecord->getKey().c_str());
if (data->listener) data->listener->onError();
delete data;
}
}
void RegistrarDbRedisAsync::handleBind(redisReply *reply, RegistrarUserData *data) {
......
Subproject commit 1c78612bd94a664eb47ec2725bbd2487d3e35d21
Subproject commit c63eed8bd5cc99f18e64c41a57909d5279da966e
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