Module: sip-router Branch: richard.good/diameter_rx_media Commit: 72d618cc7e669cab90fbed8c3580c464b13f6118 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=72d618cc...
Author: Richard Good richard.good@smilecoms.com Committer: Richard Good richard.good@smilecoms.com Date: Thu Feb 28 15:20:45 2013 +0200
ims_qos: standardised on return code for modules
- Use CSCF_RETURN_ instead of RX_RETURN_ throughout the module - previously a mix of both these static variables was used. Both variables are identical but it made for confusing code reading.
---
modules/ims_qos/rx_avp.c | 10 ++++++---- modules/ims_qos/rx_str.c | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/modules/ims_qos/rx_avp.c b/modules/ims_qos/rx_avp.c index f92d507..86a630f 100644 --- a/modules/ims_qos/rx_avp.c +++ b/modules/ims_qos/rx_avp.c @@ -56,6 +56,8 @@ #include "rx_avp.h" #include "mod.h"
+#include "../../lib/ims/ims_getters.h" + /**< Structure with pointers to cdp funcs, global variable defined in mod.c */ extern struct cdp_binds cdpb; extern cdp_avp_bind_t *cdp_avp; @@ -86,7 +88,7 @@ inline int rx_add_avp(AAAMessage *m, char *d, int len, int avp_code, cdpb.AAAFreeAVP(&avp); return 0; } - return RX_RETURN_TRUE; + return CSCF_RETURN_TRUE; }
/** @@ -122,7 +124,7 @@ static inline int rx_add_avp_list(AAA_AVP_LIST *list, char *d, int len, int avp_ avp->prev = 0; }
- return RX_RETURN_TRUE; + return CSCF_RETURN_TRUE; }
/** @@ -272,7 +274,7 @@ inline int rx_add_destination_realm_avp(AAAMessage *msg, str data) { * Creates and adds an Acct-Application-Id AVP. * @param msg - the Diameter message to add to. * @param data - the value for the AVP payload - * @return RX_RETURN_TRUE on success or 0 on error + * @return CSCF_RETURN_TRUE on success or 0 on error */ inline int rx_add_auth_application_id_avp(AAAMessage *msg, unsigned int data) { char x[4]; @@ -292,7 +294,7 @@ inline int rx_add_auth_application_id_avp(AAAMessage *msg, unsigned int data) { * @param msg - the Diameter message to add to. * @param r - the sip_message to extract the data from. * @param tag - originating (0) terminating (1) - * @return RX_RETURN_TRUE on success or 0 on error + * @return CSCF_RETURN_TRUE on success or 0 on error * */
diff --git a/modules/ims_qos/rx_str.c b/modules/ims_qos/rx_str.c index 7521034..2d630a3 100644 --- a/modules/ims_qos/rx_str.c +++ b/modules/ims_qos/rx_str.c @@ -58,6 +58,8 @@ #include "rx_avp.h" #include "rx_str.h"
+#include "../../lib/ims/ims_getters.h" + extern str IMS_Serv_AVP_val;
int rx_send_str(str *rx_session_id) { @@ -72,7 +74,7 @@ int rx_send_str(str *rx_session_id) {
if (!rx_session_id || !rx_session_id->s || !rx_session_id->len) { LM_ERR("Dialog has no Rx session associated\n"); - return RX_RETURN_FALSE; + return CSCF_RETURN_FALSE; }else { LM_DBG("Rx session id exists\n"); @@ -83,7 +85,7 @@ int rx_send_str(str *rx_session_id) { auth = cdpb.AAAGetAuthSession(*rx_session_id); if (!auth) { LM_ERR("Could not get Auth Session for session id: [%.*s]\n", rx_session_id->len, rx_session_id->s); - return RX_RETURN_FALSE; + return CSCF_RETURN_FALSE; }else{ LM_DBG("Retrieved Auth Session for session id: [%.*s]\n", rx_session_id->len, rx_session_id->s); } @@ -155,7 +157,7 @@ int rx_send_str(str *rx_session_id) {
LM_DBG("Successfully sent Rx STR for session: [%.*s]\n", rx_session_id->len, rx_session_id->s);
- return RX_RETURN_TRUE; + return CSCF_RETURN_TRUE;
error: LM_DBG("Error sending Rx STR for session: [%.*s]\n", rx_session_id->len, rx_session_id->s); @@ -166,5 +168,5 @@ error: auth = 0; }
- return RX_RETURN_FALSE; + return CSCF_RETURN_FALSE; }