Skip to content

Commit

Permalink
b2b_entities: fix tags parsing from request
Browse files Browse the repository at this point in the history
Fix bug introduced in 5e5fc98
  • Loading branch information
razvancrainea committed Jun 30, 2021
1 parent e7beec2 commit 9e29b54
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/b2b_entities/dlg.c
Expand Up @@ -2639,8 +2639,10 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps)
from_tag = ((struct to_body*)msg->from->parsed)->tag_value;
} else if (ps->req) {
if (!(struct to_body*)ps->req->from->parsed) {
if (!parse_to(ps->req->from->body.s,
ps->req->from->body.s, &from_hdr_parsed)) {
parse_to(ps->req->from->body.s,
ps->req->from->body.s + ps->req->from->body.len + 1,
&from_hdr_parsed);
if (from_hdr_parsed.error == PARSE_ERROR) {
from_tag.s = NULL;
from_tag.len = 0;
} else {
Expand All @@ -2651,8 +2653,10 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps)
from_tag = ((struct to_body*)ps->req->from->parsed)->tag_value;
}
if (!(struct to_body*)ps->req->to->parsed) {
if (!parse_to(ps->req->to->body.s,
ps->req->to->body.s, &to_hdr_parsed)) {
parse_to(ps->req->to->body.s,
ps->req->to->body.s + ps->req->to->body.len + 1,
&to_hdr_parsed);
if (to_hdr_parsed.error == PARSE_ERROR) {
to_tag.s = NULL;
to_tag.len = 0;
} else {
Expand All @@ -2662,7 +2666,6 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps)
} else {
to_tag = ((struct to_body*)ps->req->to->parsed)->tag_value;
}
to_tag = ((struct to_body*)ps->req->to->parsed)->tag_value;
callid = ps->req->callid->body;
} else {
to_tag.s = NULL;
Expand Down

0 comments on commit 9e29b54

Please sign in to comment.