Skip to content

Commit

Permalink
tsilo: add new return code to ts_append and document it
Browse files Browse the repository at this point in the history
  • Loading branch information
grumvalski committed Oct 13, 2022
1 parent aec01a7 commit ef2ea73
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
30 changes: 29 additions & 1 deletion src/modules/tsilo/doc/tsilo_admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
...
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions src/modules/tsilo/ts_append.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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 */
Expand Down

0 comments on commit ef2ea73

Please sign in to comment.