Module: sip-router Branch: pd/outbound Commit: 8f0ab9130af20ed1709b03fff8e831695cbdc64f URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8f0ab913...
Author: Peter Dunkley peter.dunkley@crocodile-rcs.com Committer: Peter Dunkley peter.dunkley@crocodile-rcs.com Date: Fri Dec 28 08:03:50 2012 +0000
modules_k/path: only add ";ob" parameter when it is the the first hop
---
modules_k/path/path.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/modules_k/path/path.c b/modules_k/path/path.c index 2362066..b702ba4 100644 --- a/modules_k/path/path.c +++ b/modules_k/path/path.c @@ -199,6 +199,7 @@ int add_path(struct sip_msg* _msg, char* _a, char* _b) str user = {0,0}; int ret; path_param_t param = PATH_PARAM_NONE; + struct via_body *via;
if (path_obb.use_outbound != NULL && path_obb.use_outbound(_msg)) { @@ -206,7 +207,11 @@ int add_path(struct sip_msg* _msg, char* _a, char* _b) LM_ERR("encoding outbound flow token\n"); return -1; } - param = PATH_PARAM_OB; + + /* Only include ;ob parameter if this is the first-hop (that + means only one Via:) */ + if (parse_via_header(_msg, 2, &via) < 0) + param = PATH_PARAM_OB; }
ret = prepend_path(_msg, &user, param);