Module: sip-router Branch: master Commit: d19ed17c6b325522eedf3874f8b112a9315325c5 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d19ed17c...
Author: Marius Bucur marius.bucur@1and1.ro Committer: Marius Bucur marius.bucur@1and1.ro Date: Thu Feb 2 17:09:30 2012 +0200
Renamed the cfg functions to dmq_* instead of *_dmq_*.
---
modules_k/dmq/bind_dmq.c | 2 +- modules_k/dmq/dmq.c | 6 ++---- modules_k/dmq/dmq.h | 2 +- modules_k/dmq/dmq_funcs.c | 10 +++++----- modules_k/dmq/dmq_funcs.h | 4 ++-- modules_k/dmq/message.c | 6 +++--- modules_k/dmq/message.h | 2 +- modules_k/dmq/notification_peer.c | 2 +- 8 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/modules_k/dmq/bind_dmq.c b/modules_k/dmq/bind_dmq.c index 472babb..573cf82 100644 --- a/modules_k/dmq/bind_dmq.c +++ b/modules_k/dmq/bind_dmq.c @@ -5,7 +5,7 @@
int bind_dmq(dmq_api_t* api) { api->register_dmq_peer = register_dmq_peer; - api->send_message = send_dmq_message; + api->send_message = dmq_send_message; api->bcast_message = bcast_dmq_message; return 0; } diff --git a/modules_k/dmq/dmq.c b/modules_k/dmq/dmq.c index 62fa6e6..64ec282 100644 --- a/modules_k/dmq/dmq.c +++ b/modules_k/dmq/dmq.c @@ -97,12 +97,10 @@ static int send_dmq_fixup(void** param, int param_no); static int parse_server_address(str* uri, struct sip_uri* parsed_uri);
static cmd_export_t cmds[] = { - {"handle_dmq_message", (cmd_function)handle_dmq_message, 0, handle_dmq_fixup, 0, + {"dmq_handle_message", (cmd_function)dmq_handle_message, 0, handle_dmq_fixup, 0, REQUEST_ROUTE}, - {"send_dmq_message", (cmd_function)cfg_send_dmq_message, 3, send_dmq_fixup, 0, + {"dmq_send_message", (cmd_function)cfg_dmq_send_message, 3, send_dmq_fixup, 0, ANY_ROUTE}, - {"bind_dmq", (cmd_function)bind_dmq, 0, 0, 0, - REQUEST_ROUTE}, {0, 0, 0, 0, 0, 0} };
diff --git a/modules_k/dmq/dmq.h b/modules_k/dmq/dmq.h index df92cea..88dabb0 100644 --- a/modules_k/dmq/dmq.h +++ b/modules_k/dmq/dmq.h @@ -47,7 +47,7 @@ static inline int dmq_load_api(dmq_api_t* api) { return 0; }
-int handle_dmq_message(struct sip_msg* msg, char* str1 ,char* str2); +int dmq_handle_message(struct sip_msg* msg, char* str1 ,char* str2);
#endif
diff --git a/modules_k/dmq/dmq_funcs.c b/modules_k/dmq/dmq_funcs.c index 988563a..6d56a1e 100644 --- a/modules_k/dmq/dmq_funcs.c +++ b/modules_k/dmq/dmq_funcs.c @@ -85,7 +85,7 @@ int bcast_dmq_message(dmq_peer_t* peer, str* body, dmq_node_t* except, dmq_resp_ node = node->next; continue; } - if(send_dmq_message(peer, body, node, resp_cback, max_forwards) < 0) { + if(dmq_send_message(peer, body, node, resp_cback, max_forwards) < 0) { LM_ERR("error sending dmq message\n"); goto error; } @@ -104,7 +104,7 @@ error: * node - we send the message to this node * resp_cback - a response callback that gets called when the transaction is complete */ -int send_dmq_message(dmq_peer_t* peer, str* body, dmq_node_t* node, dmq_resp_cback_t* resp_cback, int max_forwards) { +int dmq_send_message(dmq_peer_t* peer, str* body, dmq_node_t* node, dmq_resp_cback_t* resp_cback, int max_forwards) { uac_req_t uac_r; str str_hdr = {0, 0}; str from, to, req_uri; @@ -149,14 +149,14 @@ error: return -1; }
-int cfg_send_dmq_message(struct sip_msg* msg, char* peer, char* to, char* body) { +int cfg_dmq_send_message(struct sip_msg* msg, char* peer, char* to, char* body) { str peer_str; get_str_fparam(&peer_str, msg, (fparam_t*)peer); str to_str; get_str_fparam(&to_str, msg, (fparam_t*)to); str body_str; get_str_fparam(&body_str, msg, (fparam_t*)body); - LM_INFO("cfg_send_dmq_message: %.*s - %.*s - %.*s\n", + LM_INFO("cfg_dmq_send_message: %.*s - %.*s - %.*s\n", peer_str.len, peer_str.s, to_str.len, to_str.s, body_str.len, body_str.s); @@ -180,7 +180,7 @@ int cfg_send_dmq_message(struct sip_msg* msg, char* peer, char* to, char* body) LM_ERR("cannot find dmq_node: %.*s\n", to_str.len, to_str.s); goto error; } - if(send_dmq_message(destination_peer, &body_str, to_dmq_node, ¬ification_callback, 1) < 0) { + if(dmq_send_message(destination_peer, &body_str, to_dmq_node, ¬ification_callback, 1) < 0) { LM_ERR("cannot send dmq message\n"); goto error; } diff --git a/modules_k/dmq/dmq_funcs.h b/modules_k/dmq/dmq_funcs.h index 7381da6..9cce2fe 100644 --- a/modules_k/dmq/dmq_funcs.h +++ b/modules_k/dmq/dmq_funcs.h @@ -21,9 +21,9 @@ typedef struct dmq_cback_param { dmq_node_t* node; } dmq_cback_param_t;
-int cfg_send_dmq_message(struct sip_msg* msg, char* peer, char* to, char* body); +int cfg_dmq_send_message(struct sip_msg* msg, char* peer, char* to, char* body); dmq_peer_t* register_dmq_peer(dmq_peer_t* peer); -int send_dmq_message(dmq_peer_t* peer, str* body, dmq_node_t* node, dmq_resp_cback_t* resp_cback, int max_forwards); +int dmq_send_message(dmq_peer_t* peer, str* body, dmq_node_t* node, dmq_resp_cback_t* resp_cback, int max_forwards); int bcast_dmq_message(dmq_peer_t* peer, str* body, dmq_node_t* except, dmq_resp_cback_t* resp_cback, int max_forwards);
#endif diff --git a/modules_k/dmq/message.c b/modules_k/dmq/message.c index 3971ab5..494bd5f 100644 --- a/modules_k/dmq/message.c +++ b/modules_k/dmq/message.c @@ -14,7 +14,7 @@ str dmq_400_rpl = str_init("Bad request"); str dmq_500_rpl = str_init("Server Internal Error"); str dmq_404_rpl = str_init("User Not Found");
-int handle_dmq_message(struct sip_msg* msg, char* str1, char* str2) { +int dmq_handle_message(struct sip_msg* msg, char* str1, char* str2) { dmq_peer_t* peer; struct sip_msg* cloned_msg = NULL; int cloned_msg_len; @@ -22,7 +22,7 @@ int handle_dmq_message(struct sip_msg* msg, char* str1, char* str2) { LM_ERR("error parsing msg uri\n"); goto error; } - LM_DBG("handle_dmq_message [%.*s %.*s] [%s %s]\n", + LM_DBG("dmq_handle_message [%.*s %.*s] [%s %s]\n", msg->first_line.u.request.method.len, msg->first_line.u.request.method.s, msg->first_line.u.request.uri.len, msg->first_line.u.request.uri.s, ZSW(str1), ZSW(str2)); @@ -37,7 +37,7 @@ int handle_dmq_message(struct sip_msg* msg, char* str1, char* str2) { } return 0; } - LM_DBG("handle_dmq_message peer found: %.*s\n", msg->parsed_uri.user.len, msg->parsed_uri.user.s); + LM_DBG("dmq_handle_message peer found: %.*s\n", msg->parsed_uri.user.len, msg->parsed_uri.user.s); cloned_msg = sip_msg_shm_clone(msg, &cloned_msg_len, 1); if(!cloned_msg) { LM_ERR("error cloning sip message\n"); diff --git a/modules_k/dmq/message.h b/modules_k/dmq/message.h index e9a01a7..03aa2a6 100644 --- a/modules_k/dmq/message.h +++ b/modules_k/dmq/message.h @@ -1,3 +1,3 @@
-int handle_dmq_message(struct sip_msg*, char*, char*); +int dmq_handle_message(struct sip_msg*, char*, char*);
diff --git a/modules_k/dmq/notification_peer.c b/modules_k/dmq/notification_peer.c index a6d134b..4ba6225 100644 --- a/modules_k/dmq/notification_peer.c +++ b/modules_k/dmq/notification_peer.c @@ -201,7 +201,7 @@ error: int request_nodelist(dmq_node_t* node, int forward) { str* body = build_notification_body(); int ret; - ret = send_dmq_message(dmq_notification_peer, body, node, ¬ification_callback, forward); + ret = dmq_send_message(dmq_notification_peer, body, node, ¬ification_callback, forward); pkg_free(body->s); pkg_free(body); return ret;