[SR-Users] RFC: best way to create dialogs

Klaus Darilion klaus.mailinglists at pernau.at
Thu Jan 22 14:42:34 CET 2015


Hi!

I use the dialog module to count and limit concurrent calls per user. It
worked fine with 4.1.7 but fails with 4.2.2.

My config basically looks like:
route{
  ...
  dlg_manage()
  ...
  authentication (stateless replies + exit)
  ...
  t_on_reply()
  t_on_branch()
  ...
  t_relay()
  exit;
}

initial_cbs_inscript uses the default value 1.


Using 4.1.7, after stateless reply+exit, Kamailio executes dialog
callbacks and deletes the dialog:
[dlg_var.c:55]: dlg_cfg_cb(): new dialog with no trasaction after config
execution
[dlg_hash.c:872]: dlg_unref(): unref dlg 0xb233c3a0 with 1 -> 1
[dlg_hash.c:872]: dlg_unref(): unref dlg 0xb233c3a0 with 1 -> 0
[dlg_hash.c:872]: dlg_unref(): ref <=0 for dialog 0xb233c3a0
[dlg_hash.c:355]: destroy_dlg(): destroying dialog 0xb233c3a0 (ref 0)


With 4.2.2, after stateless reply+exit, Kamailio just exits without
calling any dialog callback (to destroy the dialog)

I think I could work around the problem by creating the transaction
later. Here are some ideas and I would be happy about your comments and
best practices.

- set initial_cbs_inscript to 0

- call dlg_manage() just before t_relay

- do not use dlg_manage() but use the dialog flag and set the flag
somewhere before t_relay


Finally, do t_on_reply() and t_on_branch() already create the
transaction or is it created with t_relay()?

Thanks
Klaus




More information about the sr-users mailing list