Hi,
We have kamailio server v. 5.3.1 with db_mysql.so built with our old mysql
library 5.1.41. Now I'm trying to build it with libperconaclient20. I've
tried many variants of build configuration, but every time I got errors
when kamailio stops or starts, such:
*2021-07-06T06:01:20.943809-07:00 devhpbx005-1
/var/lib/ums/sbin/kamailio[25711]: ERROR: db_mysql [km_my_con.c:139]:
db_mysql_new_connection(): driver error: Lost connection to MySQL server at
'reading authorization packet', system error:
112021-07-06T06:01:20.946591-07:00 devhpbx005-1
/var/lib/ums/sbin/kamailio[25711]: ERROR: <core> [db.c:319]: db_do_init2():
could not add connection to the pool2021-07-06T06:01:20.947224-07:00
devhpbx005-1 /var/lib/ums/sbin/kamailio[25711]: ERROR: auth_db
[auth_db_mod.c:159]: child_init(): unable to connect to the
database2021-07-06T06:01:20.947592-07:00 devhpbx005-1
/var/lib/ums/sbin/kamailio[25711]: ERROR: <core> [core/sr_module.c:806]:
init_mod_child(): error while initializing module auth_db
(/var/lib/ums/lib64/kamailio/modules/auth_db.so) (idx: 5 rank: 5 desc:
[udpreceiver child=4 sock=64.78.52.86:5060 <http://64.78.52.86:5060>])*
or
*2021-07-06T06:18:43.159744-07:00 devhpbx005-1
/var/lib/ums/sbin/kamailio[30954]: CRITICAL: <core>
[core/mem/q_malloc.c:150]: qm_debug_check_frag(): BUG: qm: prev. fragm.
tail overwritten(0, 0)[0x7fd5c6c85bc8:0x7fd5c6c85c00]! Memory allocator was
calledfrom core: db_res.c:114. Fragment marked by db_mysql: km_my_con.c:75.
Exec from core/mem/q_malloc.c:391.*
Is there some specific way to build kamailio with percona?
Thanks,
Andrey
Module: kamailio
Branch: master
Commit: 5a473493189acc93705c78c1966a9eae0e80fef0
URL: https://github.com/kamailio/kamailio/commit/5a473493189acc93705c78c1966a9ea…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-07-07T07:51:31+02:00
nathelper: docs - fixed copy/paste extra tags
---
Modified: src/modules/nathelper/doc/nathelper_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/5a473493189acc93705c78c1966a9ea…
Patch: https://github.com/kamailio/kamailio/commit/5a473493189acc93705c78c1966a9ea…
---
diff --git a/src/modules/nathelper/doc/nathelper_admin.xml b/src/modules/nathelper/doc/nathelper_admin.xml
index c6d398b218..832e324819 100644
--- a/src/modules/nathelper/doc/nathelper_admin.xml
+++ b/src/modules/nathelper/doc/nathelper_admin.xml
@@ -723,7 +723,6 @@ fix_nated_register();
and D-URI ($du). For replies, it compares host and port in 2nd Via
with received and rport parameters.
</para></listitem>
- <listitem><para>
</itemizedlist>
<para>
All flags can be bitwise combined, the test returns true if any of
Module: kamailio
Branch: master
Commit: fb0bb3f49efe51bbab03911923b737f037b9cd44
URL: https://github.com/kamailio/kamailio/commit/fb0bb3f49efe51bbab03911923b737f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-07-06T11:53:39+02:00
nathelper: docs for nat uac test 512
---
Modified: src/modules/nathelper/doc/nathelper_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/fb0bb3f49efe51bbab03911923b737f…
Patch: https://github.com/kamailio/kamailio/commit/fb0bb3f49efe51bbab03911923b737f…
---
diff --git a/src/modules/nathelper/doc/nathelper_admin.xml b/src/modules/nathelper/doc/nathelper_admin.xml
index 39e61e6856..c6d398b218 100644
--- a/src/modules/nathelper/doc/nathelper_admin.xml
+++ b/src/modules/nathelper/doc/nathelper_admin.xml
@@ -717,6 +717,13 @@ fix_nated_register();
from source IP address. It will work also with multiple connection address
lines.
</para></listitem>
+ <listitem><para>
+ <emphasis>512</emphasis> - Test if the target addresses are different
+ or over websocket. For requests, it compares host and port in R-URI ($rU)
+ and D-URI ($du). For replies, it compares host and port in 2nd Via
+ with received and rport parameters.
+ </para></listitem>
+ <listitem><para>
</itemizedlist>
<para>
All flags can be bitwise combined, the test returns true if any of
Module: kamailio
Branch: master
Commit: 8762c56a1c78e4ba151ef9fb4290b3938c0c984f
URL: https://github.com/kamailio/kamailio/commit/8762c56a1c78e4ba151ef9fb4290b39…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2021-07-06T10:01:24+02:00
modules: readme files regenerated - acc ... [skip ci]
---
Modified: src/modules/acc/README
---
Diff: https://github.com/kamailio/kamailio/commit/8762c56a1c78e4ba151ef9fb4290b39…
Patch: https://github.com/kamailio/kamailio/commit/8762c56a1c78e4ba151ef9fb4290b39…
---
diff --git a/src/modules/acc/README b/src/modules/acc/README
index baff8e8b32..da1da0331c 100644
--- a/src/modules/acc/README
+++ b/src/modules/acc/README
@@ -131,7 +131,6 @@ Sven Knoblich
7.1. acc_log_request(comment)
7.2. acc_db_request(comment, table)
7.3. acc_request(comment, table)
- 7.4. acc_diam_request(comment)
2. Frequently Asked Questions
@@ -188,7 +187,6 @@ Sven Knoblich
1.49. acc_log_request usage
1.50. acc_db_request usage
1.51. acc_db_request usage
- 1.52. acc_diam_request usage
Chapter 1. Admin Guide
@@ -287,7 +285,6 @@ Chapter 1. Admin Guide
7.1. acc_log_request(comment)
7.2. acc_db_request(comment, table)
7.3. acc_request(comment, table)
- 7.4. acc_diam_request(comment)
1. Overview
@@ -298,9 +295,9 @@ Chapter 1. Admin Guide
support for radius is enabled.
There is some very early support of the Diameter protocol in the
- “acc_diameter” module which will be deleted in coming releases. This
- support is not up to date with the current Diameter protocols. If you
- need Diameter support, please use the ims_charging module.
+ “acc_diameter” module, but is not up to date with the current Diameter
+ protocols. If you need Diameter support, please use the ims_charging
+ module.
To account a transaction and to choose which set of backends to be
used, the script writer just has to set some flags (see the module
@@ -1326,7 +1323,6 @@ modparam("acc", "cdr_on_failed", 0)
7.1. acc_log_request(comment)
7.2. acc_db_request(comment, table)
7.3. acc_request(comment, table)
- 7.4. acc_diam_request(comment)
7.1. acc_log_request(comment)
@@ -1394,23 +1390,6 @@ acc_request("100 Received", "acc_$time(year)_$time(mon)");
acc_db_request("$var(code) $avp(reason)", "acc");
...
-7.4. acc_diam_request(comment)
-
- Like acc_log_request, acc_diam_request reports on a request. It reports
- to the configured Diameter server.
-
- Meaning of the parameters is as follows:
- * comment - Comment to be appended. The string can contain any number
- of pseudo-variables.
-
- This function can be used from ANY_ROUTE.
-
- Example 1.52. acc_diam_request usage
-...
-acc_diam_request("Some comment");
-acc_diam_request("$var(code) Error: $avp(reason)");
-...
-
Chapter 2. Frequently Asked Questions
2.1. What happened with old log_fmt parameter
Module: kamailio
Branch: master
Commit: 402515c92238c3628c78a2b44ac0a05130897207
URL: https://github.com/kamailio/kamailio/commit/402515c92238c3628c78a2b44ac0a05…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-07-06T09:59:57+02:00
acc: docs - removed acc_diam_request() section
- it is now exported by acc_diameter
---
Modified: src/modules/acc/doc/acc_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/402515c92238c3628c78a2b44ac0a05…
Patch: https://github.com/kamailio/kamailio/commit/402515c92238c3628c78a2b44ac0a05…
---
diff --git a/src/modules/acc/doc/acc_admin.xml b/src/modules/acc/doc/acc_admin.xml
index f88d403d2b..41935c8dae 100644
--- a/src/modules/acc/doc/acc_admin.xml
+++ b/src/modules/acc/doc/acc_admin.xml
@@ -23,10 +23,9 @@
</para>
<para>
There is some very early support of the <acronym>Diameter</acronym>
- protocol in the <quote>acc_diameter</quote> module which will be deleted
- in coming releases. This support is not up to date with the current
- Diameter protocols. If you need Diameter support, please use the
- <acronym>ims_charging</acronym> module.
+ protocol in the <quote>acc_diameter</quote> module, but is not up to date
+ with the current Diameter protocols. If you need Diameter support,
+ please use the <acronym>ims_charging</acronym> module.
</para>
<para>
To account a transaction and to choose which set of backends to be
@@ -1555,37 +1554,6 @@ acc_request("100 Received", "acc");
acc_request("100 Received", "acc_$time(year)_$time(mon)");
acc_db_request("$var(code) $avp(reason)", "acc");
...
-</programlisting>
- </example>
- </section>
- <section id="acc.f.acc_diam_request">
- <title>
- <function moreinfo="none">acc_diam_request(comment)</function>
- </title>
- <para>
- Like <function moreinfo="none">acc_log_request</function>,
- <function moreinfo="none">acc_diam_request</function> reports on
- a request. It reports to the configured Diameter server.
- </para>
- <para>
- Meaning of the parameters is as follows:</para>
- <itemizedlist>
- <listitem>
- <para><emphasis>comment</emphasis> - Comment to be appended.
- The string can contain any number of pseudo-variables.
- </para>
- </listitem>
- </itemizedlist>
- <para>
- This function can be used from ANY_ROUTE.
- </para>
- <example>
- <title>acc_diam_request usage</title>
- <programlisting format="linespecific">
-...
-acc_diam_request("Some comment");
-acc_diam_request("$var(code) Error: $avp(reason)");
-...
</programlisting>
</example>
</section>
#### Pre-Submission Checklist
- [x] 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)
- [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:
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
Wireshark project allows embedding session encryption keys into PCAP files. So it allows parsing encrypted packets as it was unencrypted.
[More info](https://blog.didierstevens.com/2021/01/11/decrypting-tls-streams-with…
I prepared a change that allows export session encryption keys.
Please review PR. If ok, then I add commits with DocBook info.
Kyys may be emeberd using command
```
editcap --inject-secrets tls,/var/lib/kamailio/session_keylog encrypted.pcap with_keys.pcapng
```
As prototype used
https://github.com/openssl/openssl/blob/master/apps/lib/s_cb.c#L1480-L1525
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2785
-- Commit Summary --
* tls: added new session_keylog_enable and session_keylog_filename configuration params
* tls: first interation of session key logger
* tls: added logs output
-- File Changes --
M src/modules/tls/tls_cfg.c (6)
M src/modules/tls/tls_cfg.h (2)
M src/modules/tls/tls_init.c (79)
M src/modules/tls/tls_init.h (2)
M src/modules/tls/tls_mod.c (2)
M src/modules/tls/tls_rpc.c (2)
M src/modules/tls/tls_server.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2785.patchhttps://github.com/kamailio/kamailio/pull/2785.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/2785
Hello,
As mobile applications based on kamailio are growing exponentially on Play Store and App Store, i would suggest if you could add by default the code for ios/android push notifications.
I have problems mainly for incoming call (phone wakeup) on linphone iphone app, as kamailio is missing the push solution. On Android i am using Baresip and works perfect without push.
Navigating on the web, i found some uncomplete or minimum tutorials to implement this.
Like: https://denys-pozniak.medium.com/apple-push-notification-with-kamailio-eeca…
And also some code snippets of a modification of "kamailio.cfg" to add support for ios push notifications. (see below).
Could someone have this already working? Or kamailio official developers could add this by default inside source code?
`# keep a record of an IPhone for 4 hours
modparam("htable", "htable", "iphone_remote=>size=10;autoexpire=14400;")
modparam("htable", "htable", "iphone_voip=>size=10;autoexpire=14400;")
modparam("htable", "htable", "iphone_check=>size=10;autoexpire=14400;")
modparam("htable", "htable", "vtp=>size=10;autoexpire=120;")
route[REGISTRAR] {
...
...
if (save("location")) {
# user registered, now look at the useragent header for iPhone string
if ($hdr(User-Agent)=~"LinphoneiOS.*") {
$var(uri) = @contact.uri; # select the uri from contact header
$var(pn-prid) = $(var(uri){uri.param,pn-prid}); # get the uri param pn-prid from the uri, i.e. 1DF26BC10F597676B
xlog("!!!! - $var(pn-prid)");
$var(i) = 0;
$var(n) = $(var(pn-prid){s.count,&});
while( $var(i) <= $var(n)) {
$var(pn-prid_item) = $(var(pn-prid){s.select,$var(i),&});
$var(pn-prid_type) = $(var(pn-prid_item){s.select,1,:});
$var(pn-prid_token) = $(var(pn-prid_item){s.select,0,:});
if ( $var(pn-prid_type) == "remote" ) {
$var(pn-prid_remote) = $(var(pn-prid_item){s.select,0,:}) ;
}
if ( $var(pn-prid_type) == "voip" ) {
$var(pn-prid_voip) = $(var(pn-prid_item){s.select,0,:}) ;
}
$var(i) = $var(i) + 1;
}
xlog("L_INFO","iPhone PUSH tokens for user $fU - remote: $var(pn-prid_remote), voip: $var(pn-prid_voip)");
# store the values of tokens to htable with fromUser as key
$sht(iphone_remote=>$fU) = $var(pn-prid_remote);
$sht(iphone_voip=>$fU) = $var(pn-prid_voip);
$sht(iphone_check=>$fU) = 1;
if ( $sht(vtp=>id_index::$tU) != $null ) {
xlog("L_INFO", "New $rm ru=$ru tu=$tu \n");
route(JOIN);
}
} else {
# no iphone
$sht(iphone_check=>$fU) = 0;
}
...
...
}
route[LOCATION] {
...
...
if (!lookup("location")) {
$var(rc) = $rc;
# handle PUSH notifications for iPhone
# iphones should not be registered and contacts stored in database
# hence lookup should fail and we need to try to push iphone first
if ($sht(iphone_check=>$tU) == 1) {
xlog("L_ERR", "[PUSH] The to user has already used iPhone, trying push notifications");
xlog("L_ERR", "[PUSH] No registration to try, suspending.");
sl_send_reply("100", "Suspending");
route(SUSPEND);
route(RELAY);
exit;
}
...
...
if (is_method("INVITE")) {
setflag(FLT_ACCMISSED);
# handle PUSH notifications for iPhone
# in some cases, iphone does not send de-register when going to background
# for these circumstances, push iphone even if it has an active registration
if ($sht(iphone_check=>$tU) == 1) {
xlog("L_ERR", "[PUSH] The to user has already used iPhone, trying push notifications");
xlog("L_ERR", "[PUSH] No registration to try, suspending.");
sl_send_reply("100", "Suspending");
route(SUSPEND);
}
}
route(RELAY);
exit;
}
route[SUSPEND] {
if ( !t_suspend() ) {
xlog("L_ERROR","[SUSPEND] failed suspending trasaction [$T(id_index):$T(id_label)]\n");
send_reply("501", "Suspending error");
exit;
} else {
xlog("L_INFO","[SUSPEND] suspended transaction [$T(id_index):$T(id_label)] $fU=> $rU\n");
$sht(vtp=>id_index::$rU) = $T(id_index);
$sht(vtp=>id_label::$rU) = $T(id_label);
xlog("L_INFO","[SUSPEND] htable key value [$sht(vtp=>id_index::$rU) -- $sht(vtp=>id_label::$rU)]\n");
route(SENDPUSH);
exit;
}
}
route[SENDPUSH] {
#http_client_query("http://url/push.php"<http://url/push.php>, "user=$rU\r\npn-tok=$sht(tokens=>$rU)\r\n","Content-Type: text/plain", "$var(result)");
xlog("!!!!!!!!!!!!!!!!!!!!!! PUSH !!!!!!!!!!!!!!!!!!!");
xlog("/opt/push/push.sh $ci $sht(iphone_voip=>$tU)");
exec_avp("/opt/push/push.sh $ci $sht(iphone_voip=>$tU)");
xlog("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
sl_send_reply("100", "Pushing");
}
route[JOIN] {
xlog("L_WARN","[JOIN] htable key value [$sht(vtp=>id_index::$tU) -- $sht(vtp=>id_label::$tU)]\n");
t_continue("$sht(vtp=>id_index::$tU)", "$sht(vtp=>id_label::$tU)", "RESUME");
$sht(vtp=>joined::$tU) = 1;
}
route[RESUME] {
lookup("location");
xlog("L_INFO","[RESUME] rm=$rm ru=$ru du=$du \n");
t_relay();
$sht(vtp=>id_index::$tU) = $null;
$sht(vtp=>id_label::$tU) = $null;
exit; }
`
--
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/2793
…freeing memory
<!-- 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
- [x] 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
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
as per @miconda's suggestion, added memory checks
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2792
-- Commit Summary --
* nats: make sure pkg & shm memory is allocated; check pointers before freeing memory
-- File Changes --
M src/modules/nats/nats_mod.c (69)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2792.patchhttps://github.com/kamailio/kamailio/pull/2792.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/2792
Hello,
As mobile applications based on kamailio are growing exponentially on Play Store and App Store, i would suggest if you could add by default the code for ios/android push notifications.
I have problems mainly for incoming call (phone wakeup) on linphone iphone app, as kamailio is missing the push solution. On Android i am using Baresip and works perfect without push.
Navigating on the web, i found some uncomplete or minimum tutorials to implement this.
Like: https://denys-pozniak.medium.com/apple-push-notification-with-kamailio-eeca…
And also some code snippets of a modification of "kamailio.cfg" to add support for ios push notifications. (see below).
Could someone have this already working? Or kamailio official developers could add this by default inside source code?
# keep a record of an IPhone for 4 hours
modparam("htable", "htable", "iphone_remote=>size=10;autoexpire=14400;")
modparam("htable", "htable", "iphone_voip=>size=10;autoexpire=14400;")
modparam("htable", "htable", "iphone_check=>size=10;autoexpire=14400;")
modparam("htable", "htable", "vtp=>size=10;autoexpire=120;")
route[REGISTRAR] {
...
...
if (save("location")) {
# user registered, now look at the useragent header for iPhone string
if ($hdr(User-Agent)=~"LinphoneiOS.*") {
$var(uri) = @contact.uri; # select the uri from contact header
$var(pn-prid) = $(var(uri){uri.param,pn-prid}); # get the uri param pn-prid from the uri, i.e. 1DF26BC10F597676B
xlog("!!!! - $var(pn-prid)");
$var(i) = 0;
$var(n) = $(var(pn-prid){s.count,&});
while( $var(i) <= $var(n)) {
$var(pn-prid_item) = $(var(pn-prid){s.select,$var(i),&});
$var(pn-prid_type) = $(var(pn-prid_item){s.select,1,:});
$var(pn-prid_token) = $(var(pn-prid_item){s.select,0,:});
if ( $var(pn-prid_type) == "remote" ) {
$var(pn-prid_remote) = $(var(pn-prid_item){s.select,0,:}) ;
}
if ( $var(pn-prid_type) == "voip" ) {
$var(pn-prid_voip) = $(var(pn-prid_item){s.select,0,:}) ;
}
$var(i) = $var(i) + 1;
}
xlog("L_INFO","iPhone PUSH tokens for user $fU - remote: $var(pn-prid_remote), voip: $var(pn-prid_voip)");
# store the values of tokens to htable with fromUser as key
$sht(iphone_remote=>$fU) = $var(pn-prid_remote);
$sht(iphone_voip=>$fU) = $var(pn-prid_voip);
$sht(iphone_check=>$fU) = 1;
if ( $sht(vtp=>id_index::$tU) != $null ) {
xlog("L_INFO", "New $rm ru=$ru tu=$tu \n");
route(JOIN);
}
} else {
# no iphone
$sht(iphone_check=>$fU) = 0;
}
...
...
}
route[LOCATION] {
...
...
if (!lookup("location")) {
$var(rc) = $rc;
# handle PUSH notifications for iPhone
# iphones should not be registered and contacts stored in database
# hence lookup should fail and we need to try to push iphone first
if ($sht(iphone_check=>$tU) == 1) {
xlog("L_ERR", "[PUSH] The to user has already used iPhone, trying push notifications");
xlog("L_ERR", "[PUSH] No registration to try, suspending.");
sl_send_reply("100", "Suspending");
route(SUSPEND);
route(RELAY);
exit;
}
...
...
if (is_method("INVITE")) {
setflag(FLT_ACCMISSED);
# handle PUSH notifications for iPhone
# in some cases, iphone does not send de-register when going to background
# for these circumstances, push iphone even if it has an active registration
if ($sht(iphone_check=>$tU) == 1) {
xlog("L_ERR", "[PUSH] The to user has already used iPhone, trying push notifications");
xlog("L_ERR", "[PUSH] No registration to try, suspending.");
sl_send_reply("100", "Suspending");
route(SUSPEND);
}
}
route(RELAY);
exit;
}
route[SUSPEND] {
if ( !t_suspend() ) {
xlog("L_ERROR","[SUSPEND] failed suspending trasaction [$T(id_index):$T(id_label)]\n");
send_reply("501", "Suspending error");
exit;
} else {
xlog("L_INFO","[SUSPEND] suspended transaction [$T(id_index):$T(id_label)] $fU=> $rU\n");
$sht(vtp=>id_index::$rU) = $T(id_index);
$sht(vtp=>id_label::$rU) = $T(id_label);
xlog("L_INFO","[SUSPEND] htable key value [$sht(vtp=>id_index::$rU) -- $sht(vtp=>id_label::$rU)]\n");
route(SENDPUSH);
exit;
}
}
route[SENDPUSH] {
#http_client_query("http://url/push.php"<http://url/push.php>, "user=$rU\r\npn-tok=$sht(tokens=>$rU)\r\n","Content-Type: text/plain", "$var(result)");
xlog("!!!!!!!!!!!!!!!!!!!!!! PUSH !!!!!!!!!!!!!!!!!!!");
xlog("/opt/push/push.sh $ci $sht(iphone_voip=>$tU)");
exec_avp("/opt/push/push.sh $ci $sht(iphone_voip=>$tU)");
xlog("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
sl_send_reply("100", "Pushing");
}
route[JOIN] {
xlog("L_WARN","[JOIN] htable key value [$sht(vtp=>id_index::$tU) -- $sht(vtp=>id_label::$tU)]\n");
t_continue("$sht(vtp=>id_index::$tU)", "$sht(vtp=>id_label::$tU)", "RESUME");
$sht(vtp=>joined::$tU) = 1;
}
route[RESUME] {
lookup("location");
xlog("L_INFO","[RESUME] rm=$rm ru=$ru du=$du \n");
t_relay();
$sht(vtp=>id_index::$tU) = $null;
$sht(vtp=>id_label::$tU) = $null;
exit; }
Module: kamailio
Branch: master
Commit: b92b931c26c199b756fd08e9c80cc9305469fd2b
URL: https://github.com/kamailio/kamailio/commit/b92b931c26c199b756fd08e9c80cc93…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-06-29T08:55:32+02:00
core: str list - added function to insert a block string in list
---
Modified: src/core/str_list.c
Modified: src/core/str_list.h
---
Diff: https://github.com/kamailio/kamailio/commit/b92b931c26c199b756fd08e9c80cc93…
Patch: https://github.com/kamailio/kamailio/commit/b92b931c26c199b756fd08e9c80cc93…
---
diff --git a/src/core/str_list.c b/src/core/str_list.c
index f63b4c9151..207cee5bc3 100644
--- a/src/core/str_list.c
+++ b/src/core/str_list.c
@@ -13,13 +13,13 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
- * @file
+ * @file
* @brief Kamailio core :: Simple str type list and helper functions
* @ingroup core
* Module: @ref core
@@ -32,7 +32,7 @@
/**
* @brief Add a new allocated list element to an existing list
- *
+ *
* Add a new allocated list element to an existing list, the allocation is done
* from the private memory pool
* @param s input character
@@ -43,18 +43,45 @@
*/
struct str_list *append_str_list(char *s, int len, struct str_list **last, int *total)
{
- struct str_list *new;
- new = pkg_malloc(sizeof(struct str_list));
- if (!new) {
+ struct str_list *nv;
+ nv = pkg_malloc(sizeof(struct str_list));
+ if (!nv) {
PKG_MEM_ERROR;
return 0;
}
- new->s.s = s;
- new->s.len = len;
- new->next = 0;
+ nv->s.s = s;
+ nv->s.len = len;
+ nv->next = 0;
- (*last)->next = new;
- *last = new;
+ (*last)->next = nv;
+ *last = nv;
*total += len;
- return new;
+ return nv;
+}
+
+/**
+ * @brief Add a new allocated list element with cloned block value to an existing list
+ *
+ * Add a new allocated list element with cloned value in block to an existing list,
+ * the allocation is done from the private memory pool
+ * @param head existing list
+ * @param s input character
+ * @param len length of input character
+ * @return extended list
+ */
+str_list_t *str_list_block_add(str_list_t **head, char *s, int len)
+{
+ str_list_t *nv;
+ nv = pkg_mallocxz(sizeof(str_list_t) + (len+1)*sizeof(char));
+ if (!nv) {
+ PKG_MEM_ERROR;
+ return 0;
+ }
+ nv->s.s = (char*)nv + sizeof(str_list_t);
+ memcpy(nv->s.s, s, len);
+ nv->s.len = len;
+ nv->next = *head;
+ *head = nv;
+
+ return nv;
}
diff --git a/src/core/str_list.h b/src/core/str_list.h
index db3fa12887..1eac2578b0 100644
--- a/src/core/str_list.h
+++ b/src/core/str_list.h
@@ -51,4 +51,16 @@ typedef struct str_list {
*/
struct str_list *append_str_list(char *s, int len, struct str_list **last, int *total);
+/**
+ * @brief Add a new allocated list element with cloned block value to an existing list
+ *
+ * Add a new allocated list element with cloned value in block to an existing list,
+ * the allocation is done from the private memory pool
+ * @param head existing list
+ * @param s input character
+ * @param len length of input character
+ * @return extended list
+ */
+str_list_t *str_list_block_add(str_list_t **head, char *s, int len);
+
#endif
<!-- 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 -->
New Module to consume messages from NATS messaging system.
Initial Features:
- automatic reconnect with connected/disconnected event routes
- connect to up to 10 NATS URLs
- subscribe to any number of subjects
- receive messages via event route
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2790
-- Commit Summary --
* nats: new nats message consumer module
-- File Changes --
A src/modules/nats/Makefile (16)
A src/modules/nats/doc/Makefile (4)
A src/modules/nats/doc/nats.xml (42)
A src/modules/nats/doc/nats_admin.xml (207)
A src/modules/nats/nats_mod.c (569)
A src/modules/nats/nats_mod.h (99)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2790.patchhttps://github.com/kamailio/kamailio/pull/2790.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/2790
**defined but not used**
```
rtpproxy.c:943:1: warning: ‘rp_extract_mediaip’ defined but not used [-Wunused-function]
rp_extract_mediaip(str *body, str *mediaip, int *pf, char *line)
^~~~~~~~~~~~~~~~~~
CC (gcc) [M rtpproxy.so] rtpproxy_db.o
make[3]: 'libsrdb1.so.1.0' is up to date.
```
--
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/2787
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If you submit a feature request (or enhancement) add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
Hello everyone, is module pua_json going to be implemented for KEMI framework?
I've tried to use KSR.x.modf("pua_json_publish", "json_here") and I'm getting error
### python code
```
def ksr_xhttp_event(self, evmsg, evname):
if evname == "xhttp:request":
try:
KSR.err("===== xhttp module triggered event: " + evname + "\n")
if "/presence" in KSR.pv.get("$hu"):
rb = json.loads(KSR.kx.get_body())
if rb["Event-Package"] == "message-summary":
KSR.info("request received- " + rb["Call-ID"] + "update for: " + rb[
"From"] + "request body: " + json.dumps(rb) + "\n")
KSR.x.modf("pua_json_publish", json.dumps(rb));
KSR.xhttp.xhttp_reply(200, "OK", "text/html", "<html><body>Entity state updated</body></html>")
return 1
if "/RCP" in KSR.pv.get("$hu"):
KSR.jsonrpcs.dispatch()
return 1
else:
KSR.xhttp.xhttp_reply(200, "OK", "text/html", "<html><body>Wrong URL</body></html>")
return 1
except:
KSR.err("===== unsupported " + evname + "\n")
return -255
```
#### Debugging Data
```
app_python [python_support.c:154]: python_handle_exception(): apy_exec: ksr_xhttp_event(xhttp:request): Unhandled exception in the Python code:
RuntimeError: self is NULL
```
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.4.5 (x86_64/linux) c46342
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, 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, TLS_PTHREAD_MUTEX_SHARED
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: c46342
compiled on 14:37:00 Apr 27 2021 with gcc 7.5.0
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->
```
Linux ip-10-199-240-110 4.15.0-1057-aws #59-Ubuntu SMP Wed Dec 4 10:02:00 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
```
--
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/2783