[sr-dev] [kamailio/kamailio] dialog: Add dlg_get_matches function (PR #3005)

rhys-hanrahan notifications at github.com
Mon Jan 24 04:18:26 CET 2022


For some reason I had totally ignored that dlg vars, profiles and callbacks are all referenced by the RPC command (and probably should be by my function). Given I don't know what the call backs might be doing to the original dialogs, it doesn't seem safe anymore to make copies of the original dialogs.

I just tried re-writing the code to return an array of pointers to the original dialogs, to avoid copying them. This would mean I need to perform locking around any results of `dlg_list_matches`. However I've realised that I won't know what "table entry" to lock as this could be different for each match.

I'm feeling a bit stuck right now - I suppose I could use a struct that tracks each dlg ptr match and what table index it belongs to, when returning results. I was trying to avoid creating extra things just for this small bit of code, though.

Any suggestions on this would be appreciated. Maybe it's just easier to not share the matching logic and keep it simple and just duplicate all the matching logic?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3005#issuecomment-1019676282
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/3005/c1019676282 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220123/b99cf209/attachment-0001.htm>


More information about the sr-dev mailing list