Exemple #1
0
/**
 * Returns the Session-Id AVP of a Diameter message.
 * @param msg - the Diameter message
 * @returns AVP payload on success or an empty string on error
 */
inline str Rf_get_session_id(AAAMessage *msg)
{
	return Rf_get_avp(msg,
		AVP_Session_Id,
		0,
		__FUNCTION__);
}
Exemple #2
0
/**
 * Returns the Service-Context-Id AVP of a Diameter message.
 * @param msg - the Diameter message
 * @returns AVP payload on success or an empty string on error
 */
inline int Rf_get_service_context_id(AAAMessage *msg, int *data) {
	str s;
	s = Rf_get_avp(msg,
		AVP_Service_Context_Id,
		0,
		__FUNCTION__);
	if (!s.s) return 0;
	*data = get_4bytes(s.s);
	return 1;
}
Exemple #3
0
/**
 * Returns the Accounting-Record-Type AVP of a Diameter message.
 * @param msg - the Diameter message
 * @returns AVP payload on success or an empty string on error
 */
inline int Rf_get_accounting_record_type(AAAMessage *msg, int *data)
{
	str s;
	s = Rf_get_avp(msg,
		AVP_Accounting_Record_Type,
		0,
		__FUNCTION__);
	if (!s.s) return 0;
	*data = get_4bytes(s.s);
	return 1;
}
Exemple #4
0
/**
 * Returns the Result-Code AVP from a Diameter message.
 * @param msg - the Diameter message
 * @returns the AVP payload on success or an empty string on error
 */
inline int Rf_get_result_code(AAAMessage *msg, int *data)
{
	str s;
	s = Rf_get_avp(msg,
		AVP_Result_Code,
		0,
		__FUNCTION__);
	if (!s.s) return 0;
	*data = get_4bytes(s.s);
	return 1;
}
Exemple #5
0
/**
 * Returns the AVP_Credit_perMbyte AVP from a Diameter message.
 * @param msg - the Diameter message
 * @returns 1 on success or 0 on error
 */
inline int Rf_get_Credit_perMbyte(AAAMessage *msg, int *data)
{
	AAA_AVP *avp;
	avp = Rf_get_avp(msg,AVP_Credit_perMbyte,0);
	if (!avp)
	{
	LOG(L_ERR,"ERR:Rf_get_Credit_perMbyte: AVP_Credit_perMbyte not found\n");
	return 0;
	}
	*data = get_4bytes(avp->data.s); 
	return 1;
}
Exemple #6
0
/**
 * Returns the AVP_Accounting_Record_Number AVP from a Diameter message.
 * @param msg - the Diameter message
 * @returns 1 on success or 0 on error
 */
inline int Rf_get_accounting_record_type(AAAMessage *msg, int *data)
{
	AAA_AVP *avp;
	avp = Rf_get_avp(msg,AVP_Accounting_Record_Type,0);
	if (!avp)
	{
	LOG(L_ERR,"ERR:Rf_get_accounting_record_type: AVP_Accounting_Record_Type not found\n");
	return 0;
	}
	*data = get_4bytes(avp->data.s); 
	return 1;
}
Exemple #7
0
/**
 * Returns the AVP_User_Name AVP from a Diameter message.
 * @param msg - the Diameter message
 * @returns 1 on success or 0 on error
 */
inline int Rf_get_user(AAAMessage *msg, char **data)
{
	AAA_AVP *avp;
	avp = Rf_get_avp(msg,AVP_User_Name,0);
	if (!avp)
	{
	LOG(L_ERR,"ERR:Rf_get_user: AVP_User_Name not found\n");
	*data = NULL;
	return 0;
	}
	*data = avp->data.s;
	return 1;
}
Exemple #8
0
/**
 * Returns the AVP_Credit_onceoff AVP from a Diameter message.
 * @param msg - the Diameter message
 * @returns 1 on success or 0 on error
 */
inline int Rf_get_Credit_onceoff(AAAMessage *msg, int *data)
{
	AAA_AVP *avp;
	//str s;
	avp = Rf_get_avp(msg,AVP_Credit_onceoff,0);
	if (!avp)
	{
	LOG(L_ERR,"ERR:Rf_get_Credit_onceoff: AVP_Credit_onceoff not found\n");
	return 0;
	}
	*data = get_4bytes(avp->data.s); 
	return 1;
}
Exemple #9
0
/**
 * Returns the AVP_Call_Record_Id AVP from a Diameter message.
 * @param msg - the Diameter message
 * @returns 1 on success or 0 on error
 */
inline int Rf_get_call_record_id(AAAMessage *msg, int *data)
{
	AAA_AVP *avp;
	avp = Rf_get_avp(msg,AVP_Call_Record_Id,0);
	if (!avp)
	{
	LOG(L_ERR,"ERR:Rf_get_call_record_id: AVP_Call_Record_Id not found\n");
	return 0;
	}
	*data = get_4bytes(avp->data.s); 
	return 1;

}