|
@@ -426,8 +426,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
}
|
|
|
|
|
|
if (ret<0) {
|
|
|
- LOG(L_ERR, "ERROR: do_action: forward: bad_uri "
|
|
|
- " dropping packet\n");
|
|
|
+ LM_ERR("forward: bad_uri dropping packet\n");
|
|
|
goto error;
|
|
|
}
|
|
|
|
|
@@ -439,8 +438,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
port=a->val[1].u.number;
|
|
|
break;
|
|
|
default:
|
|
|
- LOG(L_CRIT, "BUG: do_action bad forward 2nd"
|
|
|
- " param type (%d)\n", a->val[1].type);
|
|
|
+ LM_CRIT("bad forward 2nd param type (%d)\n", a->val[1].type);
|
|
|
ret=E_UNSPEC;
|
|
|
goto error_fwd_uri;
|
|
|
}
|
|
@@ -466,16 +464,14 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
dst.proto=u->proto;
|
|
|
break;
|
|
|
default:
|
|
|
- LOG(L_ERR,"ERROR: do action: forward: bad uri"
|
|
|
- " transport %d\n", u->proto);
|
|
|
+ LM_ERR("forward: bad uri transport %d\n", u->proto);
|
|
|
ret=E_BAD_PROTO;
|
|
|
goto error_fwd_uri;
|
|
|
}
|
|
|
#ifdef USE_TLS
|
|
|
if (u->type==SIPS_URI_T){
|
|
|
if (u->proto==PROTO_UDP){
|
|
|
- LOG(L_ERR, "ERROR: do_action: forward: secure uri"
|
|
|
- " incompatible with transport %d\n",
|
|
|
+ LM_ERR("forward: secure uri incompatible with transport %d\n",
|
|
|
u->proto);
|
|
|
ret=E_BAD_PROTO;
|
|
|
goto error_fwd_uri;
|
|
@@ -512,7 +508,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
proxy_mark((struct proxy_l*)a->val[0].u.data, ret);
|
|
|
}
|
|
|
}else{
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad forward() types %d, %d\n",
|
|
|
+ LM_CRIT("bad forward() types %d, %d\n",
|
|
|
a->val[0].type, a->val[1].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
@@ -520,7 +516,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
break;
|
|
|
case LOG_T:
|
|
|
if ((a->val[0].type!=NUMBER_ST)|(a->val[1].type!=STRING_ST)){
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad log() types %d, %d\n",
|
|
|
+ LM_CRIT("bad log() types %d, %d\n",
|
|
|
a->val[0].type, a->val[1].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
@@ -533,8 +529,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
/* jku -- introduce a new branch */
|
|
|
case APPEND_BRANCH_T:
|
|
|
if (unlikely(a->val[0].type!=STR_ST)) {
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad append_branch_t %d\n",
|
|
|
- a->val[0].type );
|
|
|
+ LM_CRIT("bad append_branch_t %d\n", a->val[0].type );
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
@@ -568,8 +563,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
/* jku begin: is_length_greater_than */
|
|
|
case LEN_GT_T:
|
|
|
if (a->val[0].type!=NUMBER_ST) {
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad len_gt type %d\n",
|
|
|
- a->val[0].type );
|
|
|
+ LM_CRIT("bad len_gt type %d\n", a->val[0].type );
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
@@ -583,8 +577,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
|
|
|
case SETFLAG_T:
|
|
|
if (a->val[0].type!=NUMBER_ST) {
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad setflag() type %d\n",
|
|
|
- a->val[0].type );
|
|
|
+ LM_CRIT("bad setflag() type %d\n", a->val[0].type );
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
@@ -598,8 +591,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
|
|
|
case RESETFLAG_T:
|
|
|
if (a->val[0].type!=NUMBER_ST) {
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad resetflag() type %d\n",
|
|
|
- a->val[0].type );
|
|
|
+ LM_CRIT("bad resetflag() type %d\n", a->val[0].type );
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
@@ -613,8 +605,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
|
|
|
case ISFLAGSET_T:
|
|
|
if (a->val[0].type!=NUMBER_ST) {
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad isflagset() type %d\n",
|
|
|
- a->val[0].type );
|
|
|
+ LM_CRIT("bad isflagset() type %d\n", a->val[0].type );
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
@@ -670,12 +661,11 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
break;
|
|
|
case ERROR_T:
|
|
|
if ((a->val[0].type!=STRING_ST)|(a->val[1].type!=STRING_ST)){
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad error() types %d, %d\n",
|
|
|
- a->val[0].type, a->val[1].type);
|
|
|
+ LM_CRIT("bad error() types %d, %d\n", a->val[0].type, a->val[1].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
|
- LOG(L_NOTICE, "WARNING: do_action: error(\"%s\", \"%s\") "
|
|
|
+ LM_NOTICE("error(\"%s\", \"%s\") "
|
|
|
"not implemented yet\n", a->val[0].u.string, a->val[1].u.string);
|
|
|
ret=1;
|
|
|
break;
|
|
@@ -707,13 +697,12 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
rval_cache_clean(&c1);
|
|
|
s.s = 0;
|
|
|
} else {
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad route() type %d\n",
|
|
|
- a->val[0].type);
|
|
|
+ LM_CRIT("bad route() type %d\n", a->val[0].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
|
if (unlikely((i>=main_rt.idx)||(i<0))){
|
|
|
- LOG(L_ERR, "ERROR: invalid routing table number in"
|
|
|
+ LM_ERR("invalid routing table number in"
|
|
|
"route(%lu) at %s:%d\n", a->val[0].u.number,
|
|
|
(a->cfile)?a->cfile:"line", a->cline);
|
|
|
ret=E_CFG;
|
|
@@ -727,16 +716,15 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
break;
|
|
|
case EXEC_T:
|
|
|
if (a->val[0].type!=STRING_ST){
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad exec() type %d\n",
|
|
|
- a->val[0].type);
|
|
|
+ LM_CRIT("bad exec() type %d\n", a->val[0].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
|
- LOG(L_NOTICE, "WARNING: exec(\"%s\") not fully implemented,"
|
|
|
+ LM_NOTICE("exec(\"%s\") not fully implemented,"
|
|
|
" using dumb version...\n", a->val[0].u.string);
|
|
|
ret=system(a->val[0].u.string);
|
|
|
if (ret!=0){
|
|
|
- LOG(L_NOTICE, "WARNING: exec() returned %d\n", ret);
|
|
|
+ LM_NOTICE("exec() returned %d\n", ret);
|
|
|
}
|
|
|
ret=1;
|
|
|
break;
|
|
@@ -765,15 +753,13 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
user=0;
|
|
|
if (a->type==STRIP_T || a->type==STRIP_TAIL_T) {
|
|
|
if (a->val[0].type!=NUMBER_ST) {
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad set*() type %d\n",
|
|
|
- a->val[0].type);
|
|
|
+ LM_CRIT("bad set*() type %d\n", a->val[0].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
|
} else if (a->type!=SET_USERPHONE_T) {
|
|
|
if (a->val[0].type!=STRING_ST) {
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad set*() type %d\n",
|
|
|
- a->val[0].type);
|
|
|
+ LM_CRIT("bad set*() type %d\n", a->val[0].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
@@ -787,8 +773,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
len=strlen(a->val[0].u.string);
|
|
|
msg->new_uri.s=pkg_malloc(len+1);
|
|
|
if (msg->new_uri.s==0){
|
|
|
- LOG(L_ERR, "ERROR: do_action: memory allocation"
|
|
|
- " failure\n");
|
|
|
+ LM_ERR("memory allocation failure\n");
|
|
|
ret=E_OUT_OF_MEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -809,8 +794,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
len=msg->first_line.u.request.uri.len;
|
|
|
}
|
|
|
if (parse_uri(tmp, len, &uri)<0){
|
|
|
- LOG(L_ERR, "ERROR: do_action: bad uri <%s>, dropping"
|
|
|
- " packet\n", tmp);
|
|
|
+ LM_ERR("bad uri <%s>, dropping packet\n", tmp);
|
|
|
ret=E_UNSPEC;
|
|
|
goto error;
|
|
|
}
|
|
@@ -832,15 +816,14 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
&& ((uri.type==TEL_URI_T) || (uri.type==TELS_URI_T))
|
|
|
&& ((uri.flags & URI_SIP_USER_PHONE)==0)
|
|
|
) {
|
|
|
- LOG(L_ERR, "ERROR: do_action: port number of a tel: URI cannot be set\n");
|
|
|
+ LM_ERR("port number of a tel: URI cannot be set\n");
|
|
|
ret=E_UNSPEC;
|
|
|
goto error;
|
|
|
}
|
|
|
|
|
|
new_uri=pkg_malloc(MAX_URI_SIZE);
|
|
|
if (new_uri==0){
|
|
|
- LOG(L_ERR, "ERROR: do_action: memory allocation "
|
|
|
- " failure\n");
|
|
|
+ LM_ERR("memory allocation failure\n");
|
|
|
ret=E_OUT_OF_MEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -889,8 +872,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
- LOG(L_ERR, "ERROR: Unsupported URI scheme (%d), "
|
|
|
- "reverted to sip:\n",
|
|
|
+ LM_ERR("Unsupported URI scheme (%d), reverted to sip:\n",
|
|
|
uri.type);
|
|
|
len=s_sip.len;
|
|
|
tmp=s_sip.s;
|
|
@@ -916,8 +898,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
len=strlen(tmp);
|
|
|
} else if (a->type==STRIP_T) {
|
|
|
if (a->val[0].u.number>uri.user.len) {
|
|
|
- LOG(L_WARN, "Error: too long strip asked; "
|
|
|
- " deleting username: %lu of <%.*s>\n",
|
|
|
+ LM_WARN("too long strip asked; deleting username: %lu of <%.*s>\n",
|
|
|
a->val[0].u.number, uri.user.len, uri.user.s );
|
|
|
len=0;
|
|
|
} else if (a->val[0].u.number==uri.user.len) {
|
|
@@ -928,7 +909,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
}
|
|
|
} else if (a->type==STRIP_TAIL_T) {
|
|
|
if (a->val[0].u.number>uri.user.len) {
|
|
|
- LOG(L_WARN, "WARNING: too long strip_tail asked; "
|
|
|
+ LM_WARN("too long strip_tail asked; "
|
|
|
" deleting username: %lu of <%.*s>\n",
|
|
|
a->val[0].u.number, uri.user.len, uri.user.s );
|
|
|
len=0;
|
|
@@ -1396,8 +1377,7 @@ match_cleanup:
|
|
|
i++;
|
|
|
|
|
|
if (unlikely(i > cfg_get(core, core_cfg, max_while_loops))){
|
|
|
- LOG(L_ERR, "ERROR: runaway while (%d, %d): more then"
|
|
|
- " %d loops\n",
|
|
|
+ LM_ERR("runaway while (%d, %d): more then %d loops\n",
|
|
|
rve->fpos.s_line, rve->fpos.s_col,
|
|
|
cfg_get(core, core_cfg, max_while_loops));
|
|
|
ret=-1;
|
|
@@ -1425,8 +1405,7 @@ match_cleanup:
|
|
|
break;
|
|
|
case SET_ADV_ADDR_T:
|
|
|
if (a->val[0].type!=STR_ST){
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad set_advertised_address() "
|
|
|
- "type %d\n", a->val[0].type);
|
|
|
+ LM_CRIT("bad set_advertised_address() type %d\n", a->val[0].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
@@ -1435,8 +1414,7 @@ match_cleanup:
|
|
|
break;
|
|
|
case SET_ADV_PORT_T:
|
|
|
if (a->val[0].type!=STR_ST){
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad set_advertised_port() "
|
|
|
- "type %d\n", a->val[0].type);
|
|
|
+ LM_CRIT("bad set_advertised_port() type %d\n", a->val[0].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
|
}
|
|
@@ -1454,7 +1432,7 @@ match_cleanup:
|
|
|
if (a->val[0].type==NOSUBTYPE) port=msg->via1->port;
|
|
|
else if (a->val[0].type==NUMBER_ST) port=(int)a->val[0].u.number;
|
|
|
else{
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad force_tcp_alias"
|
|
|
+ LM_CRIT("bad force_tcp_alias"
|
|
|
" port type %d\n", a->val[0].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
@@ -1462,7 +1440,7 @@ match_cleanup:
|
|
|
|
|
|
if (tcpconn_add_alias(msg->rcv.proto_reserved1, port,
|
|
|
msg->rcv.proto)!=0){
|
|
|
- LOG(L_ERR, " ERROR: receive_msg: tcp alias failed\n");
|
|
|
+ LM_ERR("receive_msg: tcp alias failed\n");
|
|
|
ret=E_UNSPEC;
|
|
|
goto error;
|
|
|
}
|
|
@@ -1472,7 +1450,7 @@ match_cleanup:
|
|
|
break;
|
|
|
case FORCE_SEND_SOCKET_T:
|
|
|
if (a->val[0].type!=SOCKETINFO_ST){
|
|
|
- LOG(L_CRIT, "BUG: do_action: bad force_send_socket argument"
|
|
|
+ LM_CRIT("bad force_send_socket argument"
|
|
|
" type: %d\n", a->val[0].type);
|
|
|
ret=E_BUG;
|
|
|
goto error;
|
|
@@ -1544,14 +1522,14 @@ match_cleanup:
|
|
|
break;
|
|
|
/*
|
|
|
default:
|
|
|
- LOG(L_CRIT, "BUG: do_action: unknown type %d\n", a->type);
|
|
|
+ LM_CRIT("unknown type %d\n", a->type);
|
|
|
*/
|
|
|
}
|
|
|
skip:
|
|
|
return ret;
|
|
|
|
|
|
error_uri:
|
|
|
- LOG(L_ERR, "ERROR: do_action: set*: uri too long\n");
|
|
|
+ LM_ERR("set*: uri too long\n");
|
|
|
if (new_uri) pkg_free(new_uri);
|
|
|
LM_ERR("run action error at: %s:%d\n", (a->cfile)?a->cfile:"", a->cline);
|
|
|
return E_UNSPEC;
|
|
@@ -1576,8 +1554,7 @@ int run_actions(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
ret=E_UNSPEC;
|
|
|
h->rec_lev++;
|
|
|
if (unlikely(h->rec_lev>max_recursive_level)){
|
|
|
- LOG(L_ERR, "WARNING: too many recursive routing table lookups (%d)"
|
|
|
- " giving up!\n", h->rec_lev);
|
|
|
+ LM_ERR("too many recursive routing table lookups (%d) giving up!\n", h->rec_lev);
|
|
|
ret=E_UNSPEC;
|
|
|
goto error;
|
|
|
}
|
|
@@ -1595,8 +1572,7 @@ int run_actions(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
|
|
|
}
|
|
|
|
|
|
if (unlikely(a==0)){
|
|
|
- DBG("DEBUG: run_actions: null action list (rec_level=%d)\n",
|
|
|
- h->rec_lev);
|
|
|
+ DBG("DEBUG: run_actions: null action list (rec_level=%d)\n", h->rec_lev);
|
|
|
ret=1;
|
|
|
}
|
|
|
|