From 421f78533d338cde702cbc3c1253c8a98d8bc51b Mon Sep 17 00:00:00 2001 From: Andrew Pogrebennyk Date: Mon, 29 Jun 2015 10:28:36 +0200 Subject: [PATCH] MT#13599 don't create CF map if CF is denied by profile --- debian/patches/series | 1 + ...reate-CF-map-if-CF-is-denied-by-prof.patch | 186 ++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 debian/patches/sipwise/0017-MT-13599-don-t-create-CF-map-if-CF-is-denied-by-prof.patch diff --git a/debian/patches/series b/debian/patches/series index 39117caf..477d30a9 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -15,5 +15,6 @@ sipwise/0013-dsm-mod_groups-functions-to-get-group-participants-a.patch sipwise/0014-dsm-mod_conference-flushMixInList-action-loop-for-mi.patch sipwise/0015-confpin-simple-pin-conference-app.patch sipwise/0016-core-made-sems-aware-of-rfc5764-media-types-UDP-TLS-.patch +sipwise/0017-MT-13599-don-t-create-CF-map-if-CF-is-denied-by-prof.patch no_config.patch py_sems_path.patch diff --git a/debian/patches/sipwise/0017-MT-13599-don-t-create-CF-map-if-CF-is-denied-by-prof.patch b/debian/patches/sipwise/0017-MT-13599-don-t-create-CF-map-if-CF-is-denied-by-prof.patch new file mode 100644 index 00000000..3f9efb0f --- /dev/null +++ b/debian/patches/sipwise/0017-MT-13599-don-t-create-CF-map-if-CF-is-denied-by-prof.patch @@ -0,0 +1,186 @@ +--- a/apps/sw_vsc/SW_Vsc.cpp ++++ b/apps/sw_vsc/SW_Vsc.cpp +@@ -1214,36 +1214,36 @@ void SW_VscDialog::onInvite(const AmSipR + if ((ret = regexec(&m_patterns->cfuOnPattern, + req.user.c_str(), 0, 0, 0)) == 0) + { +- if (!number2uri(req, my_handler, uuid, subId, domain, domId, 4, +- uri, username)) ++ u_int64_t attId = getAttributeId(my_handler, "cfu"); ++ if (!attId) + { + filename = failAnnouncement; + goto out; + } + +- u_int64_t mapId = createCFMap(my_handler, subId, uri, +- SW_VSC_DESTSET_CFU, "cfu"); +- if (!mapId) ++ if(!checkSubscriberProfile(my_handler, profId, attId)) + { + filename = failAnnouncement; + goto out; + } +- snprintf(map_str, sizeof(mapStr), "%llu", +- (unsigned long long int)mapId); +- mapStr = string(map_str); + +- u_int64_t attId = getAttributeId(my_handler, "cfu"); +- if (!attId) ++ if (!number2uri(req, my_handler, uuid, subId, domain, domId, 4, ++ uri, username)) + { + filename = failAnnouncement; + goto out; + } + +- if(!checkSubscriberProfile(my_handler, profId, attId)) ++ u_int64_t mapId = createCFMap(my_handler, subId, uri, ++ SW_VSC_DESTSET_CFU, "cfu"); ++ if (!mapId) + { + filename = failAnnouncement; + goto out; + } ++ snprintf(map_str, sizeof(mapStr), "%llu", ++ (unsigned long long int)mapId); ++ mapStr = string(map_str); + + u_int64_t prefId = getPreference(my_handler, subId, attId, + &foundPref, &prefStr); +@@ -1331,36 +1331,36 @@ void SW_VscDialog::onInvite(const AmSipR + if ((ret = regexec(&m_patterns->cfbOnPattern, + req.user.c_str(), 0, 0, 0)) == 0) + { +- if (!number2uri(req, my_handler, uuid, subId, domain, domId, 4, +- uri, username)) ++ u_int64_t attId = getAttributeId(my_handler, "cfb"); ++ if (!attId) + { + filename = failAnnouncement; + goto out; + } + +- u_int64_t mapId = createCFMap(my_handler, subId, uri, +- SW_VSC_DESTSET_CFB, "cfb"); +- if (!mapId) ++ if(!checkSubscriberProfile(my_handler, profId, attId)) + { + filename = failAnnouncement; + goto out; + } +- snprintf(map_str, sizeof(mapStr), "%llu", +- (unsigned long long int)mapId); +- mapStr = string(map_str); + +- u_int64_t attId = getAttributeId(my_handler, "cfb"); +- if (!attId) ++ if (!number2uri(req, my_handler, uuid, subId, domain, domId, 4, ++ uri, username)) + { + filename = failAnnouncement; + goto out; + } + +- if(!checkSubscriberProfile(my_handler, profId, attId)) ++ u_int64_t mapId = createCFMap(my_handler, subId, uri, ++ SW_VSC_DESTSET_CFB, "cfb"); ++ if (!mapId) + { + filename = failAnnouncement; + goto out; + } ++ snprintf(map_str, sizeof(mapStr), "%llu", ++ (unsigned long long int)mapId); ++ mapStr = string(map_str); + + u_int64_t prefId = getPreference(my_handler, subId, attId, + &foundPref, &prefStr); +@@ -1448,6 +1448,19 @@ void SW_VscDialog::onInvite(const AmSipR + if ((ret = regexec(&m_patterns->cftOnPattern, + req.user.c_str(), 0, 0, 0)) == 0) + { ++ u_int64_t attId = getAttributeId(my_handler, "cft"); ++ if (!attId) ++ { ++ filename = failAnnouncement; ++ goto out; ++ } ++ ++ if(!checkSubscriberProfile(my_handler, profId, attId)) ++ { ++ filename = failAnnouncement; ++ goto out; ++ } ++ + string::size_type timend = req.user.find('*', 4); + string tim = req.user.substr(4, timend - 4); + INFO("Extracted ringtimeout of '%s' from '%s' for uuid '%s'", +@@ -1471,19 +1484,6 @@ void SW_VscDialog::onInvite(const AmSipR + (unsigned long long int)mapId); + mapStr = string(map_str); + +- u_int64_t attId = getAttributeId(my_handler, "cft"); +- if (!attId) +- { +- filename = failAnnouncement; +- goto out; +- } +- +- if(!checkSubscriberProfile(my_handler, profId, attId)) +- { +- filename = failAnnouncement; +- goto out; +- } +- + u_int64_t prefId = getPreference(my_handler, subId, attId, + &foundPref, &prefStr); + if (!prefId) +@@ -1628,36 +1628,36 @@ void SW_VscDialog::onInvite(const AmSipR + if ((ret = regexec(&m_patterns->cfnaOnPattern, + req.user.c_str(), 0, 0, 0)) == 0) + { +- if (!number2uri(req, my_handler, uuid, subId, domain, domId, 4, +- uri, username)) ++ u_int64_t attId = getAttributeId(my_handler, "cfna"); ++ if (!attId) + { + filename = failAnnouncement; + goto out; + } + +- u_int64_t mapId = createCFMap(my_handler, subId, uri, +- SW_VSC_DESTSET_CFNA, "cfna"); +- if (!mapId) ++ if(!checkSubscriberProfile(my_handler, profId, attId)) + { + filename = failAnnouncement; + goto out; + } +- snprintf(map_str, sizeof(mapStr), "%llu", +- (unsigned long long int)mapId); +- mapStr = string(map_str); + +- u_int64_t attId = getAttributeId(my_handler, "cfna"); +- if (!attId) ++ if (!number2uri(req, my_handler, uuid, subId, domain, domId, 4, ++ uri, username)) + { + filename = failAnnouncement; + goto out; + } + +- if(!checkSubscriberProfile(my_handler, profId, attId)) ++ u_int64_t mapId = createCFMap(my_handler, subId, uri, ++ SW_VSC_DESTSET_CFNA, "cfna"); ++ if (!mapId) + { + filename = failAnnouncement; + goto out; + } ++ snprintf(map_str, sizeof(mapStr), "%llu", ++ (unsigned long long int)mapId); ++ mapStr = string(map_str); + + u_int64_t prefId = getPreference(my_handler, subId, attId, + &foundPref, &prefStr);