kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
August 2024
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
10 participants
162 discussions
Start a n
N
ew thread
git:master:f409ffa0: corex: handle return code from core functions for uac forwarding
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: f409ffa05fcefc11dbfaef0cfedcc7cee0911b2a URL:
https://github.com/kamailio/kamailio/commit/f409ffa05fcefc11dbfaef0cfedcc7c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-08-27T12:38:25+02:00 corex: handle return code from core functions for uac forwarding --- Modified: src/modules/corex/corex_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/f409ffa05fcefc11dbfaef0cfedcc7c…
Patch:
https://github.com/kamailio/kamailio/commit/f409ffa05fcefc11dbfaef0cfedcc7c…
--- diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c index 585b65b0836..021ed586253 100644 --- a/src/modules/corex/corex_mod.c +++ b/src/modules/corex/corex_mod.c @@ -279,7 +279,13 @@ static void mod_destroy(void) */ static int ki_forward_uac(sip_msg_t *msg, str *vuri) { - return forward_uac_uri(msg, NULL); + int ret; + + ret = forward_uac_uri(msg, NULL); + if(ret >= 0) { + return 1; + } + return -1; } /** @@ -287,7 +293,13 @@ static int ki_forward_uac(sip_msg_t *msg, str *vuri) */ static int ki_forward_uac_uri(sip_msg_t *msg, str *vuri) { - return forward_uac_uri(msg, vuri); + int ret; + + ret = forward_uac_uri(msg, vuri); + if(ret >= 0) { + return 1; + } + return -1; } /** @@ -295,7 +307,13 @@ static int ki_forward_uac_uri(sip_msg_t *msg, str *vuri) */ static int w_forward_uac(sip_msg_t *msg, char *p1, char *p2) { - return forward_uac_uri(msg, NULL); + int ret; + + ret = forward_uac_uri(msg, NULL); + if(ret >= 0) { + return 1; + } + return -1; } /** @@ -303,6 +321,7 @@ static int w_forward_uac(sip_msg_t *msg, char *p1, char *p2) */ static int w_forward_uac_uri(sip_msg_t *msg, char *puri, char *p2) { + int ret; str vuri = STR_NULL; if(fixup_get_svalue(msg, (gparam_t *)puri, &vuri)) { @@ -310,7 +329,11 @@ static int w_forward_uac_uri(sip_msg_t *msg, char *puri, char *p2) return -1; } - return forward_uac_uri(msg, &vuri); + ret = forward_uac_uri(msg, &vuri); + if(ret >= 0) { + return 1; + } + return -1; } /**
2 months, 4 weeks
1
0
0
0
git:master:31c77b2f: core: propagate return code for forward uac helpers
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 31c77b2f81e23666fbd8d6d249d6b8ddce06483a URL:
https://github.com/kamailio/kamailio/commit/31c77b2f81e23666fbd8d6d249d6b8d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-08-27T12:38:25+02:00 core: propagate return code for forward uac helpers --- Modified: src/core/forward.c --- Diff:
https://github.com/kamailio/kamailio/commit/31c77b2f81e23666fbd8d6d249d6b8d…
Patch:
https://github.com/kamailio/kamailio/commit/31c77b2f81e23666fbd8d6d249d6b8d…
--- diff --git a/src/core/forward.c b/src/core/forward.c index 97953ee7b85..ff73d957642 100644 --- a/src/core/forward.c +++ b/src/core/forward.c @@ -688,6 +688,9 @@ int forward_request_mode(struct sip_msg *msg, str *dst, unsigned short port, } +/** + * forward request in stateless mode + */ int forward_request(struct sip_msg *msg, str *dst, unsigned short port, struct dest_info *send_info) { @@ -695,6 +698,9 @@ int forward_request(struct sip_msg *msg, str *dst, unsigned short port, } +/** + * forward request like initial uac sender, with only one via + */ int forward_request_uac(struct sip_msg *msg, str *dst, unsigned short port, struct dest_info *send_info) { @@ -723,11 +729,8 @@ int forward_request_uac(struct sip_msg *msg, str *dst, unsigned short port, msg->msg_flags |= FL_VIA_NORECEIVED; ret = forward_request_mode(msg, dst, port, send_info, BUILD_NO_VIA1_UPDATE); msg->msg_flags = msg_flags_bk; - if(ret >= 0) { - return 1; - } - return -1; + return ret; } /** @@ -787,11 +790,8 @@ int forward_uac_uri(sip_msg_t *msg, str *vuri) ret = forward_request_mode( msg, &u->host, u->port_no, &dst, BUILD_NO_VIA1_UPDATE); msg->msg_flags = msg_flags_bk; - if(ret >= 0) { - return 1; - } - return -1; + return ret; } int update_sock_struct_from_via(
2 months, 4 weeks
1
0
0
0
git:master:efcb697e: corex: export to kemi the forward uac functions
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: efcb697e34f767ccb243c181c9d557d136eada2e URL:
https://github.com/kamailio/kamailio/commit/efcb697e34f767ccb243c181c9d557d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-08-27T12:38:25+02:00 corex: export to kemi the forward uac functions --- Modified: src/modules/corex/corex_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/efcb697e34f767ccb243c181c9d557d…
Patch:
https://github.com/kamailio/kamailio/commit/efcb697e34f767ccb243c181c9d557d…
--- diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c index a5d05dbaea2..585b65b0836 100644 --- a/src/modules/corex/corex_mod.c +++ b/src/modules/corex/corex_mod.c @@ -274,6 +274,14 @@ static void mod_destroy(void) { } +/** + * forward request like initial uac sender, with only one via + */ +static int ki_forward_uac(sip_msg_t *msg, str *vuri) +{ + return forward_uac_uri(msg, NULL); +} + /** * forward request like initial uac sender, with only one via */ @@ -1528,6 +1536,16 @@ static sr_kemi_t sr_kemi_corex_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init("corex"), str_init("forward_uac"), + SR_KEMIP_INT, ki_forward_uac, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("corex"), str_init("forward_uac_uri"), + SR_KEMIP_INT, ki_forward_uac_uri, + { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } } };
2 months, 4 weeks
1
0
0
0
git:master:69b43802: tm: new headers_mode flag 2
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 69b4380222121321412afc70dfafe39961551f41 URL:
https://github.com/kamailio/kamailio/commit/69b4380222121321412afc70dfafe39…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-08-27T12:38:25+02:00 tm: new headers_mode flag 2 - statelss uac-style forwarding of CANCEL --- Modified: src/modules/tm/t_fwd.c Modified: src/modules/tm/t_msgbuilder.c Modified: src/modules/tm/t_msgbuilder.h --- Diff:
https://github.com/kamailio/kamailio/commit/69b4380222121321412afc70dfafe39…
Patch:
https://github.com/kamailio/kamailio/commit/69b4380222121321412afc70dfafe39…
--- diff --git a/src/modules/tm/t_fwd.c b/src/modules/tm/t_fwd.c index cf30afedfa7..9568b6adb1b 100644 --- a/src/modules/tm/t_fwd.c +++ b/src/modules/tm/t_fwd.c @@ -61,6 +61,7 @@ extern int tm_failure_exec_mode; extern int tm_dns_reuse_rcv_socket; +extern int tm_headers_mode; static int goto_on_branch = 0, branch_route = 0; /* E2E_CANCEL_HOP_BY_HOP - cancel hop by hop */ @@ -1902,7 +1903,11 @@ int t_forward_cancel(struct sip_msg *p_msg, struct proxy_l *proxy, int proto, #endif /* dst->send_sock not set, but forward_request * will take care of it */ - ret = forward_request(p_msg, &host, port, &dst); + if(tm_headers_mode & TM_CANCEL_FORWARD_UAC) { + ret = forward_request_uac(p_msg, &host, port, &dst); + } else { + ret = forward_request(p_msg, &host, port, &dst); + } goto end; } else { init_dest_info(&dst); @@ -1910,7 +1915,11 @@ int t_forward_cancel(struct sip_msg *p_msg, struct proxy_l *proxy, int proto, proxy2su(&dst.to, proxy); /* dst->send_sock not set, but forward_request * will take care of it */ - ret = forward_request(p_msg, 0, 0, &dst); + if(tm_headers_mode & TM_CANCEL_FORWARD_UAC) { + ret = forward_request_uac(p_msg, &host, port, &dst); + } else { + ret = forward_request(p_msg, 0, 0, &dst); + } goto end; } } diff --git a/src/modules/tm/t_msgbuilder.c b/src/modules/tm/t_msgbuilder.c index 49c801d2e8f..9adc4613421 100644 --- a/src/modules/tm/t_msgbuilder.c +++ b/src/modules/tm/t_msgbuilder.c @@ -70,7 +70,6 @@ (_d) += (_len); \ } while(0) -#define TM_CANCEL_HEADERS_COPY 1 extern int tm_headers_mode; /* Build a local request based on a previous request; main diff --git a/src/modules/tm/t_msgbuilder.h b/src/modules/tm/t_msgbuilder.h index c06d1e6adf6..f6ad810d377 100644 --- a/src/modules/tm/t_msgbuilder.h +++ b/src/modules/tm/t_msgbuilder.h @@ -28,6 +28,9 @@ #include "h_table.h" #include "t_reply.h" +#define TM_CANCEL_HEADERS_COPY (1) +#define TM_CANCEL_FORWARD_UAC (1 << 1) + char *build_local(struct cell *Trans, unsigned int branch, unsigned int *len, char *method, int method_len, str *to, sip_msg_t *imsg, struct cancel_reason *reason);
2 months, 4 weeks
1
0
0
0
git:master:233dda7b: core: helper function to forward uac style with dst attributes
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 233dda7b9a1ca6954c35f2f0b271cb9bc4c813d9 URL:
https://github.com/kamailio/kamailio/commit/233dda7b9a1ca6954c35f2f0b271cb9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-08-27T12:38:25+02:00 core: helper function to forward uac style with dst attributes --- Modified: src/core/forward.c Modified: src/core/forward.h --- Diff:
https://github.com/kamailio/kamailio/commit/233dda7b9a1ca6954c35f2f0b271cb9…
Patch:
https://github.com/kamailio/kamailio/commit/233dda7b9a1ca6954c35f2f0b271cb9…
--- diff --git a/src/core/forward.c b/src/core/forward.c index 3d2e743cdbd..97953ee7b85 100644 --- a/src/core/forward.c +++ b/src/core/forward.c @@ -695,6 +695,41 @@ int forward_request(struct sip_msg *msg, str *dst, unsigned short port, } +int forward_request_uac(struct sip_msg *msg, str *dst, unsigned short port, + struct dest_info *send_info) +{ + int ret; + sr_lump_t *anchor; + hdr_field_t *hf; + msg_flags_t msg_flags_bk; + + if(parse_headers(msg, HDR_EOH_F, 0) == -1) { + LM_ERR("error while parsing message\n"); + return -1; + } + /* remove incoming Via headers */ + for(hf = msg->headers; hf; hf = hf->next) { + if(hf->type != HDR_VIA_T) { + continue; + } + anchor = del_lump(msg, hf->name.s - msg->buf, hf->len, 0); + if(anchor == 0) { + LM_ERR("cannot remove Via header\n"); + return -1; + } + } + + msg_flags_bk = msg->msg_flags; + msg->msg_flags |= FL_VIA_NORECEIVED; + ret = forward_request_mode(msg, dst, port, send_info, BUILD_NO_VIA1_UPDATE); + msg->msg_flags = msg_flags_bk; + if(ret >= 0) { + return 1; + } + + return -1; +} + /** * forward request like initial uac sender, with only one via */ diff --git a/src/core/forward.h b/src/core/forward.h index 5b414a7a64b..31086c6512b 100644 --- a/src/core/forward.h +++ b/src/core/forward.h @@ -82,6 +82,8 @@ int forward_request(struct sip_msg *msg, str *dst, unsigned short port, struct dest_info *send_info); int forward_request_mode(struct sip_msg *msg, str *dst, unsigned short port, struct dest_info *send_info, unsigned int mbmode); +int forward_request_uac(struct sip_msg *msg, str *dst, unsigned short port, + struct dest_info *send_info); int forward_uac_uri(sip_msg_t *msg, str *vuri); int update_sock_struct_from_via( union sockaddr_union *to, struct sip_msg *msg, struct via_body *via);
2 months, 4 weeks
1
0
0
0
git:master:f58c1a0b: corex: updates to forward-uac functions after code relocation
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: f58c1a0b74cce2f3abca540d0d6cb826d3d7b637 URL:
https://github.com/kamailio/kamailio/commit/f58c1a0b74cce2f3abca540d0d6cb82…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-08-27T12:38:25+02:00 corex: updates to forward-uac functions after code relocation --- Modified: src/modules/corex/corex_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/f58c1a0b74cce2f3abca540d0d6cb82…
Patch:
https://github.com/kamailio/kamailio/commit/f58c1a0b74cce2f3abca540d0d6cb82…
--- diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c index c6852759114..a5d05dbaea2 100644 --- a/src/modules/corex/corex_mod.c +++ b/src/modules/corex/corex_mod.c @@ -279,63 +279,7 @@ static void mod_destroy(void) */ static int ki_forward_uac_uri(sip_msg_t *msg, str *vuri) { - int ret; - dest_info_t dst; - sip_uri_t *u; - sip_uri_t next_hop; - sr_lump_t *anchor; - hdr_field_t *hf; - msg_flags_t msg_flags_bk; - - if(msg == NULL) { - LM_WARN("invalid msg parameter\n"); - return -1; - } - - if(parse_headers(msg, HDR_EOH_F, 0) == -1) { - LM_ERR("error while parsing message\n"); - return -1; - } - /* remove incoming Via headers */ - for(hf = msg->headers; hf; hf = hf->next) { - if(hf->type != HDR_VIA_T) { - continue; - } - anchor = del_lump(msg, hf->name.s - msg->buf, hf->len, 0); - if(anchor == 0) { - LM_ERR("cannot remove Via header\n"); - return -1; - } - } - - init_dest_info(&dst); - if(vuri == NULL || vuri->s == NULL || vuri->len <= 0) { - if(msg->dst_uri.len) { - ret = parse_uri(msg->dst_uri.s, msg->dst_uri.len, &next_hop); - u = &next_hop; - } else { - ret = parse_sip_msg_uri(msg); - u = &msg->parsed_uri; - } - } else { - ret = parse_uri(vuri->s, vuri->len, &next_hop); - u = &next_hop; - } - if(ret < 0) { - LM_ERR("forward - bad uri dropping packet\n"); - return -1; - } - dst.proto = u->proto; - msg_flags_bk = msg->msg_flags; - msg->msg_flags |= FL_VIA_NORECEIVED; - ret = forward_request_mode( - msg, &u->host, u->port_no, &dst, BUILD_NO_VIA1_UPDATE); - msg->msg_flags = msg_flags_bk; - if(ret >= 0) { - return 1; - } - - return -1; + return forward_uac_uri(msg, vuri); } /** @@ -343,7 +287,7 @@ static int ki_forward_uac_uri(sip_msg_t *msg, str *vuri) */ static int w_forward_uac(sip_msg_t *msg, char *p1, char *p2) { - return ki_forward_uac_uri(msg, NULL); + return forward_uac_uri(msg, NULL); } /** @@ -358,7 +302,7 @@ static int w_forward_uac_uri(sip_msg_t *msg, char *puri, char *p2) return -1; } - return ki_forward_uac_uri(msg, &vuri); + return forward_uac_uri(msg, &vuri); } /**
2 months, 4 weeks
1
0
0
0
git:master:a8162b51: core: relocated function for stateless forwarding uac style
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: a8162b513443fd688ab66e470748cc948c811a6a URL:
https://github.com/kamailio/kamailio/commit/a8162b513443fd688ab66e470748cc9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-08-27T12:38:25+02:00 core: relocated function for stateless forwarding uac style --- Modified: src/core/forward.c Modified: src/core/forward.h --- Diff:
https://github.com/kamailio/kamailio/commit/a8162b513443fd688ab66e470748cc9…
Patch:
https://github.com/kamailio/kamailio/commit/a8162b513443fd688ab66e470748cc9…
--- diff --git a/src/core/forward.c b/src/core/forward.c index 1d2b1d5d650..3d2e743cdbd 100644 --- a/src/core/forward.c +++ b/src/core/forward.c @@ -40,6 +40,7 @@ #include "hash_func.h" #include "config.h" #include "parser/msg_parser.h" +#include "parser/parse_uri.h" #include "char_msg_val.h" #include "route.h" #include "events.h" @@ -694,6 +695,70 @@ int forward_request(struct sip_msg *msg, str *dst, unsigned short port, } +/** + * forward request like initial uac sender, with only one via + */ +int forward_uac_uri(sip_msg_t *msg, str *vuri) +{ + int ret; + dest_info_t dst; + sip_uri_t *u; + sip_uri_t next_hop; + sr_lump_t *anchor; + hdr_field_t *hf; + msg_flags_t msg_flags_bk; + + if(msg == NULL) { + LM_WARN("invalid msg parameter\n"); + return -1; + } + + if(parse_headers(msg, HDR_EOH_F, 0) == -1) { + LM_ERR("error while parsing message\n"); + return -1; + } + /* remove incoming Via headers */ + for(hf = msg->headers; hf; hf = hf->next) { + if(hf->type != HDR_VIA_T) { + continue; + } + anchor = del_lump(msg, hf->name.s - msg->buf, hf->len, 0); + if(anchor == 0) { + LM_ERR("cannot remove Via header\n"); + return -1; + } + } + + init_dest_info(&dst); + if(vuri == NULL || vuri->s == NULL || vuri->len <= 0) { + if(msg->dst_uri.len) { + ret = parse_uri(msg->dst_uri.s, msg->dst_uri.len, &next_hop); + u = &next_hop; + } else { + ret = parse_sip_msg_uri(msg); + u = &msg->parsed_uri; + } + } else { + ret = parse_uri(vuri->s, vuri->len, &next_hop); + u = &next_hop; + } + if(ret < 0) { + LM_ERR("forward - bad uri dropping packet\n"); + return -1; + } + dst.proto = u->proto; + msg_flags_bk = msg->msg_flags; + msg->msg_flags |= FL_VIA_NORECEIVED; + ret = forward_request_mode( + msg, &u->host, u->port_no, &dst, BUILD_NO_VIA1_UPDATE); + msg->msg_flags = msg_flags_bk; + if(ret >= 0) { + return 1; + } + + return -1; +} + int update_sock_struct_from_via( union sockaddr_union *to, struct sip_msg *msg, struct via_body *via) { diff --git a/src/core/forward.h b/src/core/forward.h index a90ce3446ce..5b414a7a64b 100644 --- a/src/core/forward.h +++ b/src/core/forward.h @@ -82,6 +82,7 @@ int forward_request(struct sip_msg *msg, str *dst, unsigned short port, struct dest_info *send_info); int forward_request_mode(struct sip_msg *msg, str *dst, unsigned short port, struct dest_info *send_info, unsigned int mbmode); +int forward_uac_uri(sip_msg_t *msg, str *vuri); int update_sock_struct_from_via( union sockaddr_union *to, struct sip_msg *msg, struct via_body *via);
2 months, 4 weeks
1
0
0
0
git:master:bf9dec59: tm: implement headers_mode option for build_local()
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: bf9dec59480cb8bed1deaa7670454b57045b8b90 URL:
https://github.com/kamailio/kamailio/commit/bf9dec59480cb8bed1deaa7670454b5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-08-27T12:38:25+02:00 tm: implement headers_mode option for build_local() --- Modified: src/modules/tm/t_msgbuilder.c --- Diff:
https://github.com/kamailio/kamailio/commit/bf9dec59480cb8bed1deaa7670454b5…
Patch:
https://github.com/kamailio/kamailio/commit/bf9dec59480cb8bed1deaa7670454b5…
--- diff --git a/src/modules/tm/t_msgbuilder.c b/src/modules/tm/t_msgbuilder.c index c195193d6e6..49c801d2e8f 100644 --- a/src/modules/tm/t_msgbuilder.c +++ b/src/modules/tm/t_msgbuilder.c @@ -187,6 +187,28 @@ char *build_local(struct cell *Trans, unsigned int branch, unsigned int *len, LM_BUG("unhandled reason cause %d\n", reason->cause); } *len += reason_len; + if(imsg != NULL && (tm_headers_mode & TM_CANCEL_HEADERS_COPY)) { + for(hdr = imsg->headers; hdr; hdr = hdr->next) { + switch(hdr->type) { + case HDR_CALLID_T: + case HDR_CSEQ_T: + case HDR_VIA_T: + case HDR_TO_T: + case HDR_FROM_T: + case HDR_ROUTE_T: + case HDR_MAXFORWARDS_T: + case HDR_REQUIRE_T: + case HDR_PROXYREQUIRE_T: + case HDR_CONTENTLENGTH_T: + case HDR_REASON_T: + case HDR_EOH_T: + /* skip these headers - they were added already */ + break; + default: + *len += hdr->len; + } + } + } *len += CRLF_LEN; /* end of msg. */ cancel_buf = shm_malloc(*len + 1); @@ -258,6 +280,29 @@ char *build_local(struct cell *Trans, unsigned int branch, unsigned int *len, } } } + if(imsg != NULL && (tm_headers_mode & TM_CANCEL_HEADERS_COPY)) { + for(hdr = imsg->headers; hdr; hdr = hdr->next) { + switch(hdr->type) { + case HDR_CALLID_T: + case HDR_CSEQ_T: + case HDR_VIA_T: + case HDR_TO_T: + case HDR_FROM_T: + case HDR_ROUTE_T: + case HDR_MAXFORWARDS_T: + case HDR_REQUIRE_T: + case HDR_PROXYREQUIRE_T: + case HDR_CONTENTLENGTH_T: + case HDR_REASON_T: + case HDR_EOH_T: + /* skip these headers - they were added already */ + break; + default: + append_str(p, hdr->name.s, hdr->len); + } + } + } + append_str(p, CRLF, CRLF_LEN); /* msg. end */ *p = 0;
2 months, 4 weeks
1
0
0
0
git:master:aba3c191: corex: backup and restor internal flags for forward uac mode
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: aba3c191e4d00666cb4a9e0c646057df4976d133 URL:
https://github.com/kamailio/kamailio/commit/aba3c191e4d00666cb4a9e0c646057d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-08-27T12:38:25+02:00 corex: backup and restor internal flags for forward uac mode --- Modified: src/modules/corex/corex_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/aba3c191e4d00666cb4a9e0c646057d…
Patch:
https://github.com/kamailio/kamailio/commit/aba3c191e4d00666cb4a9e0c646057d…
--- diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c index 7e121f8bb61..c6852759114 100644 --- a/src/modules/corex/corex_mod.c +++ b/src/modules/corex/corex_mod.c @@ -285,6 +285,7 @@ static int ki_forward_uac_uri(sip_msg_t *msg, str *vuri) sip_uri_t next_hop; sr_lump_t *anchor; hdr_field_t *hf; + msg_flags_t msg_flags_bk; if(msg == NULL) { LM_WARN("invalid msg parameter\n"); @@ -325,9 +326,11 @@ static int ki_forward_uac_uri(sip_msg_t *msg, str *vuri) return -1; } dst.proto = u->proto; + msg_flags_bk = msg->msg_flags; msg->msg_flags |= FL_VIA_NORECEIVED; ret = forward_request_mode( msg, &u->host, u->port_no, &dst, BUILD_NO_VIA1_UPDATE); + msg->msg_flags = msg_flags_bk; if(ret >= 0) { return 1; }
2 months, 4 weeks
1
0
0
0
git:master:a30839fc: modules: readme files regenerated - pua_dialoginfo ... [skip ci]
by Kamailio Dev
Module: kamailio Branch: master Commit: a30839fceabbab3be18e01ec6f39c9e0d542f6b6 URL:
https://github.com/kamailio/kamailio/commit/a30839fceabbab3be18e01ec6f39c9e…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org> Committer: Kamailio Dev <kamailio.dev(a)kamailio.org> Date: 2024-08-27T10:16:10+02:00 modules: readme files regenerated - pua_dialoginfo ... [skip ci] --- Modified: src/modules/pua_dialoginfo/README --- Diff:
https://github.com/kamailio/kamailio/commit/a30839fceabbab3be18e01ec6f39c9e…
Patch:
https://github.com/kamailio/kamailio/commit/a30839fceabbab3be18e01ec6f39c9e…
3 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200