Dear development team,
last week I completed the development of the prototype IMS - IMSinBOX.
Development was done at the request of employer in order to create
stand for testing and demonstration of its main products: OCS / PCRF.
Since all basic IMSinBOX's nodes made using the code of the "Kamailio"
I think it is necessary to provide the community of "Kamailio" developers
all the fixes and additions, which made me in project, including:
modules problems fix methods
1 ims_registrar_pcscf identification of the identification of the
ims_usrloc_pcscf client based onto "Via" client based onto "host:port:proto"
ims_qos "host:port:proto" mislead received
usrloc & qos
2 siputils/ bug in the functions fix
chargingvector settind, getting
lib/ims/ ICID/IOI
ims_getters
3 ims_charging bugs; fix;
lack of IMS message implement ECUR using OMA
charging CPM Charging Specification
Best regards,
Vadim Gribanovsky
Hi guys,
We had Kamailio 5.1.4 with websocket module. Unfortunately, our clients
don't support websocket keepalive mechanism at all, so I used TCP keepalive
instead with the following parameters:
tcp_keepalive=yes
tcp_keepcnt=6
tcp_keepidle=60
tcp_keepintvl=10
and set up KEEPALIVE_MECHANISM_NONE:
modparam("websocket", "keepalive_mechanism", 0)
During load testing and debugging, when 8k clients sent registrations, it
was found out that shared memory was not freed after closing connections.
So I've decided to add new keepalive mechanism that periodically checks TCP
connection related to websocket:
enum
{
KEEPALIVE_MECHANISM_NONE = 0,
KEEPALIVE_MECHANISM_PING = 1,
KEEPALIVE_MECHANISM_PONG = 2,
KEEPALIVE_MECHANISM_TCP_CONN_CHECK = 3
};
and added the line to config:
# Enable custom tcp-connection-health based keepalive mechanism (3)
# KEEPALIVE_MECHANISM_NONE = 0,
# KEEPALIVE_MECHANISM_PING = 1,
# KEEPALIVE_MECHANISM_PONG = 2
# KEEPALIVE_MECHANISM_TCP_CONN_CHECK = 3
modparam("websocket", "keepalive_mechanism", 3)
Also, I've implemented the mechanism in ws_keepalive function:
void ws_keepalive(unsigned int ticks, void *param)
{
int check_time =
(int)time(NULL) - cfg_get(websocket, ws_cfg, keepalive_timeout);
ws_connection_t **list = NULL, **list_head = NULL;
ws_connection_t *wsc = NULL;
/* get an array of pointer to all ws connection */
list_head = wsconn_get_list();
if(!list_head)
return;
list = list_head;
wsc = *list_head;
while(wsc && wsc->last_used < check_time) {
if (ws_keepalive_mechanism == KEEPALIVE_MECHANISM_TCP_CONN_CHECK) {
struct tcp_connection *con = tcpconn_get(wsc->id, 0, 0, 0, 0);
if(!con) {
LM_INFO("tcp connection has been lost\n");
wsc->state = WS_S_CLOSING;
}
}
if(wsc->state == WS_S_CLOSING || wsc->awaiting_pong) {
LM_INFO("forcibly closing connection\n");
wsconn_close_now(wsc);
} else {
int opcode = (ws_keepalive_mechanism ==
KEEPALIVE_MECHANISM_PING)
? OPCODE_PING
: OPCODE_PONG;
ping_pong(wsc, opcode);
}
wsc = *(++list);
}
wsconn_put_list(list_head);
}
and changed memory allocation method in wsconn_get_list and wsconn_put_list
methods from pkg to shm, because, as it turned out during load testing,
pkg_malloc (the C malloc) may cousing fails under huge loads.
These modifications solved the problem. But about a week ago we've started
switching to ver. 5.2.1 and found a lot of changes in the websocket module.
So, I've added my changes in this commit
https://github.com/korizza/kamailio/commit/b3e03d03574ff4ff076005bb8a01d746…
.
Please take a look.
BTW: adding ws_conn_put_id in this commit
https://github.com/kamailio/kamailio/commit/a975bca1702ea2f3db47f834f7e4da2…
did
not solve problem with ref counter increasing.
Thanks,
Andrey Deykunov
For some reason, I sometimes have obsolete `modules` -subdirectory in top level source directory.
It seems to happen after going back and forth in Kamailio 4.x git branches and then back to 5.x.
When that happens, Makefile target "modules" does not correctly start building:
```
$ gmake modules
gmake: 'modules' is up to date.
```
Proposed patch tries to draw attention into such situation:
```
$ gmake modules
Makefile:14: "old Kamailio modules directory found, you should clean that"
gmake: 'modules' is up to date.
```
I think `git clean` could clean such leftovers but I am not brave enough to propose running that automatically.
Tested on FreeBSD 11.2 (GNU Make 4.2.1) and Ubuntu 16.04 (GNU Make 4.1).
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1891
-- Commit Summary --
* Makefile: give warning when old modules directory is found
-- File Changes --
M Makefile (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1891.patchhttps://github.com/kamailio/kamailio/pull/1891.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/1891