[OpenSIPS-Devel] bug in unset_dlg_profile (dialog module)?

Herman Bastiaens herman.bastiaens at androme.com
Thu Oct 9 11:24:42 CEST 2008


Hi,

scenario:
I'm using the dialog module to get information about active dialogs in
certain profiles, with certain values. It's possible that a dialog is
inserted into a profile multiple times, with different values, ex.
dialog "d1" is in profile "group" with value "A", "B".
As the values are chosen at runtime, I can't split them up in profiles,
and I really need the dialog to be in more than one group at a time.

bug?
when I invoke "unset_dlg_profile ( profile, value )" I get an error that
the dialog could not be removed from the profile, although I'm sure it is
in the profile with the value I pass to opensips. I believe this is caused
by an error in the unset_dlg_profile function in dlg_profile.c (dialog
module):

<code>
for( ; linker ; linker_prev=linker,linker=linker->next) {
		if (linker->profile==profile) {
			if (profile->has_value==0) {
				goto found;
			} else if (value && value->len==linker->hash_linker.value.len &&
			memcmp(value->s,linker->hash_linker.value.s,value->len)==0){
				goto found;
			}
			dlg_unlock( d_table, d_entry);
			return -1;
		}
	}
</code>

I believe there is a linker for each <profile, value> pair, so the "return
-1;" in this for loop should be removed. The current routine will only
work correctly if the value passed, is the value of the first linker.


Am I missing something?
Is it safe to just remove the "return -1" (that does the trick for my
specific scenario)?

Thanks

- Herman




More information about the Devel mailing list