|
@@ -74,6 +74,8 @@ static int w_t_is_branch_route(sip_msg_t* msg, char*, char* );
|
|
|
static int w_t_is_reply_route(sip_msg_t* msg, char*, char*);
|
|
|
static int w_t_is_request_route(sip_msg_t* msg, char*, char*);
|
|
|
|
|
|
+static int w_t_drop0(sip_msg_t* msg, char*, char*);
|
|
|
+static int w_t_drop1(sip_msg_t* msg, char*, char*);
|
|
|
static int w_t_suspend(sip_msg_t* msg, char*, char*);
|
|
|
static int w_t_continue(sip_msg_t* msg, char *idx, char *lbl, char *rtn);
|
|
|
static int w_t_reuse_branch(sip_msg_t* msg, char*, char*);
|
|
@@ -198,6 +200,8 @@ static cmd_export_t cmds[]={
|
|
|
REQUEST_ROUTE },
|
|
|
{"bind_tmx", (cmd_function)bind_tmx, 1,
|
|
|
0, 0, ANY_ROUTE },
|
|
|
+ {"t_drop", (cmd_function)w_t_drop0, 0, 0, 0, ANY_ROUTE},
|
|
|
+ {"t_drop", (cmd_function)w_t_drop1, 1, fixup_igp_null, 0, ANY_ROUTE},
|
|
|
{0,0,0,0,0,0}
|
|
|
};
|
|
|
|
|
@@ -697,6 +701,43 @@ static int t_is_request_route(sip_msg_t* msg)
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ *
|
|
|
+ */
|
|
|
+static int w_t_drop1(sip_msg_t* msg, char *p1, char *p2)
|
|
|
+{
|
|
|
+ tm_cell_t *t = 0;
|
|
|
+ unsigned int uas_status = 500;
|
|
|
+
|
|
|
+ if(p1) {
|
|
|
+ if(fixup_get_ivalue(msg, (gparam_p)p1, (int*)&uas_status)<0)
|
|
|
+ {
|
|
|
+ uas_status = 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ t=_tmx_tmb.t_gett();
|
|
|
+ if (t==NULL || t==T_UNDEFINED) {
|
|
|
+ LM_ERR("no transaction\n");
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ t->uas.status = uas_status;
|
|
|
+ if(t_is_request_route(msg) == 1) {
|
|
|
+ _tmx_tmb.t_release(msg);
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ */
|
|
|
+static int w_t_drop0(sip_msg_t* msg, char *p1, char *p2)
|
|
|
+{
|
|
|
+ return w_t_drop1(msg, NULL, NULL);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
*/
|