From ef2ea73f044a1421b25734d4773bd2dacaab1165 Mon Sep 17 00:00:00 2001 From: Federico Cabiddu Date: Thu, 13 Oct 2022 15:42:56 +0200 Subject: [PATCH] tsilo: add new return code to ts_append and document it --- src/modules/tsilo/doc/tsilo_admin.xml | 30 ++++++++++++++++++++++++++- src/modules/tsilo/ts_append.c | 6 +++--- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/modules/tsilo/doc/tsilo_admin.xml b/src/modules/tsilo/doc/tsilo_admin.xml index 965c339156f..2a258ba15cb 100644 --- a/src/modules/tsilo/doc/tsilo_admin.xml +++ b/src/modules/tsilo/doc/tsilo_admin.xml @@ -139,7 +139,7 @@ modparam("tsilo", "use_domain", 1) if (is_method("INVITE")) { if (t_newtran()) { ts_store(); - # t_store("sip:alice@$td"); + # ts_store("sip:alice@$td"); } } ... @@ -170,6 +170,20 @@ if (is_method("INVITE")) { + Return codes: + + + + 1 - branches added. + + + -1 - an internal error has produced (parsing error, memory error). + + + -2 - no records found for the r-uri. + + + This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. @@ -223,6 +237,20 @@ if (is_method("REGISTER")) { + Return codes: + + + + 1 - branches added. + + + -1 - an internal error has produced (parsing error, memory error). + + + -2 - no records found for the r-uri. + + + This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. diff --git a/src/modules/tsilo/ts_append.c b/src/modules/tsilo/ts_append.c index fece9b40970..dd01b0a7d3a 100644 --- a/src/modules/tsilo/ts_append.c +++ b/src/modules/tsilo/ts_append.c @@ -61,7 +61,7 @@ int ts_append(struct sip_msg* msg, str *ruri, str *contact, char *table) { /* parse contact if given */ if(contact->s != NULL && contact->len != 0) { if (parse_uri(contact->s, contact->len, &c_uri) < 0) { - LM_ERR("failed to parse contact %.*s\n", ruri->len, ruri->s); + LM_ERR("failed to parse contact %.*s\n", contact->len, contact->s); return -1; } } @@ -72,9 +72,9 @@ int ts_append(struct sip_msg* msg, str *ruri, str *contact, char *table) { res = get_ts_urecord(t_uri, &_r); if (res != 0) { - LM_ERR("failed to retrieve record for %.*s\n", t_uri->len, t_uri->s); + LM_DBG("no record for %.*s\n", t_uri->len, t_uri->s); unlock_entry_by_ruri(t_uri); - return -1; + return -2; } /* cycle through existing transactions */