|
@@ -1488,6 +1488,7 @@ static int ki_set_max_credit(sip_msg_t *msg, str *sclient, str *scredit,
|
|
{
|
|
{
|
|
credit_data_t *credit_data = NULL;
|
|
credit_data_t *credit_data = NULL;
|
|
call_t *call = NULL;
|
|
call_t *call = NULL;
|
|
|
|
+ hash_tables_t *hts = NULL;
|
|
|
|
|
|
double credit = 0, connect_cost = 0, cost_per_second = 0;
|
|
double credit = 0, connect_cost = 0, cost_per_second = 0;
|
|
|
|
|
|
@@ -1529,6 +1530,12 @@ static int ki_set_max_credit(sip_msg_t *msg, str *sclient, str *scredit,
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(try_get_call_entry(&msg->callid->body, &call, &hts) == 0) {
|
|
|
|
+ LM_ERR("call-id[%.*s] already present\n",
|
|
|
|
+ msg->callid->body.len, msg->callid->body.s);
|
|
|
|
+ return -4;
|
|
|
|
+ }
|
|
|
|
+
|
|
LM_DBG("Setting up new call for client [%.*s], max-credit[%f], "
|
|
LM_DBG("Setting up new call for client [%.*s], max-credit[%f], "
|
|
"connect-cost[%f], cost-per-sec[%f], initial-pulse [%d], "
|
|
"connect-cost[%f], cost-per-sec[%f], initial-pulse [%d], "
|
|
"final-pulse [%d], call-id[%.*s]\n",
|
|
"final-pulse [%d], call-id[%.*s]\n",
|
|
@@ -1706,6 +1713,7 @@ static int ki_set_max_channels(sip_msg_t *msg, str *sclient, int max_chan)
|
|
{
|
|
{
|
|
credit_data_t *credit_data = NULL;
|
|
credit_data_t *credit_data = NULL;
|
|
call_t *call = NULL;
|
|
call_t *call = NULL;
|
|
|
|
+ hash_tables_t *hts = NULL;
|
|
|
|
|
|
if(parse_headers(msg, HDR_CALLID_F, 0) != 0) {
|
|
if(parse_headers(msg, HDR_CALLID_F, 0) != 0) {
|
|
LM_ERR("Error parsing Call-ID");
|
|
LM_ERR("Error parsing Call-ID");
|
|
@@ -1736,6 +1744,12 @@ static int ki_set_max_channels(sip_msg_t *msg, str *sclient, int max_chan)
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(try_get_call_entry(&msg->callid->body, &call, &hts) == 0) {
|
|
|
|
+ LM_ERR("call-id[%.*s] already present\n",
|
|
|
|
+ msg->callid->body.len, msg->callid->body.s);
|
|
|
|
+ return -4;
|
|
|
|
+ }
|
|
|
|
+
|
|
LM_DBG("Setting up new call for client [%.*s], max-chan[%d], "
|
|
LM_DBG("Setting up new call for client [%.*s], max-chan[%d], "
|
|
"call-id[%.*s]\n",
|
|
"call-id[%.*s]\n",
|
|
sclient->len, sclient->s, max_chan, msg->callid->body.len,
|
|
sclient->len, sclient->s, max_chan, msg->callid->body.len,
|
|
@@ -1792,6 +1806,7 @@ static int ki_set_max_time(sip_msg_t *msg, str *sclient, int max_secs)
|
|
{
|
|
{
|
|
credit_data_t *credit_data = NULL;
|
|
credit_data_t *credit_data = NULL;
|
|
call_t *call = NULL;
|
|
call_t *call = NULL;
|
|
|
|
+ hash_tables_t *hts = NULL;
|
|
|
|
|
|
if(parse_headers(msg, HDR_CALLID_F, 0) != 0) {
|
|
if(parse_headers(msg, HDR_CALLID_F, 0) != 0) {
|
|
LM_ERR("Error parsing Call-ID");
|
|
LM_ERR("Error parsing Call-ID");
|
|
@@ -1823,6 +1838,12 @@ static int ki_set_max_time(sip_msg_t *msg, str *sclient, int max_secs)
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(try_get_call_entry(&msg->callid->body, &call, &hts) == 0) {
|
|
|
|
+ LM_ERR("call-id[%.*s] already present\n",
|
|
|
|
+ msg->callid->body.len, msg->callid->body.s);
|
|
|
|
+ return -4;
|
|
|
|
+ }
|
|
|
|
+
|
|
LM_DBG("Setting up new call for client [%.*s], max-secs[%d], "
|
|
LM_DBG("Setting up new call for client [%.*s], max-secs[%d], "
|
|
"call-id[%.*s]\n",
|
|
"call-id[%.*s]\n",
|
|
sclient->len, sclient->s, max_secs, msg->callid->body.len,
|
|
sclient->len, sclient->s, max_secs, msg->callid->body.len,
|