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

[BUG] time recurrence does not seem to be working in the dialplan #2616

Closed
flaviogoncalves opened this issue Aug 30, 2021 · 2 comments
Closed
Assignees
Milestone

Comments

@flaviogoncalves
Copy link
Contributor

OpenSIPS version you are running

version: opensips 3.2.0 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
main.c compiled on  with gcc 8

Describe the bug
Even with time recurrence not matching the rule is accepted

To Reproduce
Add a rule in dialplan with time recurrence 20210104T080000||8H|WEEKLY|||MO,TU,WE,TH,FR
Set the date to 07:30
use dp_translate to test

Expected behavior
Rule should not be accepted

Relevant System Logs

Aug 30 07:35:15 ip-172-31-22-36 /usr/sbin/opensips[972]: DBG:dialplan:translate: Timerec exists for rule checking: 20210104T080000||8H|WEEKLY|||MO,TU,WE,TH,FR
Aug 30 07:35:15 ip-172-31-22-36 /usr/sbin/opensips[972]: DBG:dialplan:test_match: test_match:[0]
Aug 30 07:35:15 ip-172-31-22-36 /usr/sbin/opensips[972]: DBG:dialplan:translate: Regex operator testing. Got result: 0
Aug 30 07:35:15 ip-172-31-22-36 /usr/sbin/opensips[972]: DBG:dialplan:translate: Found a matching rule 0x7f06ca87a9e0: pr 1, match_exp
Aug 30 07:35:15 ip-172-31-22-36 /usr/sbin/opensips[972]: DBG:dialplan:translate: the rule's attrs are 1
Aug 30 07:35:15 ip-172-31-22-36 /usr/sbin/opensips[972]: DBG:dialplan:translate: the copied attributes are: 1


Same test with check_time_rec and the same expression at the same time using a REGISTER in the script
Aug 30 07:34:59 ip-172-31-22-36 /usr/sbin/opensips[976]: DBG:core:_tmrec_expr_check_str: checking: 20210104T080000||8H|WEEKLY|||MO,TU,WE,TH,FR
Aug 30 07:34:59 ip-172-31-22-36 /usr/sbin/opensips[976]: DBG:core:_tmrec_check_str: checking: '20210104T080000||8H|WEEKLY|||MO,TU,WE,TH,FR'
Aug 30 07:34:59 ip-172-31-22-36 /usr/sbin/opensips[976]: Time Recurrence Not Matched Mon Aug 30 07:34:59 2021

OS/environment information

  • Operating System: Debian 10
  • OpenSIPS installation: Debian Packages
@liviuchircu liviuchircu self-assigned this Aug 30, 2021
@liviuchircu liviuchircu added this to the 3.2.3 milestone Aug 30, 2021
liviuchircu added a commit that referenced this issue Aug 30, 2021
The tmrec_expr_check() function actually returns 1/-1 on success/failure
and not 1/0, as expected by the calling modules.

Many thanks to Flavio Goncalves for the report!
Fixes #2616

(cherry picked from commit 3056a37)
@liviuchircu
Copy link
Member

Hi, @flaviogoncalves and thanks for the report! This should now be fixed on 3.2 and master -- the fix is to be included in tonight's build of the nightly package repository.

@flaviogoncalves
Copy link
Contributor Author

flaviogoncalves commented Aug 30, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants