r2769 - in trunk/libminisip/source: gui sip
erik at minisip.org
erik at minisip.org
Thu Sep 14 13:28:10 CEST 2006
Author: erik
Date: 2006-09-14 13:28:09 +0200 (Thu, 14 Sep 2006)
New Revision: 2769
Modified:
trunk/libminisip/source/gui/ConsoleDebugger.cxx
trunk/libminisip/source/sip/DefaultDialogHandler.cxx
trunk/libminisip/source/sip/Sip.cxx
trunk/libminisip/source/sip/SipDialogConfVoip.cxx
trunk/libminisip/source/sip/SipDialogPresenceClient.cxx
trunk/libminisip/source/sip/SipDialogPresenceServer.cxx
trunk/libminisip/source/sip/SipDialogVoip.cxx
trunk/libminisip/source/sip/SipDialogVoipClient.cxx
trunk/libminisip/source/sip/SipDialogVoipServer.cxx
trunk/libminisip/source/sip/SipDialogVoipServer100rel.cxx
Log:
* Use new version of the libmsip API:
- Use the SipStack object instead of the SipCommandDispatcher
- Don't access the transport layer directly. Use SipStack
instead.
- The console debugger uses a method in the SipStack to
print dialog information instead of doing it itself. (not
all information is available, for example timeout
information).
Modified: trunk/libminisip/source/gui/ConsoleDebugger.cxx
===================================================================
--- trunk/libminisip/source/gui/ConsoleDebugger.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/gui/ConsoleDebugger.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -144,9 +144,8 @@
#ifdef DEBUG_OUTPUT
case 'P':
case 'p':
- set_debug_print_packets(!get_debug_print_packets());
- //sipdebug_print_packets= !sipdebug_print_packets;
- if (/*sipdebug_print_packets*/ get_debug_print_packets() )
+ config->sip->getSipStack()->setDebugPrintPackets(!config->sip->getSipStack()->getDebugPrintPackets() );
+ if (config->sip->getSipStack()->getDebugPrintPackets() )
cerr << "Packets will be displayed to the screen"<< endl;
else
cerr << "Packets will NOT be displayed to the screen"<< endl;
@@ -230,103 +229,15 @@
}
void ConsoleDebugger::showDialogInfo(MRef<SipDialog*> d, bool usesStateMachine){
-
- list <TPRequest<string,MRef<StateMachine<SipSMCommand,string>*> > > torequests =
- config->sip->getSipStack()->getTimeoutProvider()->getTimeoutRequests();
-
- if (usesStateMachine){
- cerr << (/*string(" (")+itoa(ii)+") " +*/ d->getName() + " State: " + d->getCurrentStateName())<< endl;
- }else{
- cerr << d->getName() << endl;
- }
- cerr << BOLD << " SipDialogState: "<< PLAIN << endl;
- cerr << " secure="<<d->dialogState.secure
- <<"; localTag="<<d->dialogState.localTag
- <<"; remoteTag="<<d->dialogState.remoteTag
- <<"; seqNo="<< d->dialogState.seqNo
- <<"; remoteSeqNo="<< d->dialogState.remoteSeqNo
- <<"; remoteUri="<< d->dialogState.remoteUri
- <<"; remoteTarget="<<d->dialogState.remoteTarget
- <<"; isEarly="<<d->dialogState.isEarly
- << endl;
- cerr << " route_set: ";
-
- list<string>::iterator i;
- for (i=d->dialogState.routeSet.begin(); i!= d->dialogState.routeSet.end(); i++){
- if (i!=d->dialogState.routeSet.begin())
- cerr << ",";
- cerr << *i;
- }
- cerr <<endl;
-
- cerr << BOLD << " Identity: "<< PLAIN << endl;
- cerr << " "<< d->getDialogConfig()->inherited->sipIdentity->getDebugString();
- cerr <<endl;
-
- cerr << BOLD << " Timeouts:"<< PLAIN << endl;
- int ntimeouts=0;
- std::list<TPRequest<string,MRef<StateMachine<SipSMCommand,string>*> > >::iterator jj=torequests.begin();
- for (uint32_t j=0; j< torequests.size(); j++,jj++){
- if ( *d == *((*jj).get_subscriber()) ){
- int ms= (*jj).get_ms_to_timeout();
- cerr << string(" timeout: ")+ (*jj).get_command()
- + " Time: " + itoa(ms/1000) + "." + itoa(ms%1000) << endl;
- ntimeouts++;
- }
- }
- if (ntimeouts==0){
- cerr << " (no timeouts)"<< endl;
- }
-
-
- cerr << BOLD << " Transactions:"<< PLAIN << endl;
- list<MRef<SipTransaction*> > transactions = d->getTransactions();
- if (transactions.size()==0)
- cerr << " (no transactions)"<< endl;
- else{
- int n=0;
- for (list<MRef<SipTransaction*> >::iterator i = transactions.begin();
- i!=transactions.end(); i++){
- cerr << string(" (")+itoa(n)+") "+
- (*i)->getName()
- + " State: "
- + (*i)->getCurrentStateName() << endl;
- n++;
-
- cerr << BOLD << " Timeouts:" << PLAIN << endl;
-
- int ntimeouts=0;
- std::list<TPRequest<string, MRef<StateMachine<SipSMCommand,string>*> > >::iterator jj=torequests.begin();
- for (uint32_t j=0; j< torequests.size(); j++, jj++){
- if ( *((*i)) == *((*jj).get_subscriber()) ){
- int ms= (*jj).get_ms_to_timeout();
- cerr << string(" timeout: ")
- + (*jj).get_command()
- + " Time: " + itoa(ms/1000) + "." + itoa(ms%1000)<< endl;
- ntimeouts++;
- }
- }
- if (ntimeouts==0)
- cerr << " (no timeouts)"<< endl;
- }
- }
-
-
-
-
-
+ d->getDialogStatusString();
}
void ConsoleDebugger::showStat(){
- list<MRef<SipDialog*> > calls = config->sip->getSipStack()->getDispatcher()->getDialogs();
+ list<MRef<SipDialog*> > calls = config->sip->getSipStack()->getDialogs();
list <TPRequest<string,MRef<StateMachine<SipSMCommand,string>*> > > torequests =
config->sip->getSipStack()->getTimeoutProvider()->getTimeoutRequests();
-
-// cerr << " (DefaultHandler) ";
-// showDialogInfo(config->sip->getSipStack()->getDialogContainer()->getDefaultHandler(),false);
-
cerr << BOLD << " Calls:" << PLAIN << endl;
if (calls.size()==0)
cerr << " (no calls)"<< endl;
@@ -336,66 +247,8 @@
cerr << string(" (")+itoa(ii)+") " ;
showDialogInfo(*i,true);
-#if 0
- cerr << (string(" (")+itoa(ii)+") "
- // displayMessage(string(" ")
- + (*i)->getName()
- + " State: "
- + (*i)->getCurrentStateName())<< endl;
+ }
-
- cerr << BOLD << " Timeouts:"<< PLAIN << endl;
- int ntimeouts=0;
- std::list<TPRequest<string,MRef<StateMachine<SipSMCommand,string>*> > >::iterator jj=torequests.begin();
- for (int j=0; j< torequests.size(); j++,jj++){
- if ( *(*i) == *((*jj).get_subscriber()) ){
- int ms= (*jj).get_ms_to_timeout();
- cerr << string(" timeout: ")+ (*jj).get_command()
- + " Time: " + itoa(ms/1000) + "." + itoa(ms%1000) << endl;
- ntimeouts++;
- }
- }
- if (ntimeouts==0){
- cerr << " (no timeouts)"<< endl;
- }
-
-
-
- cerr << BOLD << " Transactions:"<< PLAIN << endl;
- list<MRef<SipTransaction*> > transactions = (*i)->getTransactions();
- if (transactions.size()==0)
- cerr << " (no transactions)"<< endl;
- else{
- int n=0;
- for (list<MRef<SipTransaction*> >::iterator i = transactions.begin();
- i!=transactions.end(); i++){
- cerr << string(" (")+itoa(n)+") "+
- (*i)->getName()
- + " State: "
- + (*i)->getCurrentStateName() << endl;
- n++;
-
- cerr << BOLD << " Timeouts:" << PLAIN << endl;
-
- int ntimeouts=0;
- std::list<TPRequest<string, MRef<StateMachine<SipSMCommand,string>*> > >::iterator jj=torequests.begin();
- for (int j=0; j< torequests.size(); j++, jj++){
- if ( *((*i)) == *((*jj).get_subscriber()) ){
- int ms= (*jj).get_ms_to_timeout();
- cerr << string(" timeout: ")
- + (*jj).get_command()
- + " Time: " + itoa(ms/1000) + "." + itoa(ms%1000)<< endl;
- ntimeouts++;
- }
- }
- if (ntimeouts==0)
- cerr << " (no timeouts)"<< endl;
- }
- }
-
-#endif
- }
-
}
}
@@ -447,3 +300,4 @@
config = NULL;
thread = NULL;
}
+
Modified: trunk/libminisip/source/sip/DefaultDialogHandler.cxx
===================================================================
--- trunk/libminisip/source/sip/DefaultDialogHandler.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/sip/DefaultDialogHandler.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -216,7 +216,7 @@
SipSMCommand cmd(pkt, SipSMCommand::transaction_layer, SipSMCommand::dialog_layer);
- sipStack->getDispatcher()->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
mdbg << cmd << end;
}
//start SipDialogVoIP
@@ -259,7 +259,7 @@
SipSMCommand cmd(pkt, SipSMCommand::transaction_layer, SipSMCommand::dialog_layer);
- sipStack->getDispatcher()->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
mdbg << cmd << end;
}
return true;
@@ -312,7 +312,7 @@
CommandString command(cmdstr);
cmdstr.setDestinationId(pres->getCallId());
SipSMCommand cmd( cmdstr, SipSMCommand::transaction_layer, SipSMCommand::dialog_layer);
- sipStack->getDispatcher()->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
return true;
}
@@ -329,7 +329,7 @@
CommandString command(cmdstr);
cmdstr.setDestinationId(pres->getCallId());
SipSMCommand cmd( cmdstr, SipSMCommand::transaction_layer, SipSMCommand::dialog_layer);
- sipStack->getDispatcher()->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
return true;
}
@@ -365,7 +365,7 @@
sipStack->addDialog( MRef<SipDialog*>(*reg) );
SipSMCommand cmd( cmdstr, SipSMCommand::dialog_layer, SipSMCommand::dialog_layer);
- sipStack->getDispatcher()->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
return true;
}
@@ -757,8 +757,8 @@
bool DefaultDialogHandler::getP2TDialog(string GroupId, MRef<SipDialogP2T*>&p2tDialog){
bool match=false;
-// list<MRef<SipDialog*> > *dialogs = getDialogContainer()->getDispatcher()->getDialogs();
- list<MRef<SipDialog*> > dialogs = getDialogContainer()->getDispatcher()->getDialogs();
+// list<MRef<SipDialog*> > *dialogs = sipStack->getDialogs();
+ list<MRef<SipDialog*> > dialogs = sipStack->getDialogs();
for (list<MRef<SipDialog*> >::iterator i=dialogs.begin(); i!=dialogs.end(); i++){
MRef<SipDialog*> tmpd= *i;
@@ -839,7 +839,7 @@
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- sipStack->getDispatcher()->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
}
@@ -884,7 +884,7 @@
MRef<SipMessage*> pref(*im);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- sipStack->getDispatcher()->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
}
Modified: trunk/libminisip/source/sip/Sip.cxx
===================================================================
--- trunk/libminisip/source/sip/Sip.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/sip/Sip.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -88,7 +88,7 @@
//CESC -- change to use set/get
MRef<SipDialogManagement *> shutdown = new SipDialogManagement(sipstack);
- sipstack->getDispatcher()->setDialogManagement(*shutdown);
+ sipstack->setDialogManagement(*shutdown);
//Register content factories that are able to parse the content of
//sip messages. text/plain, multipart/mixed, multipart/alternative
@@ -437,7 +437,7 @@
mout << BOLD << "init 8.2/9: Starting TCP transport worker thread" << PLAIN << end;
#endif
- sipstack->getDispatcher()->getLayerTransport()->startTcpServer();
+ sipstack->startTcpServer();
}
@@ -449,7 +449,7 @@
#ifdef DEBUG_OUTPUT
mout << BOLD << "init 8.3/9: Starting TLS transport worker thread" << PLAIN << end;
#endif
- sipstack->getDispatcher()->getLayerTransport()->startTlsServer();
+ sipstack->startTlsServer();
}
}
}
Modified: trunk/libminisip/source/sip/SipDialogConfVoip.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogConfVoip.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/sip/SipDialogConfVoip.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -447,7 +447,7 @@
if( getDialogConfig()->inherited->autoAnswer ){
CommandString accept( dialogState.callId, SipCommandString::accept_invite );
SipSMCommand sipcmd(accept, SipSMCommand::transaction_layer, SipSMCommand::dialog_layer);
- dispatcher->enqueueCommand(sipcmd,HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(sipcmd,HIGH_PRIO_QUEUE );
}
return true;
}else{
@@ -693,7 +693,7 @@
SipSMCommand::dialog_layer,
SipSMCommand::dispatcher);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
return true;
}else{
@@ -1057,7 +1057,7 @@
// handleCommand(scmd);
//cerr<<"SDCV: "+scmd.getCommandString().getString()<<endl;
- dispatcher->enqueueCommand(scmd, HIGH_PRIO_QUEUE/*, PRIO_LAST_IN_QUEUE*/);
+ sipStack->enqueueCommand(scmd, HIGH_PRIO_QUEUE);
setLastInvite(inv);
//inv->checkAcceptContact();
@@ -1132,7 +1132,7 @@
MRef<SipMessage*> pref(*inv);
SipSMCommand cmd(pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
setLastInvite(inv);
}
@@ -1235,9 +1235,10 @@
proxy->getTransport() );
MRef<SipMessage*> pref(*ack);
- dispatcher->getLayerTransport()->sendMessage(pref,
- string("ACK"),
- true);
+ sendSipMessage(pref);
+// sipStack->getLayerTransport()->sendMessage(pref,
+// string("ACK"),
+// true);
}
@@ -1249,7 +1250,7 @@
MRef<SipMessage*> pref(*bye);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogConfVoip::sendCancel(const string &branch){
@@ -1266,7 +1267,7 @@
MRef<SipMessage*> pref(*cancel);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
}
void SipDialogConfVoip::sendInviteOk(const string &branch){
@@ -1312,7 +1313,7 @@
//
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogConfVoip::sendByeOk(MRef<SipRequest*> bye, const string &branch){
@@ -1321,7 +1322,7 @@
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogConfVoip::sendReject(const string &branch){
@@ -1329,7 +1330,7 @@
ringing->getHeaderValueTo()->setParameter("tag",dialogState.localTag);
MRef<SipMessage*> pref(*ringing);
SipSMCommand cmd( pref,SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogConfVoip::sendRinging(const string &branch){
@@ -1337,7 +1338,7 @@
ringing->getHeaderValueTo()->setParameter("tag",dialogState.localTag);
MRef<SipMessage*> pref(*ringing);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogConfVoip::sendNotAcceptable(const string &branch){
@@ -1350,7 +1351,7 @@
not_acceptable->getHeaderValueTo()->setParameter("tag",dialogState.localTag);
MRef<SipMessage*> pref(*not_acceptable);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
Modified: trunk/libminisip/source/sip/SipDialogPresenceClient.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogPresenceClient.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/sip/SipDialogPresenceClient.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -210,7 +210,7 @@
SipSMCommand cmd( CommandString( dialogState.callId, SipCommandString::call_terminated),
SipSMCommand::dialog_layer,
SipSMCommand::dispatcher);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
return true;
}else{
return false;
@@ -324,7 +324,7 @@
SipSMCommand::transaction_layer
);
- dispatcher->enqueueCommand(scmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(scmd, HIGH_PRIO_QUEUE );
}
Modified: trunk/libminisip/source/sip/SipDialogPresenceServer.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogPresenceServer.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/sip/SipDialogPresenceServer.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -161,7 +161,7 @@
SipSMCommand cmd( CommandString( dialogState.callId, SipCommandString::call_terminated), //FIXME: callId is ""
SipSMCommand::dialog_layer,
SipSMCommand::dispatcher);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand( cmd, HIGH_PRIO_QUEUE);
return true;
}else{
return false;
@@ -271,7 +271,7 @@
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
sendNotice(onlineStatus, sub->getFrom().getUserIpString());
@@ -321,7 +321,7 @@
SipSMCommand::transaction_layer
);
- dispatcher->enqueueCommand(scmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(scmd, HIGH_PRIO_QUEUE );
}
bool SipDialogPresenceServer::handleCommand(const SipSMCommand &c){
Modified: trunk/libminisip/source/sip/SipDialogVoip.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogVoip.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/sip/SipDialogVoip.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -247,7 +247,7 @@
//this is for the shutdown dialog
CommandString earlystr( dialogState.callId, SipCommandString::call_terminated_early);
SipSMCommand cmd( earlystr, SipSMCommand::dialog_layer, SipSMCommand::dispatcher);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
return true;
}else{
@@ -268,7 +268,7 @@
SipSMCommand::dialog_layer,
SipSMCommand::dispatcher);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
/* Tell the GUI */
//CommandString cmdstr( dialogState.callId, SipCommandString::call_terminated);
//sipStack->getCallback()->handleCommand("gui", cmdstr );
@@ -299,7 +299,7 @@
notifyEarlyTermination = false;
}
SipSMCommand cmd( cmdstr, SipSMCommand::dialog_layer, SipSMCommand::dispatcher);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE ); //this is for the shutdown dialog
+ sipStack->enqueueCommand( cmd, HIGH_PRIO_QUEUE ); //this is for the shutdown dialog
return true;
}
else if ( notifyEarlyTermination && transitionMatch(SipResponse::type, command, SipSMCommand::dialog_layer, SipSMCommand::dialog_layer, "2**")){
@@ -313,7 +313,7 @@
//Tell the dialog container ...
SipSMCommand cmd( cmdstr, SipSMCommand::dialog_layer, SipSMCommand::dispatcher);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE ); //this is for the shutdown dialog
+ sipStack->enqueueCommand( cmd, HIGH_PRIO_QUEUE ); //this is for the shutdown dialog
return true;
}else{
return false;
@@ -398,7 +398,7 @@
SipSMCommand cmd(command);
cmd.setDestination(SipSMCommand::transaction_layer);
cmd.setSource(command.getSource());
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
sendNotifyOk(notif, "" );
@@ -608,7 +608,7 @@
MRef<SipMessage*> pref(*bye);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
}
void SipDialogVoip::sendRefer(const string &branch, int refer_seq_no, const string referredUri){
@@ -616,7 +616,7 @@
MRef<SipMessage*> pref(*refer);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogVoip::sendCancel(const string &branch){
@@ -635,7 +635,7 @@
MRef<SipMessage*> pref(*cancel);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand( cmd, HIGH_PRIO_QUEUE );
}
void SipDialogVoip::sendReferOk(const string &branch){
@@ -652,7 +652,7 @@
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogVoip::sendByeOk(MRef<SipRequest*> bye, const string &branch){
@@ -661,7 +661,7 @@
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogVoip::sendNotifyOk(MRef<SipRequest*> notif, const string &branch){
@@ -670,7 +670,7 @@
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogVoip::sendReferReject(const string &branch){
@@ -682,7 +682,7 @@
forbidden->getHeaderValueTo()->setParameter("tag",dialogState.localTag);
MRef<SipMessage*> pref(*forbidden);
SipSMCommand cmd( pref,SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
bool SipDialogVoip::handleCommand(const SipSMCommand &c){
Modified: trunk/libminisip/source/sip/SipDialogVoipClient.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogVoipClient.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/sip/SipDialogVoipClient.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -701,7 +701,7 @@
SipSMCommand::transaction_layer
);
- dispatcher->enqueueCommand(scmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(scmd, HIGH_PRIO_QUEUE);
setLastInvite(inv);
}
@@ -717,7 +717,7 @@
SipSMCommand::transport_layer
);
- dispatcher->enqueueCommand(scmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(scmd, HIGH_PRIO_QUEUE);
}
void SipDialogVoipClient::sendPrack(MRef<SipResponse*> rel100resp){
@@ -776,7 +776,7 @@
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
}
bool SipDialogVoipClient::handleRel1xx( MRef<SipResponse*> resp ){
Modified: trunk/libminisip/source/sip/SipDialogVoipServer.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogVoipServer.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/sip/SipDialogVoipServer.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -184,7 +184,7 @@
dialogState.remoteUri,
(getMediaSession()->isSecure()?"secure":"unprotected")
);
- dispatcher->getCallback()->handleCommand("gui", cmdstr );
+ sipStack->getCallback()->handleCommand("gui", cmdstr );
bool rel100Supported = inv->supported("100rel");
@@ -193,7 +193,7 @@
if( getDialogConfig()->inherited->autoAnswer ){
CommandString accept( dialogState.callId, SipCommandString::accept_invite );
SipSMCommand sipcmd(accept, SipSMCommand::dialog_layer, SipSMCommand::dialog_layer);
- dispatcher->enqueueCommand(sipcmd,HIGH_PRIO_QUEUE/*, PRIO_LAST_IN_QUEUE*/);
+ sipStack->enqueueCommand(sipcmd,HIGH_PRIO_QUEUE);
}
return true;
}else{
@@ -215,7 +215,7 @@
SipCommandString::invite_ok,"",
(getMediaSession()->isSecure()?"secure":"unprotected")
);
- dispatcher->getCallback()->handleCommand("gui", cmdstr );
+ sipStack->getCallback()->handleCommand("gui", cmdstr );
massert( !getLastInvite().isNull() );
sendInviteOk(getLastInvite()->getDestinationBranch() );
@@ -256,7 +256,7 @@
sendByeOk(bye, "" );
CommandString cmdstr(dialogState.callId, SipCommandString::remote_hang_up);
- dispatcher->getCallback()->handleCommand("gui", cmdstr);
+ sipStack->getCallback()->handleCommand("gui", cmdstr);
getMediaSession()->stop();
@@ -291,7 +291,7 @@
MRef<SipMessage*> cancelledMsg(*cancelledResp);
SipSMCommand cancelledCmd( cancelledMsg, SipSMCommand::dialog_layer,
SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cancelledCmd, HIGH_PRIO_QUEUE/*, PRIO_LAST_IN_QUEUE*/);
+ sipStack->enqueueCommand(cancelledCmd, HIGH_PRIO_QUEUE);
// Send 200 OK for CANCEL
MRef<SipResponse*> okResp = new SipResponse( branch, 200,"OK", MRef<SipMessage*>(*cancel) );
@@ -300,11 +300,11 @@
SipSMCommand okCmd( okMsg, SipSMCommand::dialog_layer,
SipSMCommand::transaction_layer);
//cr->handleCommand(okCmd);
- dispatcher->enqueueCommand(okCmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(okCmd, HIGH_PRIO_QUEUE);
/* Tell the GUI */
CommandString cmdstr(dialogState.callId, SipCommandString::remote_cancelled_invite,"");
- dispatcher->getCallback()->handleCommand("gui", cmdstr );
+ sipStack->getCallback()->handleCommand("gui", cmdstr );
getMediaSession()->stop();
signalIfNoTransactions();
@@ -457,7 +457,7 @@
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogVoipServer::sendReject(const string &branch){
@@ -465,7 +465,7 @@
ringing->getHeaderValueTo()->setParameter("tag",dialogState.localTag);
MRef<SipMessage*> pref(*ringing);
SipSMCommand cmd( pref,SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogVoipServer::sendRinging(const string &branch, bool use100Rel){
@@ -488,7 +488,7 @@
MRef<SipMessage*> pref(*ringing);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
void SipDialogVoipServer::sendNotAcceptable(const string &branch){
@@ -505,6 +505,6 @@
not_acceptable->getHeaderValueTo()->setParameter("tag",dialogState.localTag);
MRef<SipMessage*> pref(*not_acceptable);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE );
}
Modified: trunk/libminisip/source/sip/SipDialogVoipServer100rel.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogVoipServer100rel.cxx 2006-09-14 11:24:48 UTC (rev 2768)
+++ trunk/libminisip/source/sip/SipDialogVoipServer100rel.cxx 2006-09-14 11:28:09 UTC (rev 2769)
@@ -203,7 +203,7 @@
dialogState.remoteUri,
(getMediaSession()->isSecure()?"secure":"unprotected")
);
- dispatcher->getCallback()->handleCommand("gui", cmdstr );
+ sipStack->getCallback()->handleCommand("gui", cmdstr );
sendRinging(getLastInvite()->getDestinationBranch(),false); //we don't do th 180 reliably, only the 183
@@ -293,7 +293,7 @@
MRef<SipMessage*> pref(*ok);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
}
void SipDialogVoipServer100rel::resendSessionProgress(){
@@ -302,7 +302,7 @@
rseq->setRSeq( rseq->getRSeq() + 1 );
SipSMCommand cmd( lastProgress, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
}
void SipDialogVoipServer100rel::sendSessionProgress(const string &branch){
@@ -327,6 +327,6 @@
MRef<SipMessage*> pref(*progress);
SipSMCommand cmd( pref, SipSMCommand::dialog_layer, SipSMCommand::transaction_layer);
- dispatcher->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
+ sipStack->enqueueCommand(cmd, HIGH_PRIO_QUEUE);
}
More information about the Minisip-devel
mailing list