1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_diameter_helpers_dcca_functions_hpp
10 #define anna_diameter_helpers_dcca_functions_hpp
13 #include <anna/core/RuntimeException.hpp>
15 #include <anna/diameter/helpers/dcca/defines.hpp>
20 //------------------------------------------------------------------------------
21 //---------------------------------------------------------------------- #define
22 //------------------------------------------------------------------------------
39 * Type of charging context
41 struct ChargingContext { enum _v { Unknown = -1, Data, Voice, Content, SMS, MMS }; };
44 struct ChargingContextAndDomainSuffix {
46 /** Charging context and domain suffic for data traffic */
47 static const char Data[];
49 /** Charging context and domain suffic for voice traffic */
50 static const char Voice[];
52 /** Charging context and domain suffic for content traffic */
53 static const char Content[];
55 /** Charging context and domain suffic for SMS traffic */
56 static const char SMS[];
58 /** Charging context and domain suffic for MMS traffic */
59 static const char MMS[];
68 * Subscription-Id-Data for provided Subscription-Id-Type within a command.
70 * @param db Provided Message DataBlock
71 * @param Subscription-Id-Type value to filter the search. END_USER_E164 by default.
73 * @return Subscription-Id-Data for type provided. Empty string when not found.
75 static std::string getSubscriptionIdData(const anna::DataBlock &db,
76 int subscriptionIdType = AVPVALUES__Subscription_Id_Type::END_USER_E164) throw(anna::RuntimeException);
80 * Service-Context-Id from datablock provided.
82 * @param db Provided Message DataBlock
83 * @param chargingContext Detected charging context
85 * @return Service-Context-Id
87 static std::string getServiceContextId(const anna::DataBlock &db, ChargingContext::_v &chargingContext) throw(anna::RuntimeException);
90 * Service-Context-Id from datablock provided.
92 * @param db Provided Message DataBlock
94 * @return Service-Context-Id
96 static std::string getServiceContextId(const anna::DataBlock &db) throw(anna::RuntimeException) {
97 ChargingContext::_v dummy;
98 return getServiceContextId(db, dummy);