[OpenSIPS-Users] Dialog db flush issue

mayamatakeshi mayamatakeshi at gmail.com
Thu Oct 3 15:34:22 CEST 2013


On Thu, Oct 3, 2013 at 10:15 PM, mayamatakeshi <mayamatakeshi at gmail.com>wrote:

> Hello,
> I am experimenting with module dialog profiles to limit simultaneous calls
> from/to a subscriber.
> This works fine.
> And also works when I restart opensips:
>   - calls established before restart are counted when limit is checked
>   - acc record (cdr mode) is generated for the call when BYE is received.
> I can see this happens because when opensips shuts down gracefully, it
> saves dialog data to DB.
>
>
> Then, I experimented simulating an opensips crash by doing "kill -9 pid"
> for each opensips process.
> This was done after i confirmed dialog has flushed its data to DB (i am
> using db_mode=DELAYED and db_update_period=10).
> However, after restarting opensips, although I can see it was able to load
> dialog data:
>   - calls established before the "crash" are not counted when limit is
> checked
>   - no acc record is generated when BY is received.
>
>
> Comparing, the records for the same call that periodic dialog update
> generates with what a graceful shutdown saves, I can see they are different:
>
>
> After periodic dialog db update:
>
> mysql> select * from dialog;
>
> +---------------+--------------------------------------+-----------------------------------+--------------------------------------+--------------------------------+--------------------------------------+------------------+----------------+-------------+-------------+------------------+------------------+------------------+------------------+----------------------------------+------------------------------------+------------------------+------------------------+-------+------------+------------+------+----------+--------------+-------+
> | dlg_id        | callid                               |
> from_uri                          | from_tag                             |
> to_uri                         | to_tag                               |
> mangled_from_uri | mangled_to_uri | caller_cseq | callee_cseq |
> caller_ping_cseq | callee_ping_cseq | caller_route_set | callee_route_set |
> caller_contact                   | callee_contact                     |
> caller_sock            | callee_sock            | state | start_time |
> timeout    | vars | profiles | script_flags | flags |
>
> +---------------+--------------------------------------+-----------------------------------+--------------------------------------+--------------------------------+--------------------------------------+------------------+----------------+-------------+-------------+------------------+------------------+------------------+------------------+----------------------------------+------------------------------------+------------------------+------------------------+-------+------------+------------+------+----------+--------------+-------+
> | 9549462304683 | b583e688-f87b-4861-936f-7dc76e33004a |
> sip:53535353224123 at somedomain.com | d2ecbce5-9275-4788-a40c-509a23476e35
> | sip:234223423423 at 192.168.2.177 | 39178165-9e29-4a31-af78-51e61e54920c |
> NULL             | NULL           | 0           | 21320
> |                0 |                0 | NULL             | NULL
> | sip:sip-tester at 192.168.2.78:5060 | sip:sip-tester at 192.168.2.239:10802 |
> udp:192.168.2.177:5060 | udp:192.168.2.177:5060 |     4 | 1380805509 |
> 1380816310 | NULL | NULL     |            0 |    16 |
>
> +---------------+--------------------------------------+-----------------------------------+--------------------------------------+--------------------------------+--------------------------------------+------------------+----------------+-------------+-------------+------------------+------------------+------------------+------------------+----------------------------------+------------------------------------+------------------------+------------------------+-------+------------+------------+------+----------+--------------+-------+
> 1 row in set (0.00 sec)
>
>
> After opensips graceful shutdown:
>
> mysql> select * from dialog;
>
> +---------------+--------------------------------------+-----------------------------------+--------------------------------------+--------------------------------+--------------------------------------+------------------+----------------+-------------+-------------+------------------+------------------+------------------+------------------+----------------------------------+------------------------------------+------------------------+------------------------+-------+------------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------+--------------+-------+
> | dlg_id        | callid                               |
> from_uri                          | from_tag                             |
> to_uri                         | to_tag                               |
> mangled_from_uri | mangled_to_uri | caller_cseq | callee_cseq |
> caller_ping_cseq | callee_ping_cseq | caller_route_set | callee_route_set |
> caller_contact                   | callee_contact                     |
> caller_sock            | callee_sock            | state | start_time |
> timeout    |
> vars
> | profiles                     | script_flags | flags |
>
> +---------------+--------------------------------------+-----------------------------------+--------------------------------------+--------------------------------+--------------------------------------+------------------+----------------+-------------+-------------+------------------+------------------+------------------+------------------+----------------------------------+------------------------------------+------------------------+------------------------+-------+------------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------+--------------+-------+
> | 9549462304683 | b583e688-f87b-4861-936f-7dc76e33004a |
> sip:53535353224123 at somedomain.com | d2ecbce5-9275-4788-a40c-509a23476e35
> | sip:234223423423 at 192.168.2.177 | 39178165-9e29-4a31-af78-51e61e54920c |
> NULL             | NULL           | 0           | 21320
> |                0 |                0 | NULL             | NULL
> | sip:sip-tester at 192.168.2.78:5060 | sip:sip-tester at 192.168.2.239:10802 |
> udp:192.168.2.177:5060 | udp:192.168.2.177:5060 |     4 | 1380805509 |
> 1380816309 | accX_table#acc|accX_flags#   |accX_db  the_domain_sestts.com1 53535353224123 234223423423 53535353224123 the_user_sfsfe   1|accX_log
> the_domain_sestts.com 1 53535353224123 234223423423 53535353224123
> the_user_sfsfe   1|accX_leg#    |accX_core# INVITE$
> d2ecbce5-9275-4788-a40c-509a23476e35$ 39178165-9e29-4a31-af78-51e61e54920c$
> b583e688-f87b-4861-936f-7dc76e33004a 200 O …kMR    |accX_created#…kMR
> |rtpproxy_1#w |     | calls#the_domain_sestts.com| |            0 |    16
> |
>
> +---------------+--------------------------------------+-----------------------------------+--------------------------------------+--------------------------------+--------------------------------------+------------------+----------------+-------------+-------------+------------------+------------------+------------------+------------------+----------------------------------+------------------------------------+------------------------+------------------------+-------+------------+------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------+--------------+-------+
> 1 row in set (0.00 sec)
>
>
> I am not sure about the no cdr issue, but the problem with the limit is
> clearly due to the fact that periodic dialog db update doesn't save profile
> info (calls#the_domain_sestts.com)
> So, is this a bug, or am I missing some configuration option?
>
> Obs:
> I have confirmed this behavior on latest head commit
> af195e9ef5a07ae87b27047e7e33fab742011d99.
>

I experimented changing dialog.db_mode from DELAYED (2) to REALTIME (1) and
I verified that with this mode, dialog data is properly saved solving both
issues.
So this is clearly a bug.
I will be opening a ticket at github.
Regards,
Takeshi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20131003/05e51fda/attachment-0001.htm>


More information about the Users mailing list