Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dialog: adding dialog replication via DMQ #831

Merged
merged 2 commits into from
Oct 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions modules/dialog/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
#include "dlg_var.h"
#include "dlg_transfer.h"
#include "dlg_cseq.h"
#include "dlg_dmq.h"

MODULE_VERSION

Expand Down Expand Up @@ -107,6 +108,8 @@ static int dlg_timer_procs = 0;
static int _dlg_track_cseq_updates = 0;
int dlg_ka_failed_limit = 1;

int dlg_enable_dmq = 0;

int dlg_event_rt[DLG_EVENTRT_MAX];

str dlg_bridge_controller = str_init("sip:controller@kamailio.org");
Expand Down Expand Up @@ -296,6 +299,7 @@ static param_export_t mod_params[]={
{ "lreq_callee_headers", PARAM_STR, &dlg_lreq_callee_headers },
{ "db_skip_load", INT_PARAM, &db_skip_load },
{ "ka_failed_limit", INT_PARAM, &dlg_ka_failed_limit },
{ "enable_dmq", INT_PARAM, &dlg_enable_dmq },
{ 0,0,0 }
};

Expand Down Expand Up @@ -712,6 +716,11 @@ static int mod_init(void)
dlg_register_cseq_callbacks();
}

if (dlg_enable_dmq>0 && dlg_dmq_initialize()!=0) {
LM_ERR("failed to initialize dmq integration\n");
return -1;
}

return 0;
}

Expand Down
6 changes: 6 additions & 0 deletions modules/dialog/dlg_db_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,12 @@ static int load_dialog_info_from_db(int dlg_hash_size, int fetch_num_rows)
srjson_DestroyDoc(&jdoc);
}
dlg->iflags = (unsigned int)VAL_INT(values+22);

if (!dlg->bind_addr[DLG_CALLER_LEG] || !dlg->bind_addr[DLG_CALLEE_LEG]) {
/* non-local socket, probably not our dialog */
dlg->iflags &= ~DLG_IFLAG_DMQ_SYNC;
}

if(dlg->state==DLG_STATE_DELETED) {
/* end_ts used for force clean up not stored - set it to now */
dlg->end_ts = (unsigned int)time(0);
Expand Down