### Description
I´m using kamailio´s sqlops-module on a postgresql database.
If the database server gets unreachable during operation, sqlops detects this and tries to reconnect:
```
14:40:48.784 WARNING: db_postgres [km_dbase.c:259]: db_postgres_submit_query(): postgres query command failed, connection status 1, error [no connection to the server]
14:40:48.784 DEBUG: db_postgres [km_dbase.c:262]: db_postgres_submit_query(): resetting the connection to postgress server
14:40:48.784 ERROR: db_postgres [km_dbase.c:267]: db_postgres_submit_query(): 0x7f80a8093680 PQsendQuery Error: could not connect to server: Connection refused
```
and finally, when the DB comes up again, succeeds in executing queries:
```
14:41:39.738 WARNING: db_postgres [km_dbase.c:259]: db_postgres_submit_query(): postgres query command failed, connection status 1, error [SSL connection has been closed unexpectedly]
14:41:39.739 DEBUG: db_postgres [km_dbase.c:262]: db_postgres_submit_query(): resetting the connection to postgress server
14:41:39.810 DEBUG: db_postgres [km_dbase.c:249]: db_postgres_submit_query(): sending query ok: 0x7f80a8093680 (1)
```
So, obviously the module can handle database outages well.
But if the DB is already down when kamailio is started, the cyclic reconnect does not work. Instead, kamailio fails to start immediately:
```
14:57:54.187 CRITICAL: <core> [main.c:1614]: main_loop(): Cannot fork
14:57:54.188 DEBUG: db_postgres [km_pg_con.c:112]: db_postgres_new_connection(): PQconnectdbParams(0x136bfb0)
14:57:54.188 DEBUG: <core> [core/sr_module.c:938]: init_mod_child(): idx 12 rank -1: rtimer [timer]
14:57:54.188 DEBUG: <core> [core/sr_module.c:938]: init_mod_child(): idx 12 rank -1: sqlops [timer]
14:57:54.188 DEBUG: <core> [core/sr_module.c:708]: find_mod_export_record(): found export of <db_bind_api> in module db_postgres [/usr/lib64/kamailio/modules/db_postgres.so]
14:57:54.188 DEBUG: <core> [db.c:209]: db_bind_mod(): using db bind api for db_postgres
14:57:54.188 DEBUG: <core> [db.c:314]: db_do_init2(): connection 0x7f23c0154120 not found in pool
14:57:54.188 DEBUG: db_postgres [km_pg_con.c:56]: db_postgres_new_connection(): db_id = 0x7f23c0154120
14:57:54.188 DEBUG: db_postgres [km_pg_con.c:70]: db_postgres_new_connection(): 0x7f23c0154380=pkg_malloc(80)
14:57:54.188 DEBUG: db_postgres [km_pg_con.c:84]: db_postgres_new_connection(): opening connection: postgres://xxxx:xxxx@xxxxxxxxxxxxxxxxxx
14:57:54.188 DEBUG: db_postgres [km_pg_con.c:112]: db_postgres_new_connection(): PQconnectdbParams(0x13a41e0)
14:57:54.188 ERROR: db_postgres [km_pg_con.c:115]: db_postgres_new_connection(): could not connect to server: Connection refused Is the server running on host "xxxxxxxxxxxx" () and accepting TCP/IP connections on port 5432?
14:57:54.188 ERROR: db_postgres [km_pg_con.c:148]: db_postgres_new_connection(): cleaning up 0x7f23c0154380=pkg_free()
14:57:54.188 ERROR: <core> [db.c:318]: db_do_init2(): could not add connection to the pool
14:57:54.188 ERROR: sqlops [sql_api.c:164]: sql_connect(): failed to connect to the database [cb]
14:57:54.188 ERROR: <core> [core/sr_module.c:942]: init_mod_child(): error while initializing module sqlops (/usr/lib64/kamailio/modules/sqlops.so) (idx: 12 rank: -1 desc: [timer])
14:57:54.189 ERROR: <core> [core/pt.c:340]: fork_process(): init_child failed for process 12, pid 24036, "timer"
14:57:54.189 CRITICAL: <core> [main.c:1691]: main_loop(): cannot fork timer process
14:57:54.189 ALERT: <core> [main.c:743]: handle_sigs(): child process 24009 exited normally, status=255
14:57:54.190 ALERT: <core> [main.c:743]: handle_sigs(): child process 24010 exited normally, status=255
14:57:54.190 ALERT: <core> [main.c:743]: handle_sigs(): child process 24011 exited normally, status=255
14:57:54.191 ALERT: <core> [main.c:743]: handle_sigs(): child process 24013 exited normally, status=255
14:57:54.191 ALERT: <core> [main.c:743]: handle_sigs(): child process 24015 exited normally, status=255
14:57:54.191 ALERT: <core> [main.c:743]: handle_sigs(): child process 24019 exited normally, status=255
14:57:54.191 ALERT: <core> [main.c:743]: handle_sigs(): child process 24030 exited normally, status=255
14:57:54.192 INFO: <core> [main.c:771]: handle_sigs(): terminating due to SIGCHLD
14:57:54.192 INFO: <core> [main.c:826]: sig_usr(): signal 15 received
14:57:54.192 INFO: <core> [main.c:826]: sig_usr(): signal 15 received
```
#### Reproduction
- use kamailio-script with sqlops
- stop kamailio
- stop database
- try to start kamailio
#### Log Messages
see above
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
kamailio 5.1.2 (x86_64/linux)
* **Operating System**:
RHEL 7.4 on x86_64
--
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/1681
<!--
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).
-->
### Description
rightnow, we can check using dlg.dlg_list command whether call is alive or not but this command will return all data about dialog. There should be a xmlrpc command that will just return whether call is alive or not.
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Expected behavior
#### Actual observed behavior
#### Debugging Data
```
(paste your debugging data here)
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your log messages here)
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a improvement.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
(paste your output here)
```
* **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`)
-->
```
root@ip-172-31-4-160:~# uname -a
Linux ip-172-31-4-160 3.13.0-143-generic #192-Ubuntu SMP Tue Feb 27 10:45:36 UTC 2018 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/1697
Module: kamailio
Branch: master
Commit: 1cfeb19dedee8b1ae3065dad61c33e43727dab32
URL: https://github.com/kamailio/kamailio/commit/1cfeb19dedee8b1ae3065dad61c33e4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-12-05T17:45:29+01:00
dialog: docs for rpc commmands dlg.list_match and dlg.list_match_ctx
---
Modified: src/modules/dialog/doc/dialog_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/1cfeb19dedee8b1ae3065dad61c33e4…
Patch: https://github.com/kamailio/kamailio/commit/1cfeb19dedee8b1ae3065dad61c33e4…
---
diff --git a/src/modules/dialog/doc/dialog_admin.xml b/src/modules/dialog/doc/dialog_admin.xml
index 35e22d3166..ca0109b31f 100644
--- a/src/modules/dialog/doc/dialog_admin.xml
+++ b/src/modules/dialog/doc/dialog_admin.xml
@@ -2401,6 +2401,56 @@ if(has_totag()) {
</programlisting>
</section>
+ <section id="dlg.r.list_match">
+ <title>dlg.list_match</title>
+ <para>
+ Lists the details of matching dialogs. The paramters specify the matching
+ key, operator, value and optionally a limit of matched dialogs.
+ </para>
+ <para>Name: <emphasis>dlg.list_match</emphasis></para>
+ <para>Parameters:</para>
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>mkey</emphasis> - matching key. It can be: 'ruri' -
+ match against R-URI of the dialog; 'furi' - match against From
+ header URI of the dialog; 'turi' - match against the To header
+ URI of the dialog; 'callid' - match against Call-Id value.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>mop</emphasis> - matching operator. It can be: 'eq' -
+ match using string comparison; 're' - match using regular
+ expression; 'sw' - match using starts-with (prefix) comparison.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>mval</emphasis> - matching value.
+ </para></listitem>
+ </itemizedlist>
+ <para>RPC Command Format:</para>
+ <programlisting format="linespecific">
+...
+&kamcmd; dlg.list_match furi eq sip:alice@test.com 2
+...
+&kamcmd; dlg.list_match furi sw sip:alice@
+...
+ </programlisting>
+ </section>
+
+ <section id="dlg.r.list_match_ctx">
+ <title>dlg.list_match_ctx</title>
+ <para>
+ Similar to <quote>dlg.list_match</quote>, but including in the
+ attributes associated with the dialog context from modules sitting on
+ top of the dialog module.
+ </para>
+ <para>Name: <emphasis>dlg.list_match_ctx</emphasis></para>
+ <para>RPC Command Format:</para>
+ <programlisting format="linespecific">
+...
+&kamcmd; dlg.list_match_ctx furi sw sip:alice@
+...
+ </programlisting>
+ </section>
+
<section id="dlg.r.dlg_list">
<title>dlg.dlg_list</title>
<para>
@@ -2430,7 +2480,7 @@ if(has_totag()) {
<section id="dlg.r.dlg_list_ctx">
<title>dlg.dlg_list_ctx</title>
<para>
- The same as the <quote>dlg.list_ctx</quote> but including in the dialog
+ The same as the <quote>dlg.list_list</quote> but including in the dialog
description the associated context from modules sitting on top of
the dialog module.
</para>
<!-- 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
This RPC command will help us to find out whether call is alive or not. Basically this command will return error if call is not alive (confirmed) else it will return string with dialog is alive.
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1740
-- Commit Summary --
* Merge pull request #1 from kamailio/master
* Module: Dialog xmlrpc isalive rpc command added
-- File Changes --
M src/modules/dialog/dialog.c (35)
M src/modules/dialog/doc/dialog.xml (5)
M src/modules/dialog/doc/dialog_admin.xml (28)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1740.patchhttps://github.com/kamailio/kamailio/pull/1740.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/1740