Optionally dump received 'iq' xml string in dispatched jabber.iq message.

git-svn-id: http://voip.null.ro/svn/yate@3104 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2010-03-03 09:51:02 +00:00
parent 83d29c516c
commit 5b3d5ec79d
2 changed files with 13 additions and 1 deletions

View File

@ -98,6 +98,10 @@
; Defaults to normal
;worker_priority=normal
; dump_iq: boolean: Dump the iq stanza in a 'data' parameter of dispatched jabber.iq messages
; Defaults to no
;dump_iq=no
; printxml: boolean/string: Print sent/received XML data to output if debug
; level is at least 9
; Allowed values are boolean values or 'verbose' string

View File

@ -562,6 +562,7 @@ unsigned int JBPendingWorker::s_threadCount = 0;
Mutex JBPendingWorker::s_mutex(false,"JBPendingWorker");
static bool s_s2sFeatures = true; // Offer RFC 3920 version=1 and stream features
// on incoming s2s streams
static bool s_dumpIq = false; // Dump 'iq' xml string in jabber.iq message
INIT_PLUGIN(JBModule); // The module
static YJBEntityCapsList s_entityCaps;
static YJBEngine* s_jabber = 0;
@ -2959,7 +2960,13 @@ void JBPendingWorker::processIq(JBPendingJob& job)
addValidParam(m,"type",ev->stanzaType());
if (respond)
addValidParam(m,"xmlns",TelEngine::c_safe(xmlns));
m.addParam(new NamedPointer("xml",ev->releaseXml()));
XmlElement* iq = ev->releaseXml();
if (s_dumpIq) {
NamedString* ns = new NamedString("data");
iq->toString(*ns);
m.addParam(ns);
}
m.addParam(new NamedPointer("xml",iq));
if (Engine::dispatch(m)) {
if (respond) {
XmlElement* xml = XMPPUtils::getXml(m,"response",0);
@ -3281,6 +3288,7 @@ void JBModule::initialize()
// (re)init globals
s_s2sFeatures = cfg.getBoolValue("general","s2s_offerfeatures",true);
s_dumpIq = cfg.getBoolValue("general","dump_iq");
// Init the engine
s_jabber->initialize(cfg.getSection("general"),!m_init);