switch_event_create_subclass(&event, SWITCH_EVENT_CLONE, NULL);
switch_assert(event);
- /* iterate through the hash, call callback, if callback returns true, put the key on the list (event)
+ /* iterate through the hash, call callback, if callback returns NULL or true, put the key on the list (event)
When done, iterate through the list deleting hash entries
*/
const void *key;
void *val;
switch_hash_this(hi, &key, NULL, &val);
- if (callback(key, val, pData)) {
+ if (!callback || callback(key, val, pData)) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delete", (const char *) key);
}
}