diff --git a/apps/sbc/SBC.cpp b/apps/sbc/SBC.cpp index 25175baa..c993e528 100644 --- a/apps/sbc/SBC.cpp +++ b/apps/sbc/SBC.cpp @@ -52,9 +52,6 @@ SBC - feature-wishlist using std::map; -string SBCFactory::user; -string SBCFactory::domain; -string SBCFactory::pwd; AmConfigReader SBCFactory::cfg; AmSessionEventHandlerFactory* SBCFactory::session_timer_fact = NULL; diff --git a/apps/sbc/SBC.h b/apps/sbc/SBC.h index 33fe52d4..d0bada12 100644 --- a/apps/sbc/SBC.h +++ b/apps/sbc/SBC.h @@ -66,9 +66,6 @@ class SBCFactory: public AmSessionFactory, int onLoad(); AmSession* onInvite(const AmSipRequest& req); - static string user; - static string domain; - static string pwd; static AmConfigReader cfg; static AmSessionEventHandlerFactory* session_timer_fact; diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp index d18c94dd..7de5fbf3 100644 --- a/core/AmB2BSession.cpp +++ b/core/AmB2BSession.cpp @@ -595,18 +595,20 @@ int AmB2BCallerSession::relayEvent(AmEvent* ev) { if(other_id.empty()){ - if(dynamic_cast(ev)){ - - B2BSipEvent* sip_ev = dynamic_cast(ev); - B2BConnectEvent* co_ev = dynamic_cast(ev); - - if( (sip_ev && sip_ev->forward) || co_ev ) { - createCalleeSession(); - if (other_id.length()) { - MONITORING_LOG(getLocalTag().c_str(), "b2b_leg", other_id.c_str()); - } + bool create_callee = false; + B2BSipEvent* sip_ev = dynamic_cast(ev); + if (sip_ev && sip_ev->forward) + create_callee = true; + else + create_callee = dynamic_cast(ev) != NULL; + + if (create_callee) { + createCalleeSession(); + if (other_id.length()) { + MONITORING_LOG(getLocalTag().c_str(), "b2b_leg", other_id.c_str()); } } + } return AmB2BSession::relayEvent(ev); diff --git a/core/AmB2BSession.h b/core/AmB2BSession.h index cd554c7e..dfbb242b 100644 --- a/core/AmB2BSession.h +++ b/core/AmB2BSession.h @@ -81,18 +81,6 @@ struct B2BSipReplyEvent: public B2BSipEvent { } }; -/** \brief relay a message body to other leg in B2B session */ -struct B2BMsgBodyEvent : public B2BEvent { - string content_type; - string body; - - B2BMsgBodyEvent(const string& content_type, - const string& body) - : B2BEvent(B2BMsgBody), - content_type(content_type), body(body) { } - ~B2BMsgBodyEvent() { } -}; - /** \brief trigger connecting the callee leg in B2B session */ struct B2BConnectEvent: public B2BEvent { diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index 6b4ba01d..3554ee60 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -97,13 +97,14 @@ void AmSipDialog::updateStatus(const AmSipRequest& req) return; } - if ((req.method == "INVITE") && pending_invites) { - reply_error(req,500, SIP_REPLY_SERVER_INTERNAL_ERROR, - "Retry-After: " + int2str(get_random() % 10) + CRLF); - return; - } - else { - pending_invites++; + if (req.method == "INVITE") { + if (pending_invites) { + reply_error(req,500, SIP_REPLY_SERVER_INTERNAL_ERROR, + "Retry-After: " + int2str(get_random() % 10) + CRLF); + return; + } + + pending_invites++; } r_cseq = req.cseq; diff --git a/core/sip/udp_trsp.cpp b/core/sip/udp_trsp.cpp index 9f081e21..6e7243f4 100644 --- a/core/sip/udp_trsp.cpp +++ b/core/sip/udp_trsp.cpp @@ -182,7 +182,7 @@ void udp_trsp::run() return; } - DBG("Started UDP server listening to %s:%i\n",sock->get_ip(),sock->get_port()); + DBG("Started UDP server listening on %s:%i\n",sock->get_ip(),sock->get_port()); while(true){