r3296 - in trunk/libmsip/source: . dialogs messages transactions
erik at minisip.org
erik at minisip.org
Mon Jun 11 15:29:19 CEST 2007
Author: erik
Date: 2007-06-11 15:29:19 +0200 (Mon, 11 Jun 2007)
New Revision: 3296
Modified:
trunk/libmsip/source/SipAuthenticationDigest.cxx
trunk/libmsip/source/SipCommandDispatcher.cxx
trunk/libmsip/source/SipLayerDialog.cxx
trunk/libmsip/source/SipLayerTransaction.cxx
trunk/libmsip/source/SipLayerTransport.cxx
trunk/libmsip/source/SipUri.cxx
trunk/libmsip/source/dialogs/SipDialog.cxx
trunk/libmsip/source/dialogs/SipDialogRegister.cxx
trunk/libmsip/source/messages/SipMessage.cxx
trunk/libmsip/source/messages/SipResponse.cxx
trunk/libmsip/source/transactions/SipTransaction.cxx
Log:
* Added output type/class to some output in libmsip.
This makes it possible to selectively filter in/out this
output from the user interface.
Modified: trunk/libmsip/source/SipAuthenticationDigest.cxx
===================================================================
--- trunk/libmsip/source/SipAuthenticationDigest.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/SipAuthenticationDigest.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -50,14 +50,14 @@
bool SipAuthenticationDigest::update( MRef<SipHeaderValueProxyAuthenticate*> auth ){
if( type > -1 && type != auth->getType() ){
- mdbg << "SipAuthenticationDigest::update non-matching header type" << endl;
+ mdbg("signaling/sip") << "SipAuthenticationDigest::update non-matching header type" << endl;
return false;
}
type = auth->getType();
string realmParam = unquote( auth->getParameter("realm") );
if( realm != nullStr && realm != realmParam ){
- mdbg << "SipAuthenticationDigest::update non-matching realm" << endl;
+ mdbg("signaling/sip") << "SipAuthenticationDigest::update non-matching realm" << endl;
return false;
}
realm = realmParam;
Modified: trunk/libmsip/source/SipCommandDispatcher.cxx
===================================================================
--- trunk/libmsip/source/SipCommandDispatcher.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/SipCommandDispatcher.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -95,7 +95,7 @@
void SipCommandDispatcher::run(){
while (keepRunning){
- mdbg << "DIALOG CONTAINER: waiting for command"<< endl;
+ mdbg("signaling/sip") << "DIALOG CONTAINER: waiting for command"<< endl;
semaphore.dec();
struct queue_type item;
@@ -109,11 +109,11 @@
}
mlock.unlock();
#ifdef DEBUG_OUTPUT
- mdbg << "DISPATCHER: got command!"<<endl;
+ mdbg("signaling/sip") << "DISPATCHER: got command!"<<endl;
if (item.type==TYPE_COMMAND)
- mdbg << "command: "<< **item.command << endl;
+ mdbg("signaling/sip") << "command: "<< **item.command << endl;
else
- mdbg << "timeout: "<< **item.command << endl;
+ mdbg("signaling/sip") << "timeout: "<< **item.command << endl;
#endif
@@ -125,9 +125,9 @@
// Timeouts have a known receiver set in the queue item.
#ifdef DEBUG_OUTPUT
if (item.type==TYPE_COMMAND){
- mdbg << "SipDialogContainer::run delivering command :: "<< **item.command << endl;
+ mdbg("signaling/sip") << "SipDialogContainer::run delivering command :: "<< **item.command << endl;
}else{
- mdbg << "SipDialogContainer::run delivering timeout :: "<< **item.command << endl;
+ mdbg("signaling/sip") << "SipDialogContainer::run delivering timeout :: "<< **item.command << endl;
}
#endif
@@ -148,7 +148,7 @@
#ifdef DEBUG_OUTPUT
if (handled){
- //mdbg<<"DISPATCHER: command handled"<<endl;
+
}else{
merr<<"DISPATCHER: command NOT handled"<<endl;
}
@@ -183,7 +183,7 @@
void SipCommandDispatcher::enqueueCommand(const SipSMCommand &command, int queue){
#ifdef DEBUG_OUTPUT
- mdbg<<"Dispatcher: enqueue("<<command<<")"<<endl;
+ mdbg("signaling/sip") << "Dispatcher: enqueue(" << command << ")" << endl;
#endif
struct queue_type item;
item.type = TYPE_COMMAND;
@@ -202,7 +202,7 @@
void SipCommandDispatcher::enqueueTimeout(MRef<SipTransaction*> receiver, const SipSMCommand &command){
#ifdef DEBUG_OUTPUT
- mdbg<<"Dispatcher: enqueue("<<command<<")"<<endl;
+ mdbg("signaling/sip") << "Dispatcher: enqueue(" << command << ")" << endl;
#endif
struct queue_type item;
@@ -220,7 +220,7 @@
void SipCommandDispatcher::enqueueTimeout(MRef<SipDialog*> receiver, const SipSMCommand &command){
#ifdef DEBUG_OUTPUT
- mdbg<<"Dispatcher: enqueue("<<command<<")"<<endl;
+ mdbg("signaling/sip") << "Dispatcher: enqueue(" << command << ")" << endl;
#endif
struct queue_type item;
@@ -241,7 +241,7 @@
bool SipCommandDispatcher::handleCommand(const SipSMCommand &c){
#ifdef DEBUG_OUTPUT
- mdbg << "DISPATCHER: SipCommandDispatcher got command "<< c<<endl;
+ mdbg("signaling/sip") << "DISPATCHER: SipCommandDispatcher got command "<< c<<endl;
#endif
int dst = c.getDestination();
@@ -249,7 +249,7 @@
bool ret=false;
if (dst==SipSMCommand::dialog_layer){
if (c.getSource()!=SipSMCommand::dialog_layer && c.getSource()!=SipSMCommand::transaction_layer){
- mdbg<< "DISPATCHER: WARNING: Dialog layer is expected to receive commands only from dialog or trasaction"<<endl;
+ mdbg("signaling/sip") << "DISPATCHER: WARNING: Dialog layer is expected to receive commands only from dialog or trasaction"<<endl;
}
ret=dialogLayer->handleCommand(c);
}else
@@ -258,7 +258,7 @@
}else
if (dst==SipSMCommand::transport_layer){
if (c.getSource()!=SipSMCommand::transaction_layer){
- mdbg<< "DISPATCHER: WARNING: Transport layer is expected to receive commands only from trasaction"<<endl;
+ mdbg("signaling/sip") << "DISPATCHER: WARNING: Transport layer is expected to receive commands only from trasaction"<<endl;
}
ret=transportLayer->handleCommand(c);
}else
@@ -279,7 +279,7 @@
if (!ret){
#ifdef DEBUG_OUTPUT
- mdbg <<"WARNING SipCommandDispatcher: The destination layer did not handle the command!"<<endl;
+ mdbg("signaling/sip") <<"WARNING SipCommandDispatcher: The destination layer did not handle the command!"<<endl;
#endif
}
@@ -336,7 +336,7 @@
return true;
}else{
#ifdef DEBUG_OUTPUT
- mdbg << "SipCommandDispatcher: Error: maintainenceHandleCommand did not understand command: "<< c << endl;
+ mdbg("signaling/sip") << "SipCommandDispatcher: Error: maintainenceHandleCommand did not understand command: "<< c << endl;
#endif
return false;
}
Modified: trunk/libmsip/source/SipLayerDialog.cxx
===================================================================
--- trunk/libmsip/source/SipLayerDialog.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/SipLayerDialog.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -106,7 +106,7 @@
assert(c.getDestination()==SipSMCommand::dialog_layer);
#ifdef DEBUG_OUTPUT
- mdbg<< "SipLayerDialog: got command: "<< c <<endl;
+ mdbg("signaling/sip") << "SipLayerDialog: got command: "<< c <<endl;
#endif
string cid = c.getDestinationId();
Modified: trunk/libmsip/source/SipLayerTransaction.cxx
===================================================================
--- trunk/libmsip/source/SipLayerTransaction.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/SipLayerTransaction.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -134,7 +134,7 @@
assert(c.getDestination()==SipSMCommand::transaction_layer);
#ifdef DEBUG_OUTPUT
- mdbg << "SipLayerTransaction: handleCommand got: "<< c<<endl;
+ mdbg("signaling/sip") << "SipLayerTransaction: handleCommand got: "<< c<<endl;
#endif
string tid;
if (c.getType()==SipSMCommand::COMMAND_STRING){
@@ -170,7 +170,7 @@
bool hasSeqMethod = (seqMethod!="");
if (!hasBranch){
- mdbg << "WARNING: SipLayerTransaction::handleCommand could not find branch parameter from packet - trying all transactions"<<endl;
+ mdbg("signaling/sip") << "WARNING: SipLayerTransaction::handleCommand could not find branch parameter from packet - trying all transactions"<<endl;
}
map<string, MRef<SipTransaction*> >::iterator i;
Modified: trunk/libmsip/source/SipLayerTransport.cxx
===================================================================
--- trunk/libmsip/source/SipLayerTransport.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/SipLayerTransport.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -457,7 +457,7 @@
return "UDP";
default:
- mdbg<< "SipLayerTransport: Unknown transport protocol " + socket->getType() <<endl;
+ mdbg("signaling/sip") << "SipLayerTransport: Unknown transport protocol " + socket->getType() <<endl;
// TODO more describing exception and message
throw NetworkException();
}
@@ -680,7 +680,7 @@
}
}
else{
- mdbg << "SipLayerTransport: URI invalid " << endl;
+ mdbg("signaling/sip") << "SipLayerTransport: URI invalid " << endl;
}
}
@@ -940,7 +940,7 @@
string message = exc.what();
string callId = pack->getCallId();
#ifdef DEBUG_OUTPUT
- mdbg << "Transport error in SipLayerTransport: " << message << endl;
+ mdbg("signaling/sip") << "Transport error in SipLayerTransport: " << message << endl;
cerr << "SipLayerTransport: sendMessage: exception thrown! " << message << endl;
#endif
CommandString transportError( pack->getBranch()+pack->getCSeqMethod(),
@@ -954,7 +954,7 @@
if (dispatcher)
dispatcher->enqueueCommand( transportErrorCommand, LOW_PRIO_QUEUE );
else
- mdbg<< "SipLayerTransport: ERROR: NO SIP COMMAND RECEIVER - DROPPING COMMAND"<<endl;
+ mdbg("signaling/sip")<< "SipLayerTransport: ERROR: NO SIP COMMAND RECEIVER - DROPPING COMMAND"<<endl;
}
}
@@ -1037,7 +1037,7 @@
nread = sock->recvFrom((void *)buffer, UDP_MAX_SIZE, from, port);
if (nread == -1){
- mdbg << "Some error occured while reading from UdpSocket"<<endl;
+ mdbg("signaling/sip") << "Some error occured while reading from UdpSocket"<<endl;
return;
}
@@ -1082,7 +1082,7 @@
if (dispatcher)
dispatcher->enqueueCommand( cmd, LOW_PRIO_QUEUE );
else
- mdbg<< "SipLayerTransport: ERROR: NO SIP MESSAGE RECEIVER - DROPPING MESSAGE"<<endl;
+ mdbg("signaling/sip") << "SipLayerTransport: ERROR: NO SIP MESSAGE RECEIVER - DROPPING MESSAGE"<<endl;
}
pack=NULL;
}
@@ -1091,7 +1091,7 @@
/* Probably we don't have enough data
* so go back to reading */
#ifdef DEBUG_OUTPUT
- mdbg << "Invalid data on UDP socket, discarded" << endl;
+ mdbg("signaling/sip") << "Invalid data on UDP socket, discarded" << endl;
#endif
return;
}
@@ -1101,7 +1101,7 @@
// packet, close the connection
#ifdef DEBUG_OUTPUT
- mdbg << "Invalid data on UDP socket, discarded" << endl;
+ mdbg("signaling/sip") << "Invalid data on UDP socket, discarded" << endl;
#endif
return;
}
@@ -1125,13 +1125,13 @@
nread = socket->read( buffer, STREAM_MAX_PKT_SIZE);
if (nread == -1){
- mdbg << "Some error occured while reading from StreamSocket" << endl;
+ mdbg("signaling/sip") << "Some error occured while reading from StreamSocket" << endl;
return;
}
if ( nread == 0){
// Connection was closed
- mdbg << "Connection was closed" << endl;
+ mdbg("signaling/sip") << "Connection was closed" << endl;
transport->removeSocket( socket );
return;
}
@@ -1161,7 +1161,7 @@
if (transport->dispatcher){
transport->dispatcher->enqueueCommand( cmd, LOW_PRIO_QUEUE );
}else
- mdbg<< "SipLayerTransport: ERROR: NO SIP MESSAGE RECEIVER - DROPPING MESSAGE"<<endl;
+ mdbg("signaling/sip") << "SipLayerTransport: ERROR: NO SIP MESSAGE RECEIVER - DROPPING MESSAGE"<<endl;
}
pack=NULL;
}
@@ -1170,7 +1170,7 @@
}
catch(SipExceptionInvalidMessage &e ){
- mdbg << "INFO: SipLayerTransport::streamSocketRead: dropping malformed packet: "<<e.what()<<endl;
+ mdbg("signaling/sip") << "INFO: SipLayerTransport::streamSocketRead: dropping malformed packet: "<<e.what()<<endl;
#if 0
// Check that we received data
@@ -1189,7 +1189,7 @@
// This does not look like a SIP
// packet, close the connection
- mdbg << "This does not look like a SIP packet, close the connection" << endl;
+ mdbg("signaling/sip") << "This does not look like a SIP packet, close the connection" << endl;
socket->close();
transport->removeSocket( socket );
}
Modified: trunk/libmsip/source/SipUri.cxx
===================================================================
--- trunk/libmsip/source/SipUri.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/SipUri.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -64,7 +64,7 @@
clear();
#ifdef DEBUG_OUTPUT
- mdbg << "SipUri::fromString = " << buildFrom << endl;
+ mdbg("signaling/sip") << "SipUri::fromString = " << buildFrom << endl;
#endif
//look for the full name ...
Modified: trunk/libmsip/source/dialogs/SipDialog.cxx
===================================================================
--- trunk/libmsip/source/dialogs/SipDialog.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/dialogs/SipDialog.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -159,10 +159,10 @@
bool SipDialog::handleCommand(const SipSMCommand &command){
- mdbg << "SipDialog("<<getMemObjectType()<<")::handleCommand got command "<< command << "("<<getName()<<")"<<endl;
+ mdbg("signaling/sip") << "SipDialog("<<getMemObjectType()<<")::handleCommand got command "<< command << "("<<getName()<<")"<<endl;
if (! (command.getDestination()==SipSMCommand::dialog_layer) ){
- mdbg << "SipDialog::handleCommand: returning false based on command destination"<< endl;
+ mdbg("signaling/sip") << "SipDialog::handleCommand: returning false based on command destination"<< endl;
return false;
}
@@ -170,17 +170,17 @@
if (command.getType()==SipSMCommand::COMMAND_PACKET
&& dialogState.callId != ""
&& dialogState.callId != command.getCommandPacket()->getCallId()){
- mdbg << "SipDialog: denying command based on destination id"<< endl;
+ mdbg("signaling/sip") << "SipDialog: denying command based on destination id"<< endl;
return false;
}
- mdbg << "SipDialog::handleCommand: sending command to state machine"<< endl;
+ mdbg("signaling/sip") << "SipDialog::handleCommand: sending command to state machine"<< endl;
bool ret;
ret=StateMachine<SipSMCommand,string>::handleCommand(command);
- mdbg << "SipDialog::handleCommand returning "<< ret << endl;
+ mdbg("signaling/sip") << "SipDialog::handleCommand returning "<< ret << endl;
return ret;
@@ -260,7 +260,7 @@
MRef<SipHeaderValue *> value = resp->getHeaderValueNo( SIP_HEADER_TYPE_RSEQ, 0 );
if( !value ){
- mdbg << "SipDialog: Missing RSeq in response" << endl;
+ mdbg("signaling/sip") << "SipDialog: Missing RSeq in response" << endl;
return NULL;
}
Modified: trunk/libmsip/source/dialogs/SipDialogRegister.cxx
===================================================================
--- trunk/libmsip/source/dialogs/SipDialogRegister.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/dialogs/SipDialogRegister.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -276,7 +276,7 @@
getDialogConfig()->sipIdentity->setIsRegistered ( false );
#ifdef DEBUG_OUTPUT
- mdbg << "WARNING: SipDialogRegister::a9: unimplemented section reached"<<endl;
+ mdbg("signaling/sip") << "WARNING: SipDialogRegister::a9: unimplemented section reached"<<endl;
#endif
return true;
}else{
@@ -530,8 +530,6 @@
void SipDialogRegister::sendRegister(){
-// mdbg << "SipDialogRegister: domain is "<< proxy_domain<< end;
-
MRef<SipIdentity*> identity = getDialogConfig()->sipIdentity;
const SipUri &contact = getDialogConfig()->getContactUri(true); //if udp, use stun
Modified: trunk/libmsip/source/messages/SipMessage.cxx
===================================================================
--- trunk/libmsip/source/messages/SipMessage.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/messages/SipMessage.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -186,7 +186,7 @@
//This filters the sipfrag messages we receive ... like in NOTIFY ... which most of the times come without any header
if( startIndex + 4 >= endBuf ) {
#ifdef DEBUG_OUTPUT
- mdbg << "SipMessage::parseHeaders: Info: SipMessage without headers ... only request line" << endl;
+ mdbg("signaling/sip") << "SipMessage::parseHeaders: Info: SipMessage without headers ... only request line" << endl;
#endif
return i;
}
@@ -210,11 +210,11 @@
// << eoh-i+1 << "]" << end;
if( header == "" ) {
#ifdef DEBUG_OUTPUT
- mdbg << "SipMessage::parseHeaders: Info: Could not copy line to new Message: (empty line)" << endl;
+ mdbg("signaling/sip") << "SipMessage::parseHeaders: Info: Could not copy line to new Message: (empty line)" << endl;
#endif
} else if (!addLine(header)){
#ifdef DEBUG_OUTPUT
- mdbg << "SipMessage::parseHeaders: Info: Could not copy line to new Message: " << header << " (unknown)" << endl;
+ mdbg("signaling/sip") << "SipMessage::parseHeaders: Info: Could not copy line to new Message: " << header << " (unknown)" << endl;
#endif
}
i=eoh+1;
@@ -310,7 +310,7 @@
if (seq){
return ((SipHeaderValueCSeq*)*seq)->getCSeq();
}else{
- mdbg << "ERROR: Could not find command sequence number in sip Message."<< endl;
+ mdbg("signaling/sip") << "ERROR: Could not find command sequence number in sip Message."<< endl;
return -1;
}
}
@@ -345,7 +345,7 @@
if (seq){
return ((SipHeaderValueCSeq*)*seq)->getMethod();
}else{
- mdbg << "ERROR: Could not find command sequence method in sip Message."<< endl;
+ mdbg("signaling/sip") << "ERROR: Could not find command sequence method in sip Message."<< endl;
return "";
}
}
Modified: trunk/libmsip/source/messages/SipResponse.cxx
===================================================================
--- trunk/libmsip/source/messages/SipResponse.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/messages/SipResponse.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -126,7 +126,7 @@
for ( ; resp[i]!='\r' && resp[i]!='\n'; i++){
if(len == i){
#ifdef DEBUG_OUTPUT
- mdbg << "SipResponse::SipResponse: message did not end correctly - throwing exception"<< endl;
+ mdbg("signaling/sip") << "SipResponse::SipResponse: message did not end correctly - throwing exception"<< endl;
#endif
throw SipExceptionInvalidMessage("SipResponse malformed - could not find end of response description");
Modified: trunk/libmsip/source/transactions/SipTransaction.cxx
===================================================================
--- trunk/libmsip/source/transactions/SipTransaction.cxx 2007-06-11 13:28:02 UTC (rev 3295)
+++ trunk/libmsip/source/transactions/SipTransaction.cxx 2007-06-11 13:29:19 UTC (rev 3296)
@@ -86,7 +86,7 @@
string branch= req->getBranch();
#ifdef DEBUG_OUTPUT
- mdbg << "TRANSACTION_CREATE: "<< seqMethod<<" "<<seqNo<<" branch="<<branch<<" callid=" << callId<<" client="<<fromTU<< endl;
+ mdbg("signaling/sip") << "TRANSACTION_CREATE: "<< seqMethod<<" "<<seqNo<<" branch="<<branch<<" callid=" << callId<<" client="<<fromTU<< endl;
#endif
if (fromTU){ //client transaction
@@ -202,7 +202,7 @@
setSocket( *pack->getSocket() );
#ifdef DEBUG_OUTPUT
- mdbg<< "SipTransaction::send: WARNING: Ignoring created socket"<<endl;
+ mdbg("signaling/sip") << "SipTransaction::send: WARNING: Ignoring created socket"<<endl;
#endif
return;
@@ -211,7 +211,7 @@
//FIXME: set the reliability ...
bool SipTransaction::isUnreliable() {
if( !socket ) {
- mdbg << "FIXME: SipTransaction::isUnrealiable: socket not initialized. Returning _unreliable_transport_ by default" << endl;
+ mdbg("signaling/sip") << "FIXME: SipTransaction::isUnrealiable: socket not initialized. Returning _unreliable_transport_ by default" << endl;
return true;
}
if( socket->getType() == SOCKET_TYPE_UDP )
@@ -222,7 +222,7 @@
bool SipTransaction::handleCommand(const SipSMCommand &command){
#ifdef DEBUG_OUTPUT
- mdbg << "SipTransaction:handleCommand: branch <"<< getBranch()<< "> got command "<<command<<endl;
+ mdbg("signaling/sip") << "SipTransaction:handleCommand: branch <"<< getBranch()<< "> got command "<<command<<endl;
#endif
if (! (command.getDestination()==SipSMCommand::transaction_layer
/*|| command.getDestination()==SipSMCommand::ANY*/)){
More information about the Minisip-devel
mailing list