Module: sip-router
Branch: master
Commit: 68d282e2898db7b00de473a943af900f6659ce54
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=68d282e…
Author: Marius Bucur <marius(a)marius-bucur.ro>
Committer: Marius Bucur <marius(a)marius-bucur.ro>
Date: Thu Dec 22 11:47:41 2011 +0200
Removed the constraint in siptrace to have the tm and sl modules loaded beforehand.
The explicitly module specifies these dependencies as being optional.
---
modules_k/siptrace/siptrace.c | 46 +++++++++++++++++-----------------------
1 files changed, 20 insertions(+), 26 deletions(-)
diff --git a/modules_k/siptrace/siptrace.c b/modules_k/siptrace/siptrace.c
index 93c1db7..a912fb4 100644
--- a/modules_k/siptrace/siptrace.c
+++ b/modules_k/siptrace/siptrace.c
@@ -327,42 +327,36 @@ static int mod_init(void)
*xheaders_read_flag = xheaders_read;
/* register callbacks to TM */
- if (load_tm_api(&tmb)!=0)
- {
- LM_ERR("can't load tm api. Is module tm loaded?\n");
- return -1;
- }
-
- if(tmb.register_tmcb( 0, 0, TMCB_REQUEST_IN, trace_onreq_in, 0, 0) <=0)
- {
+ if (load_tm_api(&tmb)!=0) {
+ LM_WARN("can't load tm api. Will not install tm callbacks.\n");
+ } else if(tmb.register_tmcb( 0, 0, TMCB_REQUEST_IN, trace_onreq_in, 0, 0) <=0) {
LM_ERR("can't register trace_onreq_in\n");
return -1;
}
/* bind the SL API */
if (sl_load_api(&slb)!=0) {
- LM_ERR("cannot bind to SL API\n");
- return -1;
- }
-
- /* register sl callbacks */
- memset(&slcb, 0, sizeof(sl_cbelem_t));
-
- slcb.type = SLCB_REPLY_READY;
- slcb.cbf = trace_sl_onreply_out;
- if (slb.register_cb(&slcb) != 0) {
- LM_ERR("can't register for SLCB_REPLY_READY\n");
- return -1;
- }
+ LM_WARN("cannot bind to SL API. Will not install sl callbacks.\n");
+ } else {
+ /* register sl callbacks */
+ memset(&slcb, 0, sizeof(sl_cbelem_t));
- if(trace_sl_acks)
- {
- slcb.type = SLCB_ACK_FILTERED;
- slcb.cbf = trace_sl_ack_in;
+ slcb.type = SLCB_REPLY_READY;
+ slcb.cbf = trace_sl_onreply_out;
if (slb.register_cb(&slcb) != 0) {
- LM_ERR("can't register for SLCB_ACK_FILTERED\n");
+ LM_ERR("can't register for SLCB_REPLY_READY\n");
return -1;
}
+
+ if(trace_sl_acks)
+ {
+ slcb.type = SLCB_ACK_FILTERED;
+ slcb.cbf = trace_sl_ack_in;
+ if (slb.register_cb(&slcb) != 0) {
+ LM_ERR("can't register for SLCB_ACK_FILTERED\n");
+ return -1;
+ }
+ }
}
if(dup_uri_str.s!=0)