This is new module in Kamailio, named hiops module. I am developing and it take few time to done.
In all over the module i used LM_INFO instead of LM_DBG, just for much easy troubleshooting. And also I would use lock for share memory in all project. These are some 'todo' project that i have to do.
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1856
-- Commit Summary --
* add received_in_via function(use it in hiops module)
* developing hiops module
-- File Changes --
M src/core/msg_translator.c (25)
M src/core/msg_translator.h (3)
A src/modules/hiops (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1856.patchhttps://github.com/kamailio/kamailio/pull/1856.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1856
Module: kamailio
Branch: master
Commit: 30eaf98045834e315497aa19744b0b0082b4c294
URL: https://github.com/kamailio/kamailio/commit/30eaf98045834e315497aa19744b0b0…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2020-01-28T20:01:10+01:00
modules: readme files regenerated - rtpengine ... [skip ci]
---
Modified: src/modules/rtpengine/README
---
Diff: https://github.com/kamailio/kamailio/commit/30eaf98045834e315497aa19744b0b0…
Patch: https://github.com/kamailio/kamailio/commit/30eaf98045834e315497aa19744b0b0…
---
diff --git a/src/modules/rtpengine/README b/src/modules/rtpengine/README
index b7fdfc2a75..67e7b4475f 100644
--- a/src/modules/rtpengine/README
+++ b/src/modules/rtpengine/README
@@ -1882,20 +1882,22 @@ rtpengine_offer();
“Via” header; “auto” - use the first “Via” header if this is a
request, or the second one if this is a reply; “extra” - don't
take the value from a header, but instead use the value of the
- “extra_id_pv” variable; “next” - use the value of the
- “Via/branch” tag that Kamailio will generate for the next
- branch. This can be used to create one media session per
- branch on the RTP proxy. When sending a subsequent “delete”
- command to the RTP proxy, you can then stop just the session
- for a specific branch when passing the flag '1' or '2' in the
- “rtpengine_delete”, or stop all sessions for a call when not
- passing one of those two flags there. This is especially
- useful if you have serially forked call scenarios where the
- RTP proxy gets an “offer” command for a new branch, and then a
- “delete” command for the previous branch, which would
- otherwise delete the full call, breaking the subsequent
- “answer” for the new branch. This flag is only supported by
- the Sipwise rtpengine RTP proxy at the moment!
+ “extra_id_pv” variable; “next” - use the branch ID generated
+ by Kamailio for the next outgoing branch; “auto-next” - use
+ “next” in requests and “1” in replies; “auto-extra” - use
+ “extra” in requests and “1” in replies. This can be used to
+ create one media session per branch on the RTP proxy. When
+ sending a subsequent “delete” command to the RTP proxy, you
+ can then stop just the session for a specific branch when
+ passing the flag '1' or '2' in the “rtpengine_delete”, or stop
+ all sessions for a call when not passing one of those two
+ flags there. This is especially useful if you have serially
+ forked call scenarios where the RTP proxy gets an “offer”
+ command for a new branch, and then a “delete” command for the
+ previous branch, which would otherwise delete the full call,
+ breaking the subsequent “answer” for the new branch. This flag
+ is only supported by the Sipwise rtpengine RTP proxy at the
+ moment!
+ asymmetric - flags that UA from which message is received
doesn't support symmetric RTP. Disables learning of endpoint
addresses in the Sipwise rtpengine proxy.
Module: kamailio
Branch: master
Commit: ad3ae0133f321e357cf09f65f2067ed10d9c64a2
URL: https://github.com/kamailio/kamailio/commit/ad3ae0133f321e357cf09f65f2067ed…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Richard Fuchs <rfuchs(a)sipwise.com>
Date: 2020-01-28T10:40:45-05:00
rtpengine: update/fix via-branch=next ID generation
- via-branch=next should not use a hard-coded branch index of zero, but
instead use the actual branch index from the tm module
- also adds via-branch=auto-next and via-branch=auto-extra for easier
processing in scripts
---
Modified: src/modules/rtpengine/doc/rtpengine_admin.xml
Modified: src/modules/rtpengine/rtpengine.c
---
Diff: https://github.com/kamailio/kamailio/commit/ad3ae0133f321e357cf09f65f2067ed…
Patch: https://github.com/kamailio/kamailio/commit/ad3ae0133f321e357cf09f65f2067ed…
---
diff --git a/src/modules/rtpengine/doc/rtpengine_admin.xml b/src/modules/rtpengine/doc/rtpengine_admin.xml
index ceb070d583..f4213f2cab 100644
--- a/src/modules/rtpengine/doc/rtpengine_admin.xml
+++ b/src/modules/rtpengine/doc/rtpengine_admin.xml
@@ -2111,8 +2111,12 @@ rtpengine_offer();
a request, or the second one if this is a reply;
<quote>extra</quote> - don't take the value from a header, but instead use
the value of the <quote>extra_id_pv</quote> variable;
- <quote>next</quote> - use the value of the <quote>Via/branch</quote>
- tag that Kamailio will generate for the next branch.
+ <quote>next</quote> - use the branch ID generated by &kamailio; for the
+ next outgoing branch;
+ <quote>auto-next</quote> - use <quote>next</quote> in requests and
+ <quote>1</quote> in replies;
+ <quote>auto-extra</quote> - use <quote>extra</quote> in requests and
+ <quote>1</quote> in replies.
This can be used to create one media session per branch
on the &rtp; proxy. When sending a subsequent <quote>delete</quote> command to
the &rtp; proxy, you can then stop just the session for a specific branch when
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 9399f94e00..4db1461f0d 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -2268,6 +2268,10 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enu
ng_flags->via = -1;
else if (str_eq(&val, "next"))
ng_flags->via = -2;
+ else if (str_eq(&val, "auto-next") || str_eq(&val, "next-auto"))
+ ng_flags->via = -3;
+ else if (str_eq(&val, "auto-extra") || str_eq(&val, "extra-auto"))
+ ng_flags->via = -4;
else
goto error;
goto next;
@@ -2363,6 +2367,8 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
char md5[MD5_LEN];
char branch_buf[MAX_BRANCH_PARAM_LEN];
bencode_item_t *result;
+ tm_cell_t *t;
+ unsigned int branch_idx;
/*** get & init basic stuff needed ***/
@@ -2453,11 +2459,21 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
bencode_dictionary_add_str(ng_flags.dict, "call-id", &ng_flags.call_id);
if (ng_flags.via) {
- ret = -1;
+ /* pre-process */
switch (ng_flags.via) {
case 3:
ng_flags.via = (msg->first_line.type == SIP_REPLY) ? 2 : 1;
- /* fall thru */
+ break;
+ case -3:
+ ng_flags.via = (msg->first_line.type == SIP_REPLY) ? 1 : -2;
+ break;
+ case -4:
+ ng_flags.via = (msg->first_line.type == SIP_REPLY) ? 1 : -1;
+ break;
+ }
+
+ ret = -1;
+ switch (ng_flags.via) {
case 1:
case 2:
ret = get_via_branch(msg, ng_flags.via, &viabranch);
@@ -2469,10 +2485,16 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_
case -2:
if (!char_msg_val(msg, md5))
break;
+ branch_idx = 0;
+ if (tmb.t_gett) {
+ t = tmb.t_gett();
+ if (t && t != T_UNDEFINED)
+ branch_idx = t->nr_of_outgoings;
+ }
msg->hash_index = hash(msg->callid->body, get_cseq(msg)->number);
viabranch.s = branch_buf;
- if (branch_builder(msg->hash_index, 0, md5, 0, branch_buf, &viabranch.len))
+ if (branch_builder(msg->hash_index, 0, md5, branch_idx, branch_buf, &viabranch.len))
ret = 0;
break;
}