|
@@ -635,7 +635,11 @@ int t_next_contacts(struct sip_msg* msg, char* key, char* value)
|
|
|
}
|
|
|
|
|
|
vavp = xavp_get(&flags_name, xavp->val.v.xavp);
|
|
|
- flags = vavp->val.v.i;
|
|
|
+ if (vavp != NULL) {
|
|
|
+ flags = vavp->val.v.i;
|
|
|
+ } else {
|
|
|
+ flags = 0;
|
|
|
+ }
|
|
|
|
|
|
vavp = xavp_get(&ruid_name, xavp->val.v.xavp);
|
|
|
if (vavp != NULL) {
|
|
@@ -762,8 +766,7 @@ int t_next_contact_flow(struct sip_msg* msg, char* key, char* value)
|
|
|
/* Load Request-URI and branches */
|
|
|
t_get_this_branch_instance(msg, &this_instance);
|
|
|
|
|
|
- if (this_instance.len == 0)
|
|
|
- {
|
|
|
+ if (this_instance.len == 0) {
|
|
|
LM_DBG("No instance on this branch\n");
|
|
|
return -2;
|
|
|
}
|
|
@@ -780,13 +783,10 @@ int t_next_contact_flow(struct sip_msg* msg, char* key, char* value)
|
|
|
next_xavp = xavp_get_next(xavp);
|
|
|
|
|
|
vavp = xavp_get(&instance_name, xavp->val.v.xavp);
|
|
|
- if (vavp == NULL)
|
|
|
- {
|
|
|
+ if (vavp == NULL) {
|
|
|
/* Does not match this instance */
|
|
|
goto next_xavp;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ } else {
|
|
|
instance = vavp->val.v.s;
|
|
|
if ((instance.len != this_instance.len) ||
|
|
|
(strncmp(instance.s, this_instance.s, instance.len) != 0))
|
|
@@ -795,7 +795,11 @@ int t_next_contact_flow(struct sip_msg* msg, char* key, char* value)
|
|
|
}
|
|
|
|
|
|
vavp = xavp_get(&uri_name, xavp->val.v.xavp);
|
|
|
- uri = vavp->val.v.s;
|
|
|
+ if (vavp == NULL) {
|
|
|
+ goto next_xavp;
|
|
|
+ } else {
|
|
|
+ uri = vavp->val.v.s;
|
|
|
+ }
|
|
|
|
|
|
vavp = xavp_get(&dst_uri_name, xavp->val.v.xavp);
|
|
|
if (vavp != NULL) {
|
|
@@ -830,13 +834,27 @@ int t_next_contact_flow(struct sip_msg* msg, char* key, char* value)
|
|
|
}
|
|
|
|
|
|
vavp = xavp_get(&flags_name, xavp->val.v.xavp);
|
|
|
- flags = vavp->val.v.i;
|
|
|
+ if (vavp != NULL) {
|
|
|
+ flags = vavp->val.v.i;
|
|
|
+ } else {
|
|
|
+ flags = 0;
|
|
|
+ }
|
|
|
|
|
|
vavp = xavp_get(&ruid_name, xavp->val.v.xavp);
|
|
|
- ruid = vavp->val.v.s;
|
|
|
+ if (vavp != NULL) {
|
|
|
+ ruid = vavp->val.v.s;
|
|
|
+ } else {
|
|
|
+ ruid.s = "";
|
|
|
+ ruid.len = 0;
|
|
|
+ }
|
|
|
|
|
|
vavp = xavp_get(&ua_name, xavp->val.v.xavp);
|
|
|
- location_ua = vavp->val.v.s;
|
|
|
+ if (vavp != NULL) {
|
|
|
+ location_ua = vavp->val.v.s;
|
|
|
+ } else {
|
|
|
+ location_ua.s = "";
|
|
|
+ location_ua.len = 0;
|
|
|
+ }
|
|
|
|
|
|
LM_DBG("Appending branch uri-'%.*s' dst-'%.*s' path-'%.*s'"
|
|
|
" inst-'%.*s' ruid-'%.*s' location_ua-'%.*s'\n",
|