Remove ModuleToolbox from public API.
Also fixes an issue where an internal include was added in module.hh which is a public header.
I found a plugin that uses the ModuleToolbox. Here is an idea to remove its dependency to ModuleToolbox:
- sip_header_insert(msg, sip, (sip_header_t*)sip_unknown_format(msg_home(msg), "X-Target-Uris: %s", oss.str().c_str()));
+ if(!sip_header_insert(msg, sip, (sip_header_t*)sip_unknown_format(msg_home(msg), "X-Target-Uris: %s", oss.str().c_str()))) {
+ SLOGE << "an error has occurred while inserting X-Target-Uris header";
+ }
+
SLOGD << "Generated header is X-Target-Uris: " << oss.str().c_str();
// Remove the preroute
char* params = su_strdup(msg_home(msg), sipurl->url_params);
sipurl->url_params = url_strip_param_string(params, "preroute");
-
- // Ensure we correctly added the X-Target-Uris header
- sip_unknown_t* h = ModuleToolbox::getCustomHeaderByName(ev->getSip(), "X-Target-Uris");
- if (!h) {
- SLOGE << "ERROR: X-Target-Uris header not found !";
- }
}
}