Module: kamailio Branch: master Commit: e5b3474ad450f2c11c4e49678e590ac2dccf47ac URL: https://github.com/kamailio/kamailio/commit/e5b3474ad450f2c11c4e49678e590ac2...
Author: Alex Hermann alex@hexla.nl Committer: Henning Westerholt henningw@users.noreply.github.com Date: 2019-02-11T21:42:26+01:00
core/dset: Add options field to print_dset()
Will be used later on to optionally enhance the contacts.
---
Modified: src/core/dset.c Modified: src/core/dset.h Modified: src/modules/pv/pv_core.c Modified: src/modules/sl/sl_funcs.c Modified: src/modules/tm/t_reply.c Modified: src/modules/xprint/xp_lib.c
---
Diff: https://github.com/kamailio/kamailio/commit/e5b3474ad450f2c11c4e49678e590ac2... Patch: https://github.com/kamailio/kamailio/commit/e5b3474ad450f2c11c4e49678e590ac2...
---
diff --git a/src/core/dset.c b/src/core/dset.c index 5af6252594..239a4f2ebc 100644 --- a/src/core/dset.c +++ b/src/core/dset.c @@ -472,7 +472,7 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path, * end = end of target buffer * Returns 0 on success or -1 on error (buffer is too short) */ -static int print_contact_str(char **dest, str *uri, qvalue_t q, char *end) +static int print_contact_str(char **dest, str *uri, qvalue_t q, char *end, int options) { char *p = *dest; str buf; @@ -507,7 +507,7 @@ static int print_contact_str(char **dest, str *uri, qvalue_t q, char *end) * Create a Contact header field from the dset * array */ -char* print_dset(struct sip_msg* msg, int* len) +char* print_dset(struct sip_msg* msg, int* len, int options) { int cnt = 0; qvalue_t q; @@ -529,7 +529,7 @@ char* print_dset(struct sip_msg* msg, int* len)
/* current uri */ if (msg->new_uri.s) { - if (print_contact_str(&p, &msg->new_uri, ruri_q, end) < 0) { + if (print_contact_str(&p, &msg->new_uri, ruri_q, end, options) < 0) { goto memfail; } cnt++; @@ -546,7 +546,7 @@ char* print_dset(struct sip_msg* msg, int* len) p += CONTACT_DELIM_LEN; }
- if (print_contact_str(&p, &uri, q, end) < 0) { + if (print_contact_str(&p, &uri, q, end, options) < 0) { goto memfail; }
diff --git a/src/core/dset.h b/src/core/dset.h index 603b2023d1..b786cee053 100644 --- a/src/core/dset.h +++ b/src/core/dset.h @@ -158,7 +158,7 @@ void clear_branches(void); * Create a Contact header field from the * list of current branches */ -char* print_dset(struct sip_msg* msg, int* len); +char* print_dset(struct sip_msg* msg, int* len, int options);
/*! \brief diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c index 0419641efd..ac119ef3d3 100644 --- a/src/modules/pv/pv_core.c +++ b/src/modules/pv/pv_core.c @@ -1335,7 +1335,7 @@ int pv_get_dset(struct sip_msg *msg, pv_param_t *param, if(msg==NULL) return -1;
- s.s = print_dset(msg, &s.len); + s.s = print_dset(msg, &s.len, 0); if (s.s == NULL) return pv_get_null(msg, param, res); s.len -= CRLF_LEN; diff --git a/src/modules/sl/sl_funcs.c b/src/modules/sl/sl_funcs.c index 1e408e653f..c9730d7195 100644 --- a/src/modules/sl/sl_funcs.c +++ b/src/modules/sl/sl_funcs.c @@ -150,7 +150,7 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str *tag)
/* if that is a redirection message, dump current message set to it */ if (code>=300 && code<400) { - dset.s=print_dset(msg, &dset.len); + dset.s=print_dset(msg, &dset.len, 0); if (dset.s) { add_lump_rpl(msg, dset.s, dset.len, LUMP_RPL_HDR); } diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c index 81f041fc60..e2058cae78 100644 --- a/src/modules/tm/t_reply.c +++ b/src/modules/tm/t_reply.c @@ -640,7 +640,7 @@ static int _reply( struct cell *trans, struct sip_msg* p_msg,
/* if that is a redirection message, dump current message set to it */ if (code>=300 && code<400) { - dset=print_dset(p_msg, &dset_len); + dset=print_dset(p_msg, &dset_len, 0); if (dset) { add_lump_rpl(p_msg, dset, dset_len, LUMP_RPL_HDR); } diff --git a/src/modules/xprint/xp_lib.c b/src/modules/xprint/xp_lib.c index 068608a304..bbe2ceaafe 100644 --- a/src/modules/xprint/xp_lib.c +++ b/src/modules/xprint/xp_lib.c @@ -559,7 +559,7 @@ static int xl_get_dset(struct sip_msg *msg, str *res, str *hp, int hi, int hf) if(msg==NULL || res==NULL) return -1;
- res->s = print_dset(msg, &res->len); + res->s = print_dset(msg, &res->len, 0);
if ((res->s) == NULL) return xl_get_null(msg, res, hp, hi, hf);