[OpenSIPS-Users] do_routing() timerec help, OpenSIPS 3.1.7

Kingsley Tart kingsley at dns99.co.uk
Fri Jan 28 17:22:53 UTC 2022


On Fri, 2022-01-28 at 18:55 +0200, Liviu Chircu wrote:
> Hi Kingsley,
> The 3.1 release is the final release using the classic timerec
> support.  Since 3.2, the time recurrence parsing and evaluation is
> much more consistent and well-tested across all modules using this
> concept.
> Still, in order to fix your issue on 3.1, the format I linked is the
> ONLY way in order to define an [A, B) interval, where B is non-
> inclusive.  Looking at your examples, both strings seem wrong
> ("20220124T000000|404999" and "20220128T163000|504096247"), because
> of the poorly formatted DURATION field -- the second one.  Example
> correct strings for that field: P7W (7 weeks), PT24H (24 hours),
> PT1M30S (1 minute 30 seconds), etc..  The official format is detailed
> here[1].  Fun fact: MySQL's Galera engine uses this exact format as
> well, in order to represent time durations in its config file.
> [1]: https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.6
> Hope this helps,

Wow yes thank you! I've been trying to get this to work on and off for
weeks!

This did the trick:

+--------+---------+--------------+-----------------------------------+----------+---------+--------+----------+--------------+--------------+-------------+
| ruleid | groupid | prefix       | timerec                           | priority | routeid | gwlist | sort_alg | sort_profile | attrs        | description |
+--------+---------+--------------+-----------------------------------+----------+---------+--------+----------+--------------+--------------+-------------+
|    200 | 0       | 441476292509 | 20220124T000000|P4DT17H22M        |        1 | NULL    | #gw9   | N        |         NULL | endpoint=gw9 | NULL        |
|    201 | 0       | 441476292509 | 20220128T172200|PT1M              |        1 | NULL    | #gw1   | N        |         NULL | endpoint=gw1 | NULL        |
|    202 | 0       | 441476292509 | 20220128T172300|P7101W3DT6H28M15S |        1 | NULL    | #gw9   | N        |         NULL | endpoint=gw9 | NULL        |
+--------+---------+--------------+-----------------------------------+----------+---------+--------+----------+--------------+--------------+-------------+

I can stop pulling my hair out and cancel the order for that wig ... ;)

Cheers,
Kingsley.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20220128/34392714/attachment-0001.html>


More information about the Users mailing list