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 accounting broken due to loss of dlg vals on server restart #136

Closed
ovidiusas opened this issue Nov 20, 2013 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@ovidiusas
Copy link
Member

Dialog values are lost on server restart is dialog accounting is enabled.

Relevant config:
...
loadmodule "acc.so"
modparam("acc", "early_media", 0)
modparam("acc", "report_cancels", 0)
modparam("acc", "detect_direction", 0)
modparam("acc", "failed_transaction_flag", "LOG_FAILED_TRANSACTIONS")
modparam("acc", "log_flag", "LOG_FLAG")
modparam("acc", "log_missed_flag", "LOG_MISSED_FLAG")
modparam("acc", "log_facility", "LOG_LOCAL0")
modparam("acc", "cdr_flag", "LOG_CDR_FLAG")
...
route {
...
if (is_method("INVITE")) {
setflag(LOG_FLAG); # do accounting
setflag(LOG_FAILED_TRANSACTIONS);
setflag(LOG_MISSED_FLAG);
setflag(LOG_CDR_FLAG);
}
...
create_dialog();
$dlg_val(caller) = $fU;
$dlg_val(callee) = $tU;
...

We make a call and we print the dialog and we see all the dialog values:
$ opensipsctl fifo dlg_list_ctx
dialog:: hash=1:1376513646
state:: 4
user_flags:: 0
timestart:: 1384989067
timeout:: 1385032266
callid:: 3634983721cf269d4f8159145cac82e4@192.168.2.2:5060
from_uri:: sip:osas@192.168.2.2
to_uri:: sip:4165551111@192.168.2.3
caller_tag:: as52d10e77
caller_contact:: sip:osas@192.168.2.2:5060
callee_cseq:: 0
caller_route_set::
caller_bind_addr:: udp:192.168.2.3:5060
callee_tag:: e18a640096eff155i2
callee_contact:: sip:4165551111@192.168.2.97:5062
caller_cseq:: 102
callee_route_set::
callee_bind_addr:: udp:192.168.2.3:5060
context::
value:: accX_table = acc
value:: accX_flags =
value:: accX_log =
value:: accX_leg =
value:: accX_core = R
value:: callee = 4165551111
value:: caller = osas

after this, we perform a server restart and we print again the dialog context:
$ opensipsctl fifo dlg_list_ctx
dialog:: hash=1:1376513646
state:: 4
user_flags:: 0
timestart:: 1384989067
timeout:: 1385032267
callid:: 3634983721cf269d4f8159145cac82e4@192.168.2.2:5060
from_uri:: sip:osas@192.168.2.2
to_uri:: sip:4165551111@192.168.2.3
caller_tag:: as52d10e77
caller_contact:: sip:osas@192.168.2.2:5060
callee_cseq:: 0
caller_route_set::
caller_bind_addr:: udp:192.168.2.3:5060
callee_tag:: e18a640096eff155i2
callee_contact:: sip:4165551111@192.168.2.97:5062
caller_cseq:: 102
callee_route_set::
callee_bind_addr:: udp:192.168.2.3:5060
context::
value:: accX_table = acc

Only one single value is restored despite the fact that we have everything in the db.

One other issue is the storage of hdr_flags_t for the msg in binary format inside a string. This is messing up the output of the dlg_list_ctx mi command.
The flags should be converted to string, stored as string and on fetch, the string should be reconverted to hdr_flags_t.

If call accounting is disabled, everything works as expected.

Regards,
Ovidiu Sas

@razvancrainea
Copy link
Member

Hi, Ovidiu!

There are indeed some problems related to the binary dialog variables. Although I have made a fix, this is not a complete solution - we are working on this.
We are also looking into the flags printing issue.

Best regards,
Răzvan

@ghost ghost assigned razvancrainea Nov 22, 2013
@razvancrainea
Copy link
Member

Hi, Ovidiu!

I've just committed a few changes to the dialog module in order to handle this. The solutions was the following:

  • change the dialog vars column to blob
  • when using dlg_list_ctx command, print the CDR flags as strings (this is what Liviu did last week in the acc module) and hexa encode the other binary values (this is the change in dialog)
    Please let me know if there are other issues, or close this ticket otherwise.

Best regards,
Răzvan

@ovidiusas
Copy link
Member Author

Seems to be working ok now.

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

No branches or pull requests

2 participants