Module: sip-router
Branch: jason.penton/ims_ro_interface
Commit: b8f2455b1911a88977e2327a13c6ca988d6041a4
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b8f2455b1911a88977e2327a13c6ca988d6041a4

Author: Jason Penton <[email protected]>
Committer: Jason Penton <[email protected]>
Date:   Tue Mar 12 13:18:27 2013 +0200

dialog_ng: added few functions to API to access current dialog for example

---

 modules/dialog_ng/dialog.c      |    1 +
 modules/dialog_ng/dlg_cb.h      |    2 --
 modules/dialog_ng/dlg_load.h    |    4 ++++
 modules/dialog_ng/dlg_profile.c |    2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/dialog_ng/dialog.c b/modules/dialog_ng/dialog.c
index 748515d..acbeb02 100644
--- a/modules/dialog_ng/dialog.c
+++ b/modules/dialog_ng/dialog.c
@@ -252,6 +252,7 @@ int load_dlg(struct dlg_binds *dlgb) {
     dlgb->get_dlg_var = api_get_dlg_variable;
     dlgb->terminate_dlg = w_api_terminate_dlg;
     dlgb->get_dlg_expires = api_get_dlg_expires;
+    dlgb->get_current_dlg = get_current_dialog;
 
     return 1;
 }
diff --git a/modules/dialog_ng/dlg_cb.h b/modules/dialog_ng/dlg_cb.h
index 2bed062..072e87a 100644
--- a/modules/dialog_ng/dlg_cb.h
+++ b/modules/dialog_ng/dlg_cb.h
@@ -70,8 +70,6 @@ typedef int (*set_dlg_variable_f)( str* callid, str* ftag, 
str* ttag,
 typedef str* (*get_dlg_variable_f)( str *callid, str *ftag, str *ttag,
                                     str* key);
 
-typedef struct dlg_cell* (*get_current_dlg_f)( struct sip_msg* msg);
-
 #define DLGCB_LOADED          (1<<0)
 #define DLGCB_CREATED         (1<<1)
 #define DLGCB_FAILED          (1<<2)
diff --git a/modules/dialog_ng/dlg_load.h b/modules/dialog_ng/dlg_load.h
index 80e97d6..ff2920a 100644
--- a/modules/dialog_ng/dlg_load.h
+++ b/modules/dialog_ng/dlg_load.h
@@ -38,6 +38,9 @@ typedef int (*terminate_dlg_f)(str *callid, str *ftag, str 
*ttag, str *hdrs, str
 /* get_dlg_lifetime function prototype */
 typedef time_t (*get_dlg_expires_f)(str *callid, str *ftag, str *ttag);
 
+/* get_current_dlg function prototype */
+typedef struct dlg_cell* (*get_current_dlg_f)( struct sip_msg* msg);
+
 struct dlg_binds {
        register_dlgcb_f                register_dlgcb;
        register_dlgcb_nodlg_f  register_dlgcb_nodlg;
@@ -45,6 +48,7 @@ struct dlg_binds {
        set_dlg_variable_f              set_dlg_var;
        get_dlg_variable_f              get_dlg_var;
        get_dlg_expires_f               get_dlg_expires;
+       get_current_dlg_f               get_current_dlg;
 };
 
 
diff --git a/modules/dialog_ng/dlg_profile.c b/modules/dialog_ng/dlg_profile.c
index b76fef4..ffca7c2 100644
--- a/modules/dialog_ng/dlg_profile.c
+++ b/modules/dialog_ng/dlg_profile.c
@@ -358,7 +358,7 @@ struct dlg_cell *get_current_dialog(struct sip_msg *msg)
             LM_DBG("Get Current Dialog: SIP Method - %.*s", 
msg->first_line.u.request.method.len, msg->first_line.u.request.method.s);
                /* use the per-process static holder */
                if (msg->id==current_dlg_msg_id){
-                    LM_DBG("Message Id [%i] equals current dlg msg id [%i] - 
returning current dlg pointer", msg->id, current_dlg_msg_id);
+                    LM_DBG("Message Id [%i] equals current dlg msg id [%i] - 
returning current dlg pointer [%p]", msg->id, current_dlg_msg_id, 
current_dlg_pointer);
                     return current_dlg_pointer;
                 }
                 LM_DBG("Message Id [%i] not equal to current point dlg id [%i] 
- returning null", msg->id, current_dlg_msg_id);


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

Reply via email to