Module: sip-router
Branch: master
Commit: 3b7a97f8f463dae560de2a371ada379c99c4db47
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3b7a97f8f463dae560de2a371ada379c99c4db47

Author: Timo Reimann <[email protected]>
Committer: Timo Reimann <[email protected]>
Date:   Wed Aug 17 17:25:14 2011 +0200

modules_k/dialog: Prefix get_valid_msg() function name with "dlg_"
and turn static inline to enable usage when the dialog module is
not linked in.

- modules_k/pua_dialoginfo: Use changed function name.

---

 modules_k/dialog/dlg_cb.c                 |   21 ---------------------
 modules_k/dialog/dlg_cb.h                 |   20 +++++++++++++++++++-
 modules_k/pua_dialoginfo/pua_dialoginfo.c |    2 +-
 3 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/modules_k/dialog/dlg_cb.c b/modules_k/dialog/dlg_cb.c
index df8c3cb..3f2f2cd 100644
--- a/modules_k/dialog/dlg_cb.c
+++ b/modules_k/dialog/dlg_cb.c
@@ -260,24 +260,3 @@ void run_dlg_callbacks( int type ,
        }
        return;
 }
-
-
-struct sip_msg *get_valid_msg(struct dlg_cb_params *cb_params)
-{
-       struct sip_msg *msg;
-
-       if (cb_params == NULL) {
-               LM_ERR("no dialog parameters given\n");
-               return NULL;
-       }
-
-       msg = cb_params->req;
-       if (msg == NULL) {
-               msg = cb_params->rpl;
-               if (msg == NULL || msg == FAKED_REPLY) {
-                       return NULL;
-               }
-       }
-
-       return msg;
-}
diff --git a/modules_k/dialog/dlg_cb.h b/modules_k/dialog/dlg_cb.h
index f8bcadc..8d364ba 100644
--- a/modules_k/dialog/dlg_cb.h
+++ b/modules_k/dialog/dlg_cb.h
@@ -116,6 +116,24 @@ void run_load_callbacks( void );
  * \param cb_params dialog callback parameter struct
  * \return pointer to valid SIP message if existent, NULL otherwise
  */
-struct sip_msg *get_valid_msg(struct dlg_cb_params *cb_params);
+static inline struct sip_msg *dlg_get_valid_msg(struct dlg_cb_params 
*cb_params)
+{
+       struct sip_msg *msg;
+
+       if (cb_params == NULL) {
+               LM_ERR("no dialog parameters given\n");
+               return NULL;
+       }
+
+       msg = cb_params->req;
+       if (msg == NULL) {
+               msg = cb_params->rpl;
+               if (msg == NULL || msg == FAKED_REPLY) {
+                       return NULL;
+               }
+       }
+
+       return msg;
+};
 
 #endif
diff --git a/modules_k/pua_dialoginfo/pua_dialoginfo.c 
b/modules_k/pua_dialoginfo/pua_dialoginfo.c
index 792e3b0..947f90d 100644
--- a/modules_k/pua_dialoginfo/pua_dialoginfo.c
+++ b/modules_k/pua_dialoginfo/pua_dialoginfo.c
@@ -130,7 +130,7 @@ __dialog_cbtest(struct dlg_cell *dlg, int type, struct 
dlg_cb_params *_params)
        }
 
 if (type != DLGCB_DESTROY) {
-       msg = get_valid_msg(_params);
+       msg = dlg_get_valid_msg(_params);
        if (!msg) {
                LM_ERR("no SIP message available in callback parameters\n");
                return;


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to