From e220d2ef80d095dfdd725fc15cde76ef4bf8a260 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 16 Apr 2018 11:03:47 +0200 Subject: [PATCH 1/4] Added a param to configure bellesip refresher retry after timeout value --- coreapi/linphonecore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 796e82d82..2a92c87e8 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2226,7 +2226,9 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig // We need the Sal on the Android platform helper init msplugins_dir = linphone_factory_get_msplugins_dir(lfactory); image_resources_dir = linphone_factory_get_image_resources_dir(lfactory); + lc->sal=new Sal(NULL); + lc->sal->set_refresher_retry_after(lp_config_get_int(lc->config, "sip", "refresher_retry_after", 60000)); lc->sal->set_http_proxy_host(linphone_core_get_http_proxy_host(lc)); lc->sal->set_http_proxy_port(linphone_core_get_http_proxy_port(lc)); From 76dd2cce750043db2a4eb2737034a2c2264d01b0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 Apr 2018 15:12:53 +0200 Subject: [PATCH 2/4] fix(cpim-parser): coding style, use C++ style, not C --- src/chat/cpim/parser/cpim-parser.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/chat/cpim/parser/cpim-parser.cpp b/src/chat/cpim/parser/cpim-parser.cpp index d3beb28d2..ce8e3d5a4 100644 --- a/src/chat/cpim/parser/cpim-parser.cpp +++ b/src/chat/cpim/parser/cpim-parser.cpp @@ -237,17 +237,17 @@ public: Cpim::Parser::Parser () : Singleton(*new ParserPrivate) { L_D(); -#if TARGET_OS_IPHONE - CFBundleRef bundle = CFBundleGetBundleWithIdentifier( CFSTR("org.linphone.linphone") ); - CFURLRef grammar_url = CFBundleCopyResourceURL(bundle, CFSTR(CPIM_GRAMMAR), NULL, NULL); - CFStringRef grammar_path = CFURLCopyFileSystemPath(grammar_url, kCFURLPOSIXPathStyle); - CFStringEncoding encoding_method = CFStringGetSystemEncoding(); - const char *path = CFStringGetCStringPtr(grammar_path, encoding_method); - CFRelease(grammar_url); - CFRelease(grammar_path); -#else - const char *path = CPIM_GRAMMAR; -#endif + #if TARGET_OS_IPHONE + CFBundleRef bundle = CFBundleGetBundleWithIdentifier(CFSTR("org.linphone.linphone")); + CFURLRef grammarUrl = CFBundleCopyResourceURL(bundle, CFSTR(CPIM_GRAMMAR), nullptr, nullptr); + CFStringRef grammarPath = CFURLCopyFileSystemPath(grammarUrl, kCFURLPOSIXPathStyle); + CFStringEncoding encodingMethod = CFStringGetSystemEncoding(); + const char *path = CFStringGetCStringPtr(grammarPath, encodingMethod); + CFRelease(grammarUrl); + CFRelease(grammarPath); + #else + const char *path = CPIM_GRAMMAR; + #endif d->grammar = belr::GrammarLoader::get().load(path); if (!d->grammar) lFatal() << "Unable to load CPIM grammar."; From 38c8ea534a9dc3d1bc3071ff3a5f879503fb42d7 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 20 Apr 2018 11:52:53 +0200 Subject: [PATCH 3/4] Fix stack overflow. --- coreapi/bellesip_sal/sal_sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/bellesip_sal/sal_sdp.c b/coreapi/bellesip_sal/sal_sdp.c index ab3478fb6..9cd5a5ed8 100644 --- a/coreapi/bellesip_sal/sal_sdp.c +++ b/coreapi/bellesip_sal/sal_sdp.c @@ -486,7 +486,7 @@ static void sdp_parse_payload_types(belle_sdp_media_description_t *media_desc, S static void sdp_parse_media_crypto_parameters(belle_sdp_media_description_t *media_desc, SalStreamDescription *stream) { belle_sip_list_t *attribute_it; belle_sdp_attribute_t *attribute; - char tmp[256], tmp2[256], parameters[256]={0}; + char tmp[257], tmp2[257], parameters[257]={0}; int valid_count = 0; int nb; From ae3caf72f283af9a94ccb355ff43f939b4df0204 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 20 Apr 2018 11:52:59 +0200 Subject: [PATCH 4/4] Fix external body url handling. --- src/chat/chat-message/chat-message.cpp | 4 +++- src/chat/chat-room/chat-room.cpp | 2 +- src/content/file-transfer-content.cpp | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index f2ec811fe..5b42d589c 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -608,7 +608,9 @@ LinphoneReason ChatMessagePrivate::receive () { if (errorCode <= 0) { bool foundSupportContentType = false; for (Content *c : contents) { - if (linphone_core_is_content_type_supported(core->getCCore(), c->getContentType().asString().c_str())) { + ContentType ct(c->getContentType()); + ct.cleanParameters(); + if (linphone_core_is_content_type_supported(core->getCCore(), ct.asString().c_str())) { foundSupportContentType = true; break; } else diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index b0b86553f..72705d157 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -194,7 +194,7 @@ LinphoneReason ChatRoomPrivate::onSipMessageReceived (SalOp *op, const SalMessag ); Content content; - if (message->url && (ContentType(message->content_type) == ContentType::ExternalBody)) { + if (message->url && (ContentType(message->content_type).weakEqual(ContentType::ExternalBody))) { lInfo() << "Received a message with an external body URL " << message->url; content.setContentType(ContentType::FileTransfer); content.setBody(msg->getPrivate()->createFakeFileTransferFromUrl(message->url)); diff --git a/src/content/file-transfer-content.cpp b/src/content/file-transfer-content.cpp index e2fe5ab4f..2b8e228bb 100644 --- a/src/content/file-transfer-content.cpp +++ b/src/content/file-transfer-content.cpp @@ -43,7 +43,9 @@ public: // ----------------------------------------------------------------------------- -FileTransferContent::FileTransferContent () : Content(*new FileTransferContentPrivate) {} +FileTransferContent::FileTransferContent () : Content(*new FileTransferContentPrivate) { + setContentType(ContentType::FileTransfer); +} FileTransferContent::FileTransferContent (const FileTransferContent &other) : Content(*new FileTransferContentPrivate) { L_D();