Hi,
is there a known reason not to store early state dialogs in db?
I have some logic relaying on event_route exported by dialog module and that logic breaks for non confirmed dialogs when a switch-over happens since those dialogs are not loaded from db.
Thanks in advance, Victor
Hi Victor,
I guess it was done because of easier implementation and also DB load considerations.
I planned to add functionality to make it configurable in git master it this week, as I also have the requirements in one of my projects.
Cheers,
Henning
Dear all
this would be related to one query we sent to sr-users some time ago? https://lists.kamailio.org/pipermail/sr-users/2018-November/103842.html
we would also be interested in having the dialog structure to be written on db_redis during early dialog, but it still was in a to do list according to Daniel. This would great to be able to track and store the dialogs on a db redis for HA.
thanks a lot and regards david
El mié., 10 jun. 2020 a las 11:25, Henning Westerholt (hw@skalatan.de) escribió:
Hi Victor,
I guess it was done because of easier implementation and also DB load considerations.
I planned to add functionality to make it configurable in git master it this week, as I also have the requirements in one of my projects.
Cheers,
Henning
-- Henning Westerholt – https://skalatan.de/blog/ Kamailio services – https://gilawa.com
-----Original Message----- From: sr-dev sr-dev-bounces@lists.kamailio.org On Behalf Of Victor Seva Sent: Wednesday, June 10, 2020 10:32 AM To: Kamailio Devel List sr-dev@lists.sip-router.org Subject: [sr-dev] dialog: reason behind not storing early state dialogs in db
Hi,
is there a known reason not to store early state dialogs in db?
I have some logic relaying on event_route exported by dialog module and that logic breaks for non confirmed dialogs when a switch-over happens since those dialogs are not loaded from db.
Thanks in advance, Victor
Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Hello David, Hello Victor,
added with 37d83a5838a50350. Feedback and additional testing are of course welcome.
Cheers,
Henning
-- Henning Westerholt – https://skalatan.de/blog/ Kamailio services – https://gilawa.comhttps://gilawa.com/
From: sr-dev sr-dev-bounces@lists.kamailio.org On Behalf Of David Escartin Sent: Friday, June 12, 2020 7:32 AM To: Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org Cc: Kamailio Devel List sr-dev@lists.sip-router.org Subject: Re: [sr-dev] dialog: reason behind not storing early state dialogs in db
Dear all
this would be related to one query we sent to sr-users some time ago? https://lists.kamailio.org/pipermail/sr-users/2018-November/103842.html
we would also be interested in having the dialog structure to be written on db_redis during early dialog, but it still was in a to do list according to Daniel. This would great to be able to track and store the dialogs on a db redis for HA.
thanks a lot and regards david
El mié., 10 jun. 2020 a las 11:25, Henning Westerholt (<hw@skalatan.demailto:hw@skalatan.de>) escribió: Hi Victor,
I guess it was done because of easier implementation and also DB load considerations.
I planned to add functionality to make it configurable in git master it this week, as I also have the requirements in one of my projects.
Cheers,
Henning
-- Henning Westerholt – https://skalatan.de/blog/ Kamailio services – https://gilawa.com
-----Original Message----- From: sr-dev <sr-dev-bounces@lists.kamailio.orgmailto:sr-dev-bounces@lists.kamailio.org> On Behalf Of Victor Seva Sent: Wednesday, June 10, 2020 10:32 AM To: Kamailio Devel List <sr-dev@lists.sip-router.orgmailto:sr-dev@lists.sip-router.org> Subject: [sr-dev] dialog: reason behind not storing early state dialogs in db
Hi,
is there a known reason not to store early state dialogs in db?
I have some logic relaying on event_route exported by dialog module and that logic breaks for non confirmed dialogs when a switch-over happens since those dialogs are not loaded from db.
Thanks in advance, Victor
_______________________________________________ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.orgmailto:sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Hi Henning,
On 6/12/20 10:31 AM, Henning Westerholt wrote:
added with 37d83a5838a50350. Feedback and additional testing are of course welcome.
Applied 37d83a5838a50350 but I don't see any insert to the db until dialog is confirmed.
``modparam("dialog","db_mode", 1)`` is in the config
``` Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: New request on proxy - M=INVITE R=«sip:43993002@192.168.1.102» F=«sip:43993003@192.168.1.102» T=«sip:43993002@192.168.1.102» IP=«192.168.1.123»:«5068» («127.0.0.1»:«5060») ID=«ephgtzmqykl gppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1' DESTIP=«127.0.0.1»:«5062» Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: Sending reply S=100 Trying M=INVITE fs='«127.0.0.1»:«5062»' du='«127.0.0.1»:«5060»' - R=«sip:43993002@192.168.1.102» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1 ' ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_hash.c:480]: build_new_dlg(): new dialog on hash 380 ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_db_handler.c:835]: update_dialog_dbinfo_unsafe(): updated 4 vars for dlg [380:4617] ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_profile.c:536]: set_current_dialog(): setting current dialog [380:4617] ... Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: Sending reply S=100 Trying M=INVITE fs='«127.0.0.1»:«5062»' du='«127.0.0.1»:«5060»' - R=«sip:43993002@192.168.1.102» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1' ... Jun 12 13:47:01 sp1 proxy[31634]: NOTICE: REPLY_ROUTE_NAT <script>: NAT-Reply - S=180 - Ringing M=INVITE IP=«192.168.1.123»:«5068» («127.0.0.1»:«5080») ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' DESTIP=«127.0.0.1»:«5062» ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: REPLY_ROUTE_NAT tmx [t_var.c:539]: pv_get_tm_reply_code(): reply code is <180> ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: REPLY_ROUTE_NAT dialog [dlg_hash.c:789]: dlg_lookup_mode(): dialog id=4617 found on entry 380 ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_hash.c:1264]: next_state_dlg(): dialog 0x7fd87d250e88 changed from state 1 to state 2, due event 2 (ref 2) Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_cb.c:271]: run_dlg_callbacks(): dialog=0x7fd87d250e88, type=256 ```
Nothing gets written in the dialog table until
``` Jun 12 13:47:25 sp1 proxy[31634]: NOTICE: REPLY_ROUTE_NAT <script>: NAT-Reply - S=200 - Answering M=INVITE IP=«192.168.1.123»:«5068» («127.0.0.1»:«5080») ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' DESTIP=«127.0.0.1»:«5062» ... Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_hash.c:1264]: next_state_dlg(): dialog 0x7fd87d250e88 changed from state 2 to state 3, due event 3 (ref 2) ... Jun 12 13:47:25 sp1 proxy[31634]: NOTICE: dialog:start <script>: [dialog:start] lua_dlg_callid:[«ephgtzmqyklgppz@debrock.torreviejawireless.org»] - R=«<null>» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' ... Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_handlers.c:512]: dlg_onreply(): dialog 0x7fd87d250e88 confirmed (ACK pending) Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_handlers.c:259]: populate_leg_info(): leg(1) route_set [], contact [sip:127.0.0.1:5080;transport=udp], cseq [] and bind_addr [udp:127.0.0.1:5062] Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_db_handler.c:835]: update_dialog_dbinfo_unsafe(): updated 19 vars for dlg [380:4617] Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_db_handler.c:874]: update_dialog_dbinfo_unsafe(): sock_info is udp:127.0.0.1:5062 ```
Cheers, Victor
Added some debug to find out what is going on:
From: Victor Seva vseva@sipwise.com Date: Fri, 12 Jun 2020 16:32:41 +0200 Subject: dialog: more debug
src/modules/dialog/dlg_db_handler.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/modules/dialog/dlg_db_handler.c b/src/modules/dialog/dlg_db_handler.c index df43c7e..90e526c 100644 --- a/src/modules/dialog/dlg_db_handler.c +++ b/src/modules/dialog/dlg_db_handler.c @@ -837,7 +837,8 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell)
if(use_dialog_table()!=0) return -1;
LM_DBG("state:%d dflags:%d dlg [%d:%d]\n", cell->state, cell->dflags, cell->h_entry, cell->h_id);
srjson_InitDoc(&jdoc, NULL);
if((cell->dflags & DLG_FLAG_NEW) != 0){
@@ -909,7 +910,7 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell)
VAL_NULL(values+22) = 0; VAL_INT(values+22) = cell->iflags;
if((dialog_dbf.insert(dialog_db_handle, insert_keys, values, DIALOG_TABLE_COL_NO)) !=0){ LM_ERR("could not add another dialog to db\n");LM_DBG("insert dlg [%d:%d]\n", cell->h_entry, cell->h_id);
@@ -941,7 +942,7 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell) VAL_NULL(values+10) = VAL_NULL(values+11) = VAL_NULL(values+12) = VAL_NULL(values+13) = VAL_NULL(values+14) = VAL_NULL(values+15) = 0;
if((dialog_dbf.update(dialog_db_handle, (insert_keys), 0, (values), (insert_keys+10), (values+10), 2, 6)) !=0){ LM_ERR("could not update database info\n");LM_DBG("update dlg [%d:%d]\n", cell->h_entry, cell->h_id);
@@ -949,6 +950,7 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell) } cell->dflags &= ~(DLG_FLAG_CHANGED); } else {
return 0; }LM_DBG("skip dlg [%d:%d]\n", cell->h_entry, cell->h_id);
Jun 12 16:46:05 sp1 proxy[6037]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_hash.c:955]: dlg_search(): dialog with callid='aimoskeqqzmpizv@debrock.torreviejawireless.org' not found Jun 12 16:46:05 sp1 proxy[6037]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_hash.c:480]: build_new_dlg(): new dialog on hash 1705 Jun 12 16:46:05 sp1 proxy[6037]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_handlers.c:259]: populate_leg_info(): leg(0) route_set [sip:127.0.0.1;r2=on;lr=on;ftag=ejsmo;ngcplb=yes;nat=yes;socket=udp:192.168.1.102:5060,sip:192.168.1.102;r2=on;lr=on;ftag=ejsm o;ngcplb=yes;nat=yes;socket=udp:192.168.1.102:5060], contact [sip:43993003@192.168.1.123:5068;alias=192.168.1.123~5068~1], cseq [487] and bind_addr [udp:127.0.0.1:5062] Jun 12 16:46:05 sp1 proxy[6037]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_hash.c:1018]: link_dlg(): linking dialog [1705:12197] ... Jun 12 16:46:05 sp1 proxy[6037]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_hash.c:789]: dlg_lookup_mode(): dialog id=12197 found on entry 1705 Jun 12 16:46:05 sp1 proxy[6037]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_db_handler.c:835]: update_dialog_dbinfo_unsafe(): updated 5 vars for dlg [1705:12197] Jun 12 16:46:05 sp1 proxy[6037]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_db_handler.c:840]: update_dialog_dbinfo_unsafe(): state:1 dflags:0 dlg [1705:12197] Jun 12 16:46:05 sp1 proxy[6037]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_db_handler.c:953]: update_dialog_dbinfo_unsafe(): skip dlg [1705:12197]
Hi Victor,
thanks for the feedback, I will also do some more tests.
Cheers,
Henning
-----Original Message----- From: sr-dev sr-dev-bounces@lists.kamailio.org On Behalf Of Victor Seva Sent: Friday, June 12, 2020 2:34 PM To: Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org Subject: Re: [sr-dev] dialog: reason behind not storing early state dialogs in db
Hi Henning,
On 6/12/20 10:31 AM, Henning Westerholt wrote:
added with 37d83a5838a50350. Feedback and additional testing are of course welcome.
Applied 37d83a5838a50350 but I don't see any insert to the db until dialog is confirmed.
``modparam("dialog","db_mode", 1)`` is in the config
``` Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: New request on proxy - M=INVITE R=«sip:43993002@192.168.1.102» F=«sip:43993003@192.168.1.102» T=«sip:43993002@192.168.1.102» IP=«192.168.1.123»:«5068» («127.0.0.1»:«5060») ID=«ephgtzmqykl gppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1' DESTIP=«127.0.0.1»:«5062» Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: Sending reply S=100 Trying M=INVITE fs='«127.0.0.1»:«5062»' du='«127.0.0.1»:«5060»' - R=«sip:43993002@192.168.1.102» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1 ' ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_hash.c:480]: build_new_dlg(): new dialog on hash 380 ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_db_handler.c:835]: update_dialog_dbinfo_unsafe(): updated 4 vars for dlg [380:4617] ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_profile.c:536]: set_current_dialog(): setting current dialog [380:4617] ... Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: Sending reply S=100 Trying M=INVITE fs='«127.0.0.1»:«5062»' du='«127.0.0.1»:«5060»' - R=«sip:43993002@192.168.1.102» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1' ... Jun 12 13:47:01 sp1 proxy[31634]: NOTICE: REPLY_ROUTE_NAT <script>: NAT-Reply - S=180 - Ringing M=INVITE IP=«192.168.1.123»:«5068» («127.0.0.1»:«5080») ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' DESTIP=«127.0.0.1»:«5062» ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: REPLY_ROUTE_NAT tmx [t_var.c:539]: pv_get_tm_reply_code(): reply code is <180> ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: REPLY_ROUTE_NAT dialog [dlg_hash.c:789]: dlg_lookup_mode(): dialog id=4617 found on entry 380 ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_hash.c:1264]: next_state_dlg(): dialog 0x7fd87d250e88 changed from state 1 to state 2, due event 2 (ref 2) Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_cb.c:271]: run_dlg_callbacks(): dialog=0x7fd87d250e88, type=256 ```
Nothing gets written in the dialog table until
``` Jun 12 13:47:25 sp1 proxy[31634]: NOTICE: REPLY_ROUTE_NAT <script>: NAT-Reply - S=200 - Answering M=INVITE IP=«192.168.1.123»:«5068» («127.0.0.1»:«5080») ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' DESTIP=«127.0.0.1»:«5062» ... Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_hash.c:1264]: next_state_dlg(): dialog 0x7fd87d250e88 changed from state 2 to state 3, due event 3 (ref 2) ... Jun 12 13:47:25 sp1 proxy[31634]: NOTICE: dialog:start <script>: [dialog:start] lua_dlg_callid:[«ephgtzmqyklgppz@debrock.torreviejawireless.org»] - R=«<null>» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' ... Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_handlers.c:512]: dlg_onreply(): dialog 0x7fd87d250e88 confirmed (ACK pending) Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_handlers.c:259]: populate_leg_info(): leg(1) route_set [], contact [sip:127.0.0.1:5080;transport=udp], cseq [] and bind_addr [udp:127.0.0.1:5062] Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_db_handler.c:835]: update_dialog_dbinfo_unsafe(): updated 19 vars for dlg [380:4617] Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_db_handler.c:874]: update_dialog_dbinfo_unsafe(): sock_info is udp:127.0.0.1:5062 ```
Cheers, Victor
One observation here: early dialogs are bound to the initial INVITE transaction. For this reason, early dialogs should not be restored from db because the transaction is no longer present (during failover or restart).
Thanks, Ovidiu
On Fri, Jun 12, 2020 at 3:35 PM Henning Westerholt hw@skalatan.de wrote:
Hi Victor,
thanks for the feedback, I will also do some more tests.
Cheers,
Henning
-----Original Message----- From: sr-dev sr-dev-bounces@lists.kamailio.org On Behalf Of Victor Seva Sent: Friday, June 12, 2020 2:34 PM To: Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org Subject: Re: [sr-dev] dialog: reason behind not storing early state dialogs in db
Hi Henning,
On 6/12/20 10:31 AM, Henning Westerholt wrote:
added with 37d83a5838a50350. Feedback and additional testing are of course welcome.
Applied 37d83a5838a50350 but I don't see any insert to the db until dialog is confirmed.
``modparam("dialog","db_mode", 1)`` is in the config
Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: New request on proxy - M=INVITE R=«sip:43993002@192.168.1.102» F=«sip:43993003@192.168.1.102» T=«sip:43993002@192.168.1.102» IP=«192.168.1.123»:«5068» («127.0.0.1»:«5060») ID=«ephgtzmqykl gppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1' DESTIP=«127.0.0.1»:«5062» Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: Sending reply S=100 Trying M=INVITE fs='«127.0.0.1»:«5062»' du='«127.0.0.1»:«5060»' - R=«sip:43993002@192.168.1.102» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1 ' ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_hash.c:480]: build_new_dlg(): new dialog on hash 380 ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_db_handler.c:835]: update_dialog_dbinfo_unsafe(): updated 4 vars for dlg [380:4617] ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_profile.c:536]: set_current_dialog(): setting current dialog [380:4617] ... Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: Sending reply S=100 Trying M=INVITE fs='«127.0.0.1»:«5062»' du='«127.0.0.1»:«5060»' - R=«sip:43993002@192.168.1.102» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1' ... Jun 12 13:47:01 sp1 proxy[31634]: NOTICE: REPLY_ROUTE_NAT <script>: NAT-Reply - S=180 - Ringing M=INVITE IP=«192.168.1.123»:«5068» («127.0.0.1»:«5080») ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' DESTIP=«127.0.0.1»:«5062» ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: REPLY_ROUTE_NAT tmx [t_var.c:539]: pv_get_tm_reply_code(): reply code is <180> ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: REPLY_ROUTE_NAT dialog [dlg_hash.c:789]: dlg_lookup_mode(): dialog id=4617 found on entry 380 ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_hash.c:1264]: next_state_dlg(): dialog 0x7fd87d250e88 changed from state 1 to state 2, due event 2 (ref 2) Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_cb.c:271]: run_dlg_callbacks(): dialog=0x7fd87d250e88, type=256 ``` Nothing gets written in the dialog table until
Jun 12 13:47:25 sp1 proxy[31634]: NOTICE: REPLY_ROUTE_NAT <script>: NAT-Reply - S=200 - Answering M=INVITE IP=«192.168.1.123»:«5068» («127.0.0.1»:«5080») ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' DESTIP=«127.0.0.1»:«5062» ... Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_hash.c:1264]: next_state_dlg(): dialog 0x7fd87d250e88 changed from state 2 to state 3, due event 3 (ref 2) ... Jun 12 13:47:25 sp1 proxy[31634]: NOTICE: dialog:start <script>: [dialog:start] lua_dlg_callid:[«ephgtzmqyklgppz@debrock.torreviejawireless.org»] - R=«<null>» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' ... Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_handlers.c:512]: dlg_onreply(): dialog 0x7fd87d250e88 confirmed (ACK pending) Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_handlers.c:259]: populate_leg_info(): leg(1) route_set [], contact [sip:127.0.0.1:5080;transport=udp], cseq [] and bind_addr [udp:127.0.0.1:5062] Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_db_handler.c:835]: update_dialog_dbinfo_unsafe(): updated 19 vars for dlg [380:4617] Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_db_handler.c:874]: update_dialog_dbinfo_unsafe(): sock_info is udp:127.0.0.1:5062 ```
Cheers, Victor
Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Hello,
yes - this is some concern I also had. In some cases you might be come around by just registering the proper call-back (like the uac module does). But of course, you don't have the transaction anymore.
I also found some more issues in the code related to this change. The DB insert/update code holds some assumption on the dialog flags and therefore it does not work without modification of this path. And this needs some more refactoring, therefore I reverted the patch for now in git master.
Cheers,
Henning
-----Original Message----- From: sr-dev sr-dev-bounces@lists.kamailio.org On Behalf Of Ovidiu Sas Sent: Saturday, June 13, 2020 9:04 PM To: Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org Subject: Re: [sr-dev] dialog: reason behind not storing early state dialogs in db
One observation here: early dialogs are bound to the initial INVITE transaction. For this reason, early dialogs should not be restored from db because the transaction is no longer present (during failover or restart).
Thanks, Ovidiu
On Fri, Jun 12, 2020 at 3:35 PM Henning Westerholt hw@skalatan.de wrote:
Hi Victor,
thanks for the feedback, I will also do some more tests.
Cheers,
Henning
-----Original Message----- From: sr-dev sr-dev-bounces@lists.kamailio.org On Behalf Of Victor Seva Sent: Friday, June 12, 2020 2:34 PM To: Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org Subject: Re: [sr-dev] dialog: reason behind not storing early state dialogs in db
Hi Henning,
On 6/12/20 10:31 AM, Henning Westerholt wrote:
added with 37d83a5838a50350. Feedback and additional testing are of course welcome.
Applied 37d83a5838a50350 but I don't see any insert to the db until dialog is confirmed.
``modparam("dialog","db_mode", 1)`` is in the config
Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: New request on proxy - M=INVITE R=«sip:43993002@192.168.1.102» F=«sip:43993003@192.168.1.102» T=«sip:43993002@192.168.1.102» IP=«192.168.1.123»:«5068» («127.0.0.1»:«5060») ID=«ephgtzmqykl gppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1' DESTIP=«127.0.0.1»:«5062» Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: Sending reply S=100 Trying M=INVITE fs='«127.0.0.1»:«5062»' du='«127.0.0.1»:«5060»' - R=«sip:43993002@192.168.1.102» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1 ' ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_hash.c:480]: build_new_dlg(): new dialog on hash 380 ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_db_handler.c:835]: update_dialog_dbinfo_unsafe(): updated 4 vars for dlg [380:4617] ... Jun 12 13:47:01 sp1 proxy[31630]: DEBUG: ROUTE_DLG_MANAGE dialog [dlg_profile.c:536]: set_current_dialog(): setting current dialog [380:4617] ... Jun 12 13:47:01 sp1 proxy[31630]: NOTICE: DEFAULT_ROUTE <script>: Sending reply S=100 Trying M=INVITE fs='«127.0.0.1»:«5062»' du='«127.0.0.1»:«5060»' - R=«sip:43993002@192.168.1.102» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='Twinkle/1.10.1' ... Jun 12 13:47:01 sp1 proxy[31634]: NOTICE: REPLY_ROUTE_NAT <script>: NAT-Reply - S=180 - Ringing M=INVITE IP=«192.168.1.123»:«5068» («127.0.0.1»:«5080») ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' DESTIP=«127.0.0.1»:«5062» ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: REPLY_ROUTE_NAT tmx [t_var.c:539]: pv_get_tm_reply_code(): reply code is <180> ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: REPLY_ROUTE_NAT dialog [dlg_hash.c:789]: dlg_lookup_mode(): dialog id=4617 found on entry 380 ... Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_hash.c:1264]: next_state_dlg(): dialog 0x7fd87d250e88 changed from state 1 to state 2, due event 2 (ref 2) Jun 12 13:47:01 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_cb.c:271]: run_dlg_callbacks(): dialog=0x7fd87d250e88, type=256 ``` Nothing gets written in the dialog table until
Jun 12 13:47:25 sp1 proxy[31634]: NOTICE: REPLY_ROUTE_NAT <script>: NAT-Reply - S=200 - Answering M=INVITE IP=«192.168.1.123»:«5068» («127.0.0.1»:«5080») ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' DESTIP=«127.0.0.1»:«5062» ... Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_hash.c:1264]: next_state_dlg(): dialog 0x7fd87d250e88 changed from state 2 to state 3, due event 3 (ref 2) ... Jun 12 13:47:25 sp1 proxy[31634]: NOTICE: dialog:start <script>: [dialog:start] lua_dlg_callid:[«ephgtzmqyklgppz@debrock.torreviejawireless.org»] - R=«<null>» ID=«ephgtzmqyklgppz@debrock.torreviejawireless.org» UA='<null>' ... Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_handlers.c:512]: dlg_onreply(): dialog 0x7fd87d250e88 confirmed (ACK pending) Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_handlers.c:259]: populate_leg_info(): leg(1) route_set [], contact [sip:127.0.0.1:5080;transport=udp], cseq [] and bind_addr [udp:127.0.0.1:5062] Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_db_handler.c:835]: update_dialog_dbinfo_unsafe(): updated 19 vars for dlg [380:4617] Jun 12 13:47:25 sp1 proxy[31634]: DEBUG: <null> dialog [dlg_db_handler.c:874]: update_dialog_dbinfo_unsafe(): sock_info is udp:127.0.0.1:5062 ```
Cheers, Victor
Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev