Skip to content

Commit

Permalink
Use as OBP the first PATH URI.
Browse files Browse the repository at this point in the history
If PATH defined, when injecting a new branch, extract the first PATH URI and use it as destination.
Reported by @futsystems in #1235
Fix for problem 1.

(cherry picked from commit f789264)
  • Loading branch information
bogdan-iancu committed Dec 20, 2017
1 parent b2ce0c2 commit a6ee576
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions modules/tm/t_fwd.c
Expand Up @@ -854,6 +854,7 @@ static int ul_contact_event_to_msg(struct sip_msg *req)
int_str vals[UL_MAX];
int proto, port;
str host;
str path_dst;

if (avp_ids[0]==-1) {
/* init the avp IDs mapping us on the UL event */
Expand Down Expand Up @@ -892,20 +893,28 @@ static int ul_contact_event_to_msg(struct sip_msg *req)
return -1;
}

/* contact RECEIVED goes as DURI */
if (vals[UL_RECEIVED].s.len) {
if (set_dst_uri( req, &vals[UL_RECEIVED].s)<0) {
LM_ERR("failed to set DST URI\n");
/* contact PATH goes as path */
if (vals[UL_PATH].s.len) {
if (get_path_dst_uri(&vals[UL_PATH].s, &path_dst) < 0) {
LM_ERR("failed to get dst_uri for Path\n");
return -1;
}
if (set_dst_uri( req, &path_dst) < 0) {
LM_ERR("failed to set dst_uri of Path\n");
return -1;
}
}

/* contact PATH goes as path */
if (vals[UL_PATH].s.len) {
if (set_path_vector( req, &vals[UL_PATH].s)<0) {
LM_ERR("failed to set PATH\n");
return -1;
}
} else
/* contact RECEIVED goes as DURI */
if (vals[UL_RECEIVED].s.len) {
if (set_dst_uri( req, &vals[UL_RECEIVED].s)<0) {
LM_ERR("failed to set DST URI\n");
return -1;
}
}

/* contact Qval goes as RURI Qval */
Expand Down

0 comments on commit a6ee576

Please sign in to comment.