Module: kamailio Branch: master Commit: ef2ea73f044a1421b25734d4773bd2dacaab1165 URL: https://github.com/kamailio/kamailio/commit/ef2ea73f044a1421b25734d4773bd2da...
Author: Federico Cabiddu federico.cabiddu@gmail.com Committer: Federico Cabiddu federico.cabiddu@gmail.com Date: 2022-10-13T15:42:56+02:00
tsilo: add new return code to ts_append and document it
---
Modified: src/modules/tsilo/doc/tsilo_admin.xml Modified: src/modules/tsilo/ts_append.c
---
Diff: https://github.com/kamailio/kamailio/commit/ef2ea73f044a1421b25734d4773bd2da... Patch: https://github.com/kamailio/kamailio/commit/ef2ea73f044a1421b25734d4773bd2da...
---
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")) { </para> </listitem> </itemizedlist> + <para>Return codes:</para> + <itemizedlist> + <listitem> + <para> + <emphasis>1</emphasis> - branches added. + </para> + <para> + <emphasis>-1</emphasis> - an internal error has produced (parsing error, memory error). + </para> + <para> + <emphasis>-2</emphasis> - no records found for the r-uri. + </para> + </listitem> + </itemizedlist> <para> This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. </para> @@ -223,6 +237,20 @@ if (is_method("REGISTER")) { </para> </listitem> </itemizedlist> + <para>Return codes:</para> + <itemizedlist> + <listitem> + <para> + <emphasis>1</emphasis> - branches added. + </para> + <para> + <emphasis>-1</emphasis> - an internal error has produced (parsing error, memory error). + </para> + <para> + <emphasis>-2</emphasis> - no records found for the r-uri. + </para> + </listitem> + </itemizedlist> <para> This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. </para> 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 */