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

Fix no cdr after restart #1606

Closed
wants to merge 1 commit into from
Closed

Fix no cdr after restart #1606

wants to merge 1 commit into from

Conversation

kosza
Copy link

@kosza kosza commented Jul 27, 2018

Pre-Submission Checklist

  • 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:

  • PR should be backported to stable branches
  • Tested changes locally
  • Related to issue #XXXX (replace XXXX with an open issue number)

Description

dialog: fix to get CDRs after restart

The problem is that if kamailio is restarted during a call the cdr would not be created. 

The run_load_callbacks() should be called after acc module was loaded.
The acc module will setup DLGCB_LOADED type callback. So run_load_callbacks() should be delayed and run only once, the child_init(PROC_MAIN) is perfect for it.

version: kamailio 5.1.4 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 15:11:36 Jul 20 2018 with gcc 7.3.0

The run_load_callbacks() should be call after acc module is loaded.
The acc module will setup DLGCB_LOADED type callback. So run_load_callbacks() should be delayed and run only once, the child_init(PROC_MAIN) is perfect for it.
@miconda
Copy link
Member

miconda commented Jul 27, 2018

Thank for digging into it and coming with a fix.
Can you reformat the commit message so it matches the contributions guide:

So, the it should be like:

dialog: fix to get CDRs after restart

[more details here]

If you don't get the chance to do it soon, no worries, I can apply the patch manually, just have it in mind for future pull requests. It makes life easier by merging with one click here, instead of editing/patching source manually.

miconda added a commit that referenced this pull request Aug 1, 2018
- proper test for create_cbs
- based on PR #1606 and #1607 by kosza
@miconda
Copy link
Member

miconda commented Aug 1, 2018

Pushed manually a different path to run the callbacks in child_init() with rank PROC_INIT instead of PROC_MAIN -- the first is executed when modules are initialised. Should you get any issues with this, open a bug report and it will be revisited.

@miconda miconda closed this Aug 1, 2018
miconda added a commit that referenced this pull request Aug 17, 2018
- proper test for create_cbs
- based on PR #1606 and #1607 by kosza

(cherry picked from commit 3d0e1f7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants