diff --git a/modules/uac/api.h b/modules/uac/api.h index 2d8e3b6994a..7a4bcfe39f9 100644 --- a/modules/uac/api.h +++ b/modules/uac/api.h @@ -4,9 +4,11 @@ typedef int (*uac_replace_from_t)(sip_msg_t *, str *, str *); +typedef int (*uac_req_send_t)(void); typedef struct uac_binds { uac_replace_from_t replace_from; + uac_req_send_t req_send; } uac_api_t; typedef int (*bind_uac_f)(uac_api_t*); diff --git a/modules/uac/uac.c b/modules/uac/uac.c index ede7a861545..91f7099ff83 100644 --- a/modules/uac/uac.c +++ b/modules/uac/uac.c @@ -115,9 +115,8 @@ static cmd_export_t cmds[]={ REQUEST_ROUTE }, {"uac_auth", (cmd_function)w_uac_auth, 0, 0, 0, FAILURE_ROUTE }, - {"uac_req_send", (cmd_function)uac_req_send, 0, 0, 0, - REQUEST_ROUTE | FAILURE_ROUTE | - ONREPLY_ROUTE | BRANCH_ROUTE | ERROR_ROUTE | LOCAL_ROUTE}, + {"uac_req_send", (cmd_function)w_uac_req_send, 0, 0, 0, + ANY_ROUTE}, {"uac_reg_lookup", (cmd_function)w_uac_reg_lookup, 2, fixup_pvar_pvar, fixup_free_pvar_pvar, ANY_ROUTE }, {"uac_reg_request_to", (cmd_function)w_uac_reg_request_to, 2, fixup_pvar_uint, fixup_free_pvar_uint, @@ -574,14 +573,15 @@ static int w_uac_reg_request_to(struct sip_msg* msg, char* src, char* mode_s) } -int bind_uac(struct uac_binds *uacb) +int bind_uac(uac_api_t *uacb) { - if (uacb == NULL) - { - LM_WARN("bind_uac: Cannot load uac API into a NULL pointer\n"); - return -1; - } - - uacb->replace_from = replace_from_api; - return 0; + if (uacb == NULL) { + LM_WARN("bind_uac: Cannot load uac API into a NULL pointer\n"); + return -1; + } + + memset(uacb, 0, sizeof(uac_api_t)); + uacb->replace_from = replace_from_api; + uacb->req_send = uac_req_send; + return 0; } diff --git a/modules/uac/uac_send.c b/modules/uac/uac_send.c index 0309b20f114..a429bdc5cca 100644 --- a/modules/uac/uac_send.c +++ b/modules/uac/uac_send.c @@ -755,7 +755,7 @@ void uac_send_tm_callback(struct cell *t, int type, struct tmcb_params *ps) } -int uac_req_send(struct sip_msg *msg, char *s1, char *s2) +int uac_req_send(void) { int ret; uac_req_t uac_r; @@ -801,3 +801,7 @@ int uac_req_send(struct sip_msg *msg, char *s1, char *s2) return 1; } +int w_uac_req_send(struct sip_msg *msg, char *s1, char *s2) +{ + return uac_req_send(); +} diff --git a/modules/uac/uac_send.h b/modules/uac/uac_send.h index 8e2e0894584..2d43657a0b8 100644 --- a/modules/uac/uac_send.h +++ b/modules/uac/uac_send.h @@ -29,6 +29,7 @@ int pv_set_uac_req(struct sip_msg* msg, pv_param_t *param, int op, pv_value_t *val); int pv_parse_uac_req_name(pv_spec_p sp, str *in); void uac_req_init(void); -int uac_req_send(struct sip_msg *msg, char *s1, char *s2); +int uac_req_send(void); +int w_uac_req_send(struct sip_msg *msg, char *s1, char *s2); #endif