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, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/3005/c1019676282@github.com>