|
@@ -98,6 +98,7 @@ static int w_restore_from(struct sip_msg* msg, char* p1, char* p2);
|
|
|
static int w_replace_to(struct sip_msg* msg, char* p1, char* p2);
|
|
|
static int w_restore_to(struct sip_msg* msg, char* p1, char* p2);
|
|
|
static int w_uac_auth(struct sip_msg* msg, char* str, char* str2);
|
|
|
+static int w_uac_auth_mode(struct sip_msg* msg, char* pmode, char* str2);
|
|
|
static int w_uac_reg_lookup(struct sip_msg* msg, char* src, char* dst);
|
|
|
static int w_uac_reg_status(struct sip_msg* msg, char* src, char* dst);
|
|
|
static int w_uac_reg_request_to(struct sip_msg* msg, char* src, char* mode_s);
|
|
@@ -132,6 +133,8 @@ static cmd_export_t cmds[]={
|
|
|
REQUEST_ROUTE | BRANCH_ROUTE },
|
|
|
{"uac_restore_to", (cmd_function)w_restore_to, 0, 0, 0, REQUEST_ROUTE },
|
|
|
{"uac_auth", (cmd_function)w_uac_auth, 0, 0, 0, FAILURE_ROUTE },
|
|
|
+ {"uac_auth_mode", (cmd_function)w_uac_auth_mode, 1,
|
|
|
+ fixup_igp_null, fixup_free_igp_null, FAILURE_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_spve_pvar,
|
|
|
fixup_free_spve_pvar, ANY_ROUTE },
|
|
@@ -615,6 +618,22 @@ static int ki_uac_auth(struct sip_msg* msg)
|
|
|
return (uac_auth(msg)==0)?1:-1;
|
|
|
}
|
|
|
|
|
|
+static int w_uac_auth_mode(struct sip_msg* msg, char* pmode, char* str2)
|
|
|
+{
|
|
|
+ int imode = 0;
|
|
|
+
|
|
|
+ if(fixup_get_ivalue(msg, (gparam_t*)pmode, &imode)<0) {
|
|
|
+ LM_ERR("failed to get the mode parameter\n");
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ return (uac_auth_mode(msg, imode)==0)?1:-1;
|
|
|
+}
|
|
|
+
|
|
|
+static int ki_uac_auth_mode(sip_msg_t* msg, int mode)
|
|
|
+{
|
|
|
+ return (uac_auth_mode(msg, mode)==0)?1:-1;
|
|
|
+}
|
|
|
+
|
|
|
static int w_uac_reg_lookup(struct sip_msg* msg, char* src, char* dst)
|
|
|
{
|
|
|
pv_spec_t *dpv;
|
|
@@ -757,6 +776,11 @@ static sr_kemi_t sr_kemi_uac_exports[] = {
|
|
|
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
|
|
|
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
|
|
|
},
|
|
|
+ { str_init("uac"), str_init("uac_auth_mode"),
|
|
|
+ SR_KEMIP_INT, ki_uac_auth_mode,
|
|
|
+ { SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
|
|
|
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
|
|
|
+ },
|
|
|
{ str_init("uac"), str_init("uac_req_send"),
|
|
|
SR_KEMIP_INT, ki_uac_req_send,
|
|
|
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
|