Module: kamailio
Branch: master
Commit: c5b8e5b3a82ac0f61a059f69921866952405ffe5
URL: https://github.com/kamailio/kamailio/commit/c5b8e5b3a82ac0f61a059f699218669…
Author: Alex Hermann <alex(a)hexla.nl>
Committer: Alex Hermann <alex(a)hexla.nl>
Date: 2019-02-01T11:14:10+01:00
rr: Add new return value for preloaded route set to loose_route()
Instead of returning just -1 (error), return a dedicated value. Now it is
possible to detect from the script if a preloaded Route header was removed
that pointed at the local proxy.
The new return code is kept negative, so all code checking for failure response
keeps working.
---
Modified: src/modules/rr/doc/rr_admin.xml
Modified: src/modules/rr/loose.c
---
Diff: https://github.com/kamailio/kamailio/commit/c5b8e5b3a82ac0f61a059f699218669…
Patch: https://github.com/kamailio/kamailio/commit/c5b8e5b3a82ac0f61a059f699218669…
---
diff --git a/src/modules/rr/doc/rr_admin.xml b/src/modules/rr/doc/rr_admin.xml
index 7dd1868e2a..74e59abe82 100644
--- a/src/modules/rr/doc/rr_admin.xml
+++ b/src/modules/rr/doc/rr_admin.xml
@@ -364,7 +364,7 @@ modparam("rr", "ignore_sips", 1)
<listitem>
<para><emphasis>2</emphasis> - route calculation based on
- flow-token has been successful</para>
+ flow-token has been successful</para>
</listitem>
<listitem>
@@ -376,6 +376,11 @@ modparam("rr", "ignore_sips", 1)
<para><emphasis>-2</emphasis> - outbound flow-token shows evidence
of tampering</para>
</listitem>
+
+ <listitem>
+ <para><emphasis>-3</emphasis> - next hop is taken from
+ a preloaded route set</para>
+ </listitem>
</itemizedlist>
<para>This function can be used from REQUEST_ROUTE.</para>
diff --git a/src/modules/rr/loose.c b/src/modules/rr/loose.c
index 6e9e888a2b..efe428a1cd 100644
--- a/src/modules/rr/loose.c
+++ b/src/modules/rr/loose.c
@@ -48,6 +48,7 @@
#define RR_OB_DRIVEN 2 /*!< The next hop is determined from the route set based on flow-token */
#define NOT_RR_DRIVEN -1 /*!< The next hop is not determined from the route set */
#define FLOW_TOKEN_BROKEN -2 /*!< Outbound flow-token shows evidence of tampering */
+#define RR_PRELOADED -3 /*!< The next hop is determined from a preloaded route set */
#define RR_ROUTE_PREFIX ROUTE_PREFIX "<"
#define RR_ROUTE_PREFIX_LEN (sizeof(RR_ROUTE_PREFIX)-1)
@@ -840,7 +841,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
}
if (res > 0) { /* No next route found */
LM_DBG("No next URI found\n");
- status = (preloaded ? NOT_RR_DRIVEN : RR_DRIVEN);
+ status = (preloaded ? RR_PRELOADED : RR_DRIVEN);
goto done;
}
rt = (rr_t*)hdr->parsed;
@@ -873,7 +874,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
}
if (res > 0) { /* No next route found */
LM_DBG("no next URI found\n");
- status = (preloaded ? NOT_RR_DRIVEN : RR_DRIVEN);
+ status = (preloaded ? RR_PRELOADED : RR_DRIVEN);
goto done;
}
rt = (rr_t*)hdr->parsed;
Instead of returning just -1 (error), return a dedicated value. Now it is
possible to detect from the script if a preloaded Route header was removed
that pointed at the local proxy.
The new return code is kept negative, so all code checking for failure response
keeps working.
<!-- 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 -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] 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)
- [x] 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
- [x] 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/1830
-- Commit Summary --
* rr: Add new return value for preloaded route set to loose_route()
-- File Changes --
M src/modules/rr/doc/rr_admin.xml (7)
M src/modules/rr/loose.c (5)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1830.patchhttps://github.com/kamailio/kamailio/pull/1830.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/1830
<!-- 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 -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x ] 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)
- [x] 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 -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
added target to install systemd and sysconfig files for systemd service
installation method : make install-systemd-centos
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1831
-- Commit Summary --
* src/Makefile: added target to install files for systemd on Centos 7
-- File Changes --
M src/Makefile (21)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1831.patchhttps://github.com/kamailio/kamailio/pull/1831.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/1831
### Description
the /var/run/kamailio directory for the fifo and crtl files are denied for acces to the service
as i can see directory are owed byt root and only ower and group have
access
kamailio 4.4 backported by me for Debian jessie have this:
`drwxr-xr-x 2 kamailio kamailio 100 Aug 15 17:33 kamailio`
kamailio 5.2 installed on buster/testing build from sources:
`drwxr-x--- 2 root root 120 Jan 30 09:35 kamailio`
**NOTE** no definiton are setup, and surprise if i defined some, the only working dir are /tmp !!!
### Troubleshooting
kamailio 4.4 backported by me for Debian jessie have this:
`drwxr-xr-x 2 kamailio kamailio 100 Aug 15 17:33 kamailio`
kamailio 5.2 installed on buster/testing build from sources:
`drwxr-x--- 2 root root 120 Jan 30 09:35 kamailio`
due that several issues are happened if we started using some modules
due unable to manage the socket control:
```
Jan 31 15:35:51 venenux-debian kamailio[16861]: 17(16889) ERROR:
<core> [core/io_wait.h:1040]: io_wait_loop_epoll(): epoll_wait(7,
0x7f6ed6f88d88, 0, 5000): Invalid argument [22]
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) ERROR: ctl
[ctl.c:390]: mod_destroy(): ERROR: ctl: could not delete unix socket
/var/run/kamailio//kamailio_ctl: Permission denied (13)
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: <core>
[db_pool.c:100]: pool_remove(): removing connection from the pool
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:85]: tm_shutdown(): start
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:88]: tm_shutdown(): emptying hash table
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:90]: tm_shutdown(): removing semaphores
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:92]: tm_shutdown(): destroying tmcb lists
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:95]: tm_shutdown(): done
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) ERROR:
jsonrpcs [jsonrpcs_fifo.c:599]: jsonrpc_fifo_destroy(): FIFO stat
failed: Permission denied
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) ERROR:
jsonrpcs [jsonrpcs_sock.c:516]: jsonrpc_dgram_destroy(): socket stat
failed: Permission denied
```
#### Reproduction
build from sources with default values enable dialog, blf support and asterisk and start service.. when try to control using socket kamailio cannot comunicate with itselft! very ironic!
#### Log Messages
```
Jan 31 15:35:51 venenux-debian kamailio[16861]: 17(16889) ERROR:
<core> [core/io_wait.h:1040]: io_wait_loop_epoll(): epoll_wait(7,
0x7f6ed6f88d88, 0, 5000): Invalid argument [22]
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) ERROR: ctl
[ctl.c:390]: mod_destroy(): ERROR: ctl: could not delete unix socket
/var/run/kamailio//kamailio_ctl: Permission denied (13)
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: <core>
[db_pool.c:100]: pool_remove(): removing connection from the pool
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:85]: tm_shutdown(): start
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:88]: tm_shutdown(): emptying hash table
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:90]: tm_shutdown(): removing semaphores
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:92]: tm_shutdown(): destroying tmcb lists
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) DEBUG: tm
[t_funcs.c:95]: tm_shutdown(): done
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) ERROR:
jsonrpcs [jsonrpcs_fifo.c:599]: jsonrpc_fifo_destroy(): FIFO stat
failed: Permission denied
Jan 31 15:35:51 venenux-debian kamailio[16861]: 0(16863) ERROR:
jsonrpcs [jsonrpcs_sock.c:516]: jsonrpc_dgram_destroy(): socket stat
failed: Permission denied
```
#### SIP Traffic
NOT RELATED
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.2.1 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 4.9.2
```
* **Operating System**:
```
Debian buster/testing
```
--
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/issues/1827