Skip to content

Commit

Permalink
tsilo: updated with the latest changes to registrar api
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Apr 24, 2016
1 parent c348d28 commit b293eb2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/tsilo/ts_append.c
Expand Up @@ -86,6 +86,7 @@ int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table, str *
struct cell *orig_t;
struct sip_msg *orig_msg;
int ret;
str stable;

orig_t = _tmb.t_gett();

Expand Down Expand Up @@ -113,25 +114,27 @@ int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table, str *

orig_msg = t->uas.request;

stable.s = table;
stable.len = strlen(stable.s);
if(uri==NULL || uri->s==NULL || uri->len<=0) {
ret = _regapi.lookup_to_dset(orig_msg, table, NULL);
ret = _regapi.lookup_to_dset(orig_msg, &stable, NULL);
} else {
ret = _regapi.lookup_to_dset(orig_msg, table, uri);
ret = _regapi.lookup_to_dset(orig_msg, &stable, uri);
}

if(ret != 1) {
LM_DBG("transaction %u:%u: error updating dset (%d)\n", tindex, tlabel, ret);
ret = -4;
goto done;
}

ret = _tmb.t_append_branches();

done:
/* unref the transaction which had been referred by t_lookup_ident() call.
/* unref the transaction which had been referred by t_lookup_ident() call.
* Restore the original transaction (if any) */
if(t) _tmb.unref_cell(t);
_tmb.t_sett(orig_t, T_BR_UNDEFINED);

return ret;
}

0 comments on commit b293eb2

Please sign in to comment.