MT#13599 don't create CF map if CF is denied by profile

mr4.0.1
Andrew Pogrebennyk 11 years ago
parent dc868916e6
commit 89c3172468

@ -11,5 +11,6 @@ sipwise/sw_vcs.patch
sipwise/0006-rename_xdigits.patch
sipwise/0008-dsm-helper-functions-macros-for-modules-replaceParam.patch
sipwise/0015-confpin-simple-pin-conference-app.patch
sipwise/0016-MT-13599-don-t-create-CF-map-if-CF-is-denied-by-prof.patch
no_config.patch
py_sems_path.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);
Loading…
Cancel
Save