Skip to content

Commit

Permalink
keepalive: typos
Browse files Browse the repository at this point in the history
  • Loading branch information
dilyanpalauzov authored and miconda committed Apr 25, 2023
1 parent 67a01aa commit e7c8dcb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions src/modules/keepalive/doc/keepalive_admin.xml
Expand Up @@ -96,7 +96,7 @@ modparam("keepalive", "destination", "sip.provider.com")
<section>
<title><varname>delete_counter</varname>(int)</title>
<para>
Unsuccessful attemps increase delete_counter. After passing it, keepalive module doesn't try to send options requests. Ignored if it's set to 0.
Unsuccessful attempts increase delete_counter. After passing it, keepalive module doesn't try to send options requests. Ignored if it's set to 0.
</para>
<para>
<emphasis>
Expand Down Expand Up @@ -143,7 +143,7 @@ modparam("keepalive", "ping_from", "sip:keepalive@kamailio.org")
Get destination status.
</para>
<para>
The Parameter <emphasis>destination</emphasis> is destination you want to check status
The parameter <emphasis>destination</emphasis> is destination you want to check status
</para>
<para>
Returned value:
Expand Down Expand Up @@ -179,10 +179,10 @@ if(ka_is_alive("192.168.10.20") == 1) {
<itemizedlist>
<listitem>sip_uri (string) - address of destination to monitor.
Valid format is [protoschema:]ip[:port], with: 'protoschema' being
one of 'sip' or 'sips' (SIP over TLS) - if omitted, 'sip'is used
one of 'sip' or 'sips' (SIP over TLS) - if omitted, 'sip' is used
by default; 'port' is optional (using default standard port 5060
for sip and 5061 for sips)</listitem>
<listitem>owner (string) - module name owning the destination
<listitem>owner (string) - module name <quote>owning</quote> the destination
(for informational purpose)</listitem>
</itemizedlist>
</para>
Expand Down Expand Up @@ -221,10 +221,10 @@ ka_add_destination("sip:192.168.1.10:5060;transport=tcp", "config");
<itemizedlist>
<listitem>sip_uri (string) - address of monitored destination.
Valid format is [protoschema:]ip[:port], with: 'protoschema' being
one of 'sip' or 'sips' (SIP over TLS) - if omitted, 'sip'is used
one of 'sip' or 'sips' (SIP over TLS) - if omitted, 'sip' is used
by default; 'port' is optional (using default standard port 5060
for sip and 5061 for sips)</listitem>
<listitem>owner (string) - module name owning the destination
<listitem>owner (string) - module name <quote>owning</quote> the destination
(for informational purpose)</listitem>
</itemizedlist>
</para>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/keepalive/keepalive.h
Expand Up @@ -74,7 +74,7 @@ typedef struct _ka_dest
int flags;
int state;
time_t last_checked, last_up, last_down;
int counter; // counts unreachable attemps
int counter; // counts unreachable attempts
ticks_t ping_interval; /*!< Actual interval between OPTIONS */

void *user_attr;
Expand Down
30 changes: 15 additions & 15 deletions src/modules/keepalive/keepalive_rpc.c
Expand Up @@ -99,26 +99,26 @@ static void keepalive_rpc_list(rpc_t *rpc, void *ctx)

static void keepalive_rpc_add(rpc_t *rpc, void *ctx)
{
str sip_adress = {0,0};
str sip_address = {0,0};
str table_name ={0,0};
int ret = 0;

ret = rpc->scan(ctx, "SS",&sip_adress,&table_name);
ret = rpc->scan(ctx, "SS",&sip_address,&table_name);

if (ret < 2) {
LM_ERR("not enough parameters - read so far: %d\n", ret);
rpc->fault(ctx, 500, "Not enough parameters or wrong format");
return;
}

LM_DBG("keepalive add [%.*s]\n", sip_adress.len, sip_adress.s);
if(sip_adress.len<1 || table_name.len <1){
LM_DBG("keepalive add [%.*s]\n", sip_address.len, sip_address.s);
if(sip_address.len<1 || table_name.len <1){
LM_ERR("parameter is len less than 1 \n" );
rpc->fault(ctx, 500, "parameter is len less than 1");
return;
}

if(ka_add_dest(&sip_adress,&table_name,0,ka_ping_interval,0,0,0) < 0 ){
if(ka_add_dest(&sip_address,&table_name,0,ka_ping_interval,0,0,0) < 0 ){
LM_ERR("couldn't add data to list \n" );
rpc->fault(ctx, 500, "couldn't add data to list");
return;
Expand All @@ -131,27 +131,27 @@ static const char *keepalive_rpc_add_doc[2] = {

static void keepalive_rpc_del(rpc_t *rpc, void *ctx)
{
str sip_adress = {0,0};
str sip_address = {0,0};
str table_name ={0,0};
int ret = 0;

ret = rpc->scan(ctx, "SS",&sip_adress,&table_name);
ret = rpc->scan(ctx, "SS",&sip_address,&table_name);

if (ret < 2) {
LM_ERR("not enough parameters - read so far: %d\n", ret);
rpc->fault(ctx, 500, "Not enough parameters or wrong format");
return;
}

LM_DBG("keepalive delete [%.*s]\n", sip_adress.len, sip_adress.s);
LM_DBG("keepalive delete [%.*s]\n", sip_address.len, sip_address.s);

if(sip_adress.len < 1 || table_name.len < 1){
if(sip_address.len < 1 || table_name.len < 1){
LM_ERR("parameter is len less than 1 \n");
rpc->fault(ctx, 500, "parameter is len less than 1");
return;
}

if(ka_del_destination(&sip_adress,&table_name) < 0 ){
if(ka_del_destination(&sip_address,&table_name) < 0 ){
LM_ERR("couldn't delete data from list \n" );
rpc->fault(ctx, 500, "couldn't delete data from list");
return;
Expand All @@ -164,30 +164,30 @@ static const char *keepalive_rpc_del_doc[2] = {

static void keepalive_rpc_get(rpc_t *rpc, void *ctx)
{
str sip_adress = {0,0};
str sip_address = {0,0};
str table_name ={0,0};
int ret = 0;
ka_dest_t *target=0 , *head =0;
void *sub;

ret = rpc->scan(ctx, "SS",&sip_adress,&table_name);
ret = rpc->scan(ctx, "SS",&sip_address,&table_name);

if (ret < 2) {
LM_ERR("not enough parameters - read so far: %d\n", ret);
rpc->fault(ctx, 500, "Not enough parameters or wrong format");
return;
}

LM_DBG("keepalive get [%.*s]\n", sip_adress.len , sip_adress.s);
LM_DBG("keepalive get [%.*s]\n", sip_address.len , sip_address.s);

if(sip_adress.len < 1 || table_name.len < 1){
if(sip_address.len < 1 || table_name.len < 1){
LM_ERR("parameter is len less than 1 \n");
rpc->fault(ctx, 500, "parameter is len less than 1");
return;
}
ka_lock_destination_list();

if(ka_find_destination(&sip_adress, &table_name, &target, &head) < 0 ){
if(ka_find_destination(&sip_address, &table_name, &target, &head) < 0 ){
LM_ERR("couldn't get data from list \n" );
rpc->fault(ctx, 500, "couldn't get data from list");
ka_unlock_destination_list();
Expand Down

0 comments on commit e7c8dcb

Please sign in to comment.