Skip to content

Commit

Permalink
uac: uac_req_send() exported via api
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Apr 18, 2015
1 parent 344b595 commit e242b2c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
2 changes: 2 additions & 0 deletions modules/uac/api.h
Expand Up @@ -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*);
Expand Down
24 changes: 12 additions & 12 deletions modules/uac/uac.c
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
6 changes: 5 additions & 1 deletion modules/uac/uac_send.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
3 changes: 2 additions & 1 deletion modules/uac/uac_send.h
Expand Up @@ -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

0 comments on commit e242b2c

Please sign in to comment.