diff --git a/daemon/src/sip/sdp.cpp b/daemon/src/sip/sdp.cpp index 76ab9c86221538b29d54980b3f63c2bfb293096a..cc895e3afff4d2e49d0671260e439c2378e43f6c 100644 --- a/daemon/src/sip/sdp.cpp +++ b/daemon/src/sip/sdp.cpp @@ -92,7 +92,7 @@ void Sdp::setActiveRemoteSdpSession(const pjmedia_sdp_session *sdp) activeRemoteSession_ = (pjmedia_sdp_session*) sdp; if (!sdp) { - ERROR("Sdp: Error: Remote sdp is NULL while parsing telephone event attribute"); + ERROR("Remote sdp is NULL while parsing telephone event attribute"); return; } @@ -111,7 +111,7 @@ void Sdp::setActiveRemoteSdpSession(const pjmedia_sdp_session *sdp) return; } - ERROR("Sdp: Error: Could not found dtmf event from remote sdp"); + ERROR("Could not found dtmf event from remote sdp"); } std::string Sdp::getCodecName() @@ -238,7 +238,7 @@ int Sdp::createLocalSession(const CodecOrder &selectedCodecs) localSession_ = PJ_POOL_ZALLOC_T(memPool_, pjmedia_sdp_session); if (!localSession_) { - ERROR("Sdp: Could not create local SDP session"); + ERROR("Could not create local SDP session"); return !PJ_SUCCESS; } @@ -275,7 +275,7 @@ int Sdp::createLocalSession(const CodecOrder &selectedCodecs) if (!srtpCrypto_.empty()) addSdesAttribute(srtpCrypto_); - DEBUG("SDP: Local SDP Session:"); + DEBUG("Local SDP Session:"); printSession(localSession_); return pjmedia_sdp_validate(localSession_); @@ -284,24 +284,24 @@ int Sdp::createLocalSession(const CodecOrder &selectedCodecs) void Sdp::createOffer(const CodecOrder &selectedCodecs) { if (createLocalSession(selectedCodecs) != PJ_SUCCESS) - ERROR("SDP: Error: Failed to create initial offer"); + ERROR("Failed to create initial offer"); else if (pjmedia_sdp_neg_create_w_local_offer(memPool_, localSession_, &negotiator_) != PJ_SUCCESS) - ERROR("SDP: Error: Failed to create an initial SDP negotiator"); + ERROR("Failed to create an initial SDP negotiator"); } void Sdp::receiveOffer(const pjmedia_sdp_session* remote, const CodecOrder &selectedCodecs) { if (!remote) { - ERROR("SDP: Remote session is NULL"); + ERROR("Remote session is NULL"); return; } - DEBUG("SDP: Remote SDP Session:"); + DEBUG("Remote SDP Session:"); printSession(remote); if (localSession_ == NULL && createLocalSession(selectedCodecs) != PJ_SUCCESS) { - ERROR("SDP: Failed to create initial offer"); + ERROR("Failed to create initial offer"); return; } @@ -317,7 +317,7 @@ void Sdp::receiveOffer(const pjmedia_sdp_session* remote, void Sdp::startNegotiation() { if (negotiator_ == NULL) { - ERROR("Sdp: Can't start negotiation with invalid negotiator"); + ERROR("Can't start negotiation with invalid negotiator"); return; } @@ -325,18 +325,18 @@ void Sdp::startNegotiation() const pjmedia_sdp_session *active_remote; if (pjmedia_sdp_neg_get_state(negotiator_) != PJMEDIA_SDP_NEG_STATE_WAIT_NEGO) - WARN("SDP: Warning: negotiator not in right state for negotiation"); + WARN("Negotiator not in right state for negotiation"); if (pjmedia_sdp_neg_negotiate(memPool_, negotiator_, 0) != PJ_SUCCESS) return; if (pjmedia_sdp_neg_get_active_local(negotiator_, &active_local) != PJ_SUCCESS) - ERROR("SDP: Could not retrieve local active session"); + ERROR("Could not retrieve local active session"); else setActiveLocalSdpSession(active_local); if (pjmedia_sdp_neg_get_active_remote(negotiator_, &active_remote) != PJ_SUCCESS) - ERROR("SDP: Could not retrieve remote active session"); + ERROR("Could not retrieve remote active session"); else setActiveRemoteSdpSession(active_remote); } @@ -385,7 +385,7 @@ void Sdp::removeAttributeFromLocalAudioMedia(const char *attr) void Sdp::setMediaTransportInfoFromRemoteSdp() { if (!activeRemoteSession_) { - ERROR("Sdp: Error: Remote sdp is NULL while parsing media"); + ERROR("Remote sdp is NULL while parsing media"); return; } @@ -396,7 +396,7 @@ void Sdp::setMediaTransportInfoFromRemoteSdp() return; } - ERROR("SDP: No remote sdp media found in the remote offer"); + ERROR("No remote sdp media found in the remote offer"); } void Sdp::getRemoteSdpCryptoFromOffer(const pjmedia_sdp_session* remote_sdp, CryptoOffer& crypto_offer) diff --git a/daemon/src/sip/sip_utils.cpp b/daemon/src/sip/sip_utils.cpp index dd703f337eb518a278cecf3203c0d2a91bda4c66..bdcd57542a5971163f42355df615fb8172d75810 100644 --- a/daemon/src/sip/sip_utils.cpp +++ b/daemon/src/sip/sip_utils.cpp @@ -40,8 +40,6 @@ #include <pjsip/sip_types.h> #include <pjsip/sip_uri.h> #include <pj/list.h> - - #include "sip_utils.h" std::string diff --git a/daemon/src/sip/sipaccount.cpp b/daemon/src/sip/sipaccount.cpp index 8d259ff77aa227355ad47bdb51b90e126b091914..d983127b0a91058dc17d2a96c64a4c11d7ec639c 100644 --- a/daemon/src/sip/sipaccount.cpp +++ b/daemon/src/sip/sipaccount.cpp @@ -238,7 +238,7 @@ void SIPAccount::serialize(Conf::YamlEmitter &emitter) try { emitter.serializeAccount(&accountmap); } catch (const YamlEmitterException &e) { - ERROR("ConfigTree: %s", e.what()); + ERROR("%s", e.what()); } Sequence *seq = credentialseq.getSequence(); @@ -547,7 +547,7 @@ void SIPAccount::registerVoIPLink() // Init TLS settings if the user wants to use TLS if (tlsEnable_ == "true") { - DEBUG("SIPAccount: TLS is enabled for account %s", accountID_.c_str()); + DEBUG("TLS is enabled for account %s", accountID_.c_str()); transportType_ = PJSIP_TRANSPORT_TLS; initTlsConfiguration(); } @@ -568,7 +568,7 @@ void SIPAccount::registerVoIPLink() try { link_->sendRegister(this); } catch (const VoipLinkException &e) { - ERROR("SIPAccount: %s", e.what()); + ERROR("%s", e.what()); } } @@ -580,7 +580,7 @@ void SIPAccount::unregisterVoIPLink() try { link_->sendUnregister(this); } catch (const VoipLinkException &e) { - ERROR("SIPAccount: %s", e.what()); + ERROR("%s", e.what()); } } @@ -595,7 +595,7 @@ void SIPAccount::startKeepAliveTimer() { if(keepAliveTimerActive_) return; - DEBUG("SipAccount: start keep alive timer for account %s", getAccountID().c_str()); + DEBUG("Start keep alive timer for account %s", getAccountID().c_str()); // make sure here we have an entirely new timer memset(&keepAliveTimer_, 0, sizeof(pj_timer_entry)); @@ -607,11 +607,11 @@ void SIPAccount::startKeepAliveTimer() { // expiration may be undetermined during the first registration request if (registrationExpire_ == 0) { - DEBUG("SipAccount: Registration Expire: 0, taking 60 instead"); + DEBUG("Registration Expire: 0, taking 60 instead"); keepAliveDelay_.sec = 3600; } else { - DEBUG("SipAccount: Registration Expire: %d", registrationExpire_); + DEBUG("Registration Expire: %d", registrationExpire_); keepAliveDelay_.sec = registrationExpire_ + MIN_REGISTRATION_TIME; } @@ -623,7 +623,7 @@ void SIPAccount::startKeepAliveTimer() { } void SIPAccount::stopKeepAliveTimer() { - DEBUG("SipAccount: stop keep alive timer %d for account %s", keepAliveTimer_.id, getAccountID().c_str()); + DEBUG("Stop keep alive timer %d for account %s", keepAliveTimer_.id, getAccountID().c_str()); keepAliveTimerActive_ = false; @@ -810,7 +810,7 @@ void SIPAccount::setContactHeader(std::string address, std::string port) std::string SIPAccount::getContactHeader() const { if (transport_ == NULL) - ERROR("SipAccount: Transport not created yet"); + ERROR("Transport not created yet"); // The transport type must be specified, in our case START_OTHER refers to stun transport pjsip_transport_type_e transportType = transportType_; @@ -853,10 +853,10 @@ void SIPAccount::keepAliveRegistrationCb(UNUSED pj_timer_heap_t *th, pj_timer_en { SIPAccount *sipAccount = static_cast<SIPAccount *>(te->user_data); - ERROR("SipAccount: Keep alive registration callback for account %s", sipAccount->getAccountID().c_str()); + ERROR("Keep alive registration callback for account %s", sipAccount->getAccountID().c_str()); if (sipAccount == NULL) { - ERROR("Sip account is NULL while registering a new keep alive timer"); + ERROR("SIP account is NULL while registering a new keep alive timer"); return; } @@ -908,7 +908,7 @@ void SIPAccount::setCredentials(const std::vector<std::map<std::string, std::str { // we can not authenticate without credentials if (creds.empty()) { - ERROR("SIPAccount: Cannot authenticate with empty credentials list"); + ERROR("Cannot authenticate with empty credentials list"); return; } diff --git a/daemon/src/sip/sipcall.cpp b/daemon/src/sip/sipcall.cpp index 9c5c9d584027dbcb22ee0b7f427b5b2426ac23e6..b663518613fc0226dad27922f29df136c63a33f9 100644 --- a/daemon/src/sip/sipcall.cpp +++ b/daemon/src/sip/sipcall.cpp @@ -32,7 +32,6 @@ */ #include "sipcall.h" -#include "audio/audiortp/audio_rtp_factory.h" #include "sdp.h" namespace { diff --git a/daemon/src/sip/siptransport.cpp b/daemon/src/sip/siptransport.cpp index 34ebdd518045c406356e124fe264d14a5367581c..e33545637b325640079e62fe9c54ae16cf31fd30 100644 --- a/daemon/src/sip/siptransport.cpp +++ b/daemon/src/sip/siptransport.cpp @@ -69,7 +69,7 @@ std::string SipTransport::getSIPLocalIP() if (pj_gethostip(pj_AF_INET(), &ip_addr) == PJ_SUCCESS) return pj_inet_ntoa(ip_addr.ipv4.sin_addr); else { - ERROR("SipTransport: Could not get local IP"); + ERROR("Could not get local IP"); return ""; } } @@ -103,7 +103,7 @@ std::string SipTransport::getInterfaceAddrFromName(const std::string &ifaceName) int fd = socket(AF_INET, SOCK_DGRAM,0); if (fd < 0) { - ERROR("SipTransport: Error: could not open socket: %m"); + ERROR("Error: could not open socket: %m"); return ""; } @@ -146,26 +146,26 @@ stun_sock_on_status_cb(pj_stun_sock * /*stun_sock*/, pj_stun_sock_op op, { switch (op) { case PJ_STUN_SOCK_DNS_OP: - DEBUG("SipTransport: Stun operation dns resolution"); + DEBUG("STUN operation dns resolution"); break; case PJ_STUN_SOCK_BINDING_OP: - DEBUG("SipTransport: Stun operation binding"); + DEBUG("STUN operation binding"); break; case PJ_STUN_SOCK_KEEP_ALIVE_OP: - DEBUG("SipTransport: Stun operation keep alive"); + DEBUG("STUN operation keep alive"); break; case PJ_STUN_SOCK_MAPPED_ADDR_CHANGE: - DEBUG("SipTransport: Stun operation address mapping change"); + DEBUG("STUN operation address mapping change"); break; default: - DEBUG("SipTransport: Stun unknown operation"); + DEBUG("STUN unknown operation"); break; } if (status == PJ_SUCCESS) { - DEBUG("SipTransport: Stun operation success"); + DEBUG("STUN operation success"); } else { - ERROR("SipTransport: Stun operation failure"); + ERROR("STUN operation failure"); } // Always return true so the stun transport registration retry even on failure @@ -186,7 +186,7 @@ pj_status_t SipTransport::createStunResolver(pj_str_t serverName, pj_uint16_t po { std::string stunResolverName(serverName.ptr, serverName.slen); if (stunSocketMap_.find(stunResolverName) != stunSocketMap_.end()) { - DEBUG("SipTransport: %s already added", stunResolverName.c_str()); + DEBUG("%s already added", stunResolverName.c_str()); return PJ_SUCCESS; } @@ -208,8 +208,8 @@ pj_status_t SipTransport::createStunResolver(pj_str_t serverName, pj_uint16_t po if (status != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; pj_strerror(status, errmsg, sizeof(errmsg)); - ERROR("SipTransport: Error creating STUN socket for %.*s: %s", - (int) serverName.slen, serverName.ptr, errmsg); + ERROR("Failed to create STUN socket for %.*s: %s", + (int) serverName.slen, serverName.ptr, errmsg); return status; } @@ -217,12 +217,12 @@ pj_status_t SipTransport::createStunResolver(pj_str_t serverName, pj_uint16_t po // store socket inside list if (status == PJ_SUCCESS) { - DEBUG("SipTransport: Adding %s resolver", stunResolverName.c_str()); + DEBUG("Adding %s resolver", stunResolverName.c_str()); stunSocketMap_[stunResolverName] = stun_sock; } else { char errmsg[PJ_ERR_MSG_SIZE]; pj_strerror(status, errmsg, sizeof(errmsg)); - DEBUG("SipTransport: Error starting STUN socket for %.*s: %s", + DEBUG("Error starting STUN socket for %.*s: %s", (int) serverName.slen, serverName.ptr, errmsg); pj_stun_sock_destroy(stun_sock); } @@ -238,7 +238,7 @@ pj_status_t SipTransport::destroyStunResolver(const std::string &serverName) DEBUG("***************** Destroy Stun Resolver *********************"); if (it != stunSocketMap_.end()) { - DEBUG("SipTransport: Deleting stun resolver %s", it->first.c_str()); + DEBUG("Deleting STUN resolver %s", it->first.c_str()); if (it->second) pj_stun_sock_destroy(it->second); stunSocketMap_.erase(it); @@ -255,7 +255,7 @@ pjsip_tpfactory* SipTransport::createTlsListener(SIPAccount &account) local_addr.sin_port = pj_htons(account.getTlsListenerPort()); if (account.getTlsSetting() == NULL) { - ERROR("SipTransport: Error TLS settings not specified"); + ERROR("Error TLS settings not specified"); return NULL; } @@ -267,7 +267,7 @@ pjsip_tpfactory* SipTransport::createTlsListener(SIPAccount &account) listeningAddress = getInterfaceAddrFromName(interface); if (listeningAddress.empty()) - ERROR("SipTransport: Could not determine ip address for this transport"); + ERROR("Could not determine IP address for this transport"); pj_str_t pjAddress; pj_cstr(&pjAddress, listeningAddress.c_str()); @@ -277,7 +277,7 @@ pjsip_tpfactory* SipTransport::createTlsListener(SIPAccount &account) pjsip_tpfactory *listener = NULL; if (pjsip_tls_transport_start(endpt_, account.getTlsSetting(), &local_addr, NULL, 1, &listener) != PJ_SUCCESS) { - ERROR("SipTransport: Error Failed to start tls listener"); + ERROR("Failed to start tls listener"); listener = NULL; } return listener; @@ -316,12 +316,12 @@ SipTransport::createTlsTransport(SIPAccount &account) if (localTlsListener == NULL) localTlsListener = createTlsListener(account); - DEBUG("SipTransport: Get new tls transport from transport manager"); + DEBUG("Get new tls transport from transport manager"); pjsip_transport *transport = NULL; pjsip_endpt_acquire_transport(endpt_, PJSIP_TRANSPORT_TLS, &rem_addr, sizeof rem_addr, NULL, &transport); if (transport == NULL) - ERROR("SipTransport: Could not create new TLS transport\n"); + ERROR("Could not create new TLS transport\n"); return transport; } @@ -335,7 +335,7 @@ void SipTransport::createSipTransport(SIPAccount &account) } else if (account.isStunEnabled()) { account.transport_ = createStunTransport(account); if (account.transport_ == NULL) { - WARN("SipTransport: falling back to UDP transport"); + WARN("falling back to UDP transport"); account.transport_ = createUdpTransport(account.getLocalInterface(), account.getLocalPort()); } } else { @@ -347,7 +347,7 @@ void SipTransport::createSipTransport(SIPAccount &account) key << account.getLocalInterface(); key << ":"; key << account.getLocalPort(); - DEBUG("SipTransport: Looking into previously created transport map for" + DEBUG("Looking into previously created transport map for" " %s", key.str().c_str()); // Could not create new transport, this transport may already exists pjsip_transport *cachedTransport = transportMap_[key.str()]; @@ -367,7 +367,7 @@ void SipTransport::createSipTransport(SIPAccount &account) void SipTransport::createDefaultSipUdpTransport() { - DEBUG("SipTransport: Create default sip udp transport"); + DEBUG("Create default sip udp transport"); SIPAccount *account = Manager::instance().getIP2IPAccount(); @@ -382,11 +382,11 @@ void SipTransport::createDefaultSipUdpTransport() } if (transport == NULL) { - ERROR("SipTransport: Create UDP transport"); + ERROR("Could not create UDP transport"); return; } - DEBUG("SipTransport: Created default sip transport on %d", port); + DEBUG("Created default sip transport on %d", port); // set transport for this account account->transport_ = transport; @@ -401,7 +401,7 @@ SipTransport::createUdpTransport(const std::string &interface, unsigned int port // init socket to bind this transport to pj_uint16_t listeningPort = (pj_uint16_t) port; - DEBUG("SipTransport: Create UDP transport on %s:%d", interface.c_str(), port); + DEBUG("Create UDP transport on %s:%d", interface.c_str(), port); // determine the ip address for this transport std::string listeningAddress; @@ -411,12 +411,12 @@ SipTransport::createUdpTransport(const std::string &interface, unsigned int port listeningAddress = getInterfaceAddrFromName(interface); if (listeningAddress.empty()) { - ERROR("SipTransport: Could not determine ip address for this transport"); + ERROR("Could not determine ip address for this transport"); return NULL; } if (listeningPort == 0) { - ERROR("SipTransport: Could not determine port for this transport"); + ERROR("Could not determine port for this transport"); return NULL; } @@ -444,7 +444,7 @@ SipTransport::createUdpTransport(const std::string &interface, unsigned int port } } - DEBUG("SipTransport: Listening address %s", fullAddressStr.c_str()); + DEBUG("Listening address %s", fullAddressStr.c_str()); // dump debug information to stdout pjsip_tpmgr_dump_transports(pjsip_endpt_get_tpmgr(endpt_)); transportMap_[fullAddressStr] = transport; @@ -459,8 +459,8 @@ SipTransport::createUdpTransport(const std::string &interface, unsigned int port pj_uint16_t listeningPort = (pj_uint16_t) port; pjsip_transport *transport = NULL; - DEBUG("SipTransport: Update UDP transport on %s:%d with public addr %s:%d", - interface.c_str(), port, publicAddr.c_str(), publicPort); + DEBUG("Update UDP transport on %s:%d with public addr %s:%d", + interface.c_str(), port, publicAddr.c_str(), publicPort); // determine the ip address for this transport std::string listeningAddress; @@ -470,7 +470,7 @@ SipTransport::createUdpTransport(const std::string &interface, unsigned int port listeningAddress = getInterfaceAddrFromName(interface); if (listeningAddress.empty()) { - ERROR("SipTransport: Could not determine ip address for this transport"); + ERROR("Could not determine ip address for this transport"); return NULL; } @@ -491,7 +491,7 @@ SipTransport::createUdpTransport(const std::string &interface, unsigned int port // status = pjsip_udp_transport_restart(transport, PJSIP_UDP_TRANSPORT_DESTROY_SOCKET, PJ_INVALID_SOCKET, &boundAddr.ipv4, &hostPort); status = pjsip_udp_transport_start(endpt_, &boundAddr.ipv4, &hostPort, 1, &transport); if (status != PJ_SUCCESS) { - ERROR("SipTransport: Could not start new transport with address %s:%d, error code %d", publicAddr.c_str(), publicPort, status); + ERROR("Could not start new transport with address %s:%d, error code %d", publicAddr.c_str(), publicPort, status); } // dump debug information to stdout @@ -503,7 +503,7 @@ SipTransport::createUdpTransport(const std::string &interface, unsigned int port pjsip_tpselector *SipTransport::initTransportSelector(pjsip_transport *transport, pj_pool_t *tp_pool) const { if (!transport) { - ERROR("SipTransport: transport is not initialized"); + ERROR("Transport is not initialized"); return NULL; } pjsip_tpselector *tp = (pjsip_tpselector *) pj_pool_zalloc(tp_pool, sizeof(pjsip_tpselector)); @@ -517,9 +517,9 @@ pjsip_transport *SipTransport::createStunTransport(SIPAccount &account) pj_str_t serverName = account.getStunServerName(); pj_uint16_t port = account.getStunPort(); - DEBUG("SipTransport: Create STUN transport server name: %s, port: %d", serverName, port); + DEBUG("Create STUN transport server name: %s, port: %d", serverName, port); if (createStunResolver(serverName, port) != PJ_SUCCESS) { - ERROR("SipTransport: Can't resolve STUN server"); + ERROR("Can't resolve STUN server"); Manager::instance().getDbusManager()->getConfigurationManager()->stunStatusFailure(account.getAccountID()); return NULL; } @@ -529,13 +529,13 @@ pjsip_transport *SipTransport::createStunTransport(SIPAccount &account) pj_sockaddr_in boundAddr; if (pj_sockaddr_in_init(&boundAddr, &serverName, 0) != PJ_SUCCESS) { - ERROR("SipTransport: Can't initialize IPv4 socket on %*s:%i", serverName.slen, serverName.ptr, port); + ERROR("Can't initialize IPv4 socket on %*s:%i", serverName.slen, serverName.ptr, port); Manager::instance().getDbusManager()->getConfigurationManager()->stunStatusFailure(account.getAccountID()); return NULL; } if (pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &sock) != PJ_SUCCESS) { - ERROR("SipTransport: Can't create or bind socket"); + ERROR("Can't create or bind socket"); Manager::instance().getDbusManager()->getConfigurationManager()->stunStatusFailure(account.getAccountID()); return NULL; } @@ -544,7 +544,7 @@ pjsip_transport *SipTransport::createStunTransport(SIPAccount &account) pj_sockaddr_in pub_addr; if (pjstun_get_mapped_addr(&cp_->factory, 1, &sock, &serverName, port, &serverName, port, &pub_addr) != PJ_SUCCESS) { - ERROR("SipTransport: Can't contact STUN server"); + ERROR("Can't contact STUN server"); pj_sock_close(sock); Manager::instance().getDbusManager()->getConfigurationManager()->stunStatusFailure(account.getAccountID()); return NULL; @@ -591,14 +591,14 @@ void SipTransport::findLocalAddressFromTransport(pjsip_transport *transport, pjs // Update address and port with active transport if (!transport) { - ERROR("SipTransport: Transport is NULL in findLocalAddress, using local address %s:%s", addr.c_str(), port.c_str()); + ERROR("Transport is NULL in findLocalAddress, using local address %s:%s", addr.c_str(), port.c_str()); return; } // get the transport manager associated with the SIP enpoint pjsip_tpmgr *tpmgr = pjsip_endpt_get_tpmgr(endpt_); if (!tpmgr) { - ERROR("SipTransport: Transport manager is NULL in findLocalAddress, using local address %s:%s", addr.c_str(), port.c_str()); + ERROR("Transport manager is NULL in findLocalAddress, using local address %s:%s", addr.c_str(), port.c_str()); return; } @@ -607,7 +607,7 @@ void SipTransport::findLocalAddressFromTransport(pjsip_transport *transport, pjs // if (transportType == PJSIP_TRANSPORT_UDP and transport_) pjsip_tpselector *tp_sel = initTransportSelector(transport, pool_); if (!tp_sel) { - ERROR("SipTransport: Could not initialize transport selector, using local address %s:%s", addr.c_str(), port.c_str()); + ERROR("Could not initialize transport selector, using local address %s:%s", addr.c_str(), port.c_str()); return; } diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp index 4ae95c0ea46850a39a355e14adfbd2af740159c8..8a5988057eee11f526e6611a09f552cd5a464da7 100644 --- a/daemon/src/sip/sipvoiplink.cpp +++ b/daemon/src/sip/sipvoiplink.cpp @@ -173,12 +173,12 @@ pj_bool_t transaction_response_cb(pjsip_rx_data *rdata) pj_bool_t transaction_request_cb(pjsip_rx_data *rdata) { if (!rdata or !rdata->msg_info.msg) { - ERROR("SIPVoIPLink: rx_data is NULL"); + ERROR("rx_data is NULL"); return false; } pjsip_method *method = &rdata->msg_info.msg->line.req.method; if (!method) { - ERROR("SIPVoIPLink: method is NULL"); + ERROR("method is NULL"); return false; } @@ -325,7 +325,7 @@ pj_bool_t transaction_request_cb(pjsip_rx_data *rdata) PJ_ASSERT_RETURN(pjsip_dlg_set_transport(dialog, tp) == PJ_SUCCESS, 1); if (!call->inv) { - ERROR("SIPVoIPLink: Call invite is not initialized"); + ERROR("Call invite is not initialized"); delete call; return false; } @@ -439,7 +439,7 @@ SIPVoIPLink::SIPVoIPLink() : sipTransport(endpt_, cp_, pool_), evThread_(this) static const pj_str_t accepted = { (char*) "application/sdp", 15 }; pjsip_endpt_add_capability(endpt_, &mod_ua_, PJSIP_H_ACCEPT, NULL, 1, &accepted); - DEBUG("UserAgent: pjsip version %s for %s initialized", pj_get_version(), PJ_OS_NAME); + DEBUG("pjsip version %s for %s initialized", pj_get_version(), PJ_OS_NAME); TRY(pjsip_replaces_init_module(endpt_)); #undef TRY @@ -490,7 +490,7 @@ bool SIPVoIPLink::getEvent() // We have to register the external thread so it could access the pjsip frameworks if (!pj_thread_is_registered()) { - DEBUG("%s: Registering thread", __PRETTY_FUNCTION__); + DEBUG("Registering thread"); pj_thread_register(NULL, desc, &thread_); } @@ -539,7 +539,7 @@ void SIPVoIPLink::sendRegister(Account *a) account->transport_= sipTransport.createUdpTransport(account->getLocalInterface(), 0, received, account->getRPort()); account->setRPort(-1); if(account->transport_ == NULL) { - ERROR("UserAgent: Could not create new udp transport with public address: %s:%d", received.c_str(), account->getLocalPort()); + ERROR("Could not create new udp transport with public address: %s:%d", received.c_str(), account->getLocalPort()); } } @@ -619,19 +619,19 @@ void SIPVoIPLink::sendUnregister(Account *a) void SIPVoIPLink::registerKeepAliveTimer(pj_timer_entry &timer, pj_time_val &delay) { - DEBUG("UserAgent: Register new keep alive timer %d with delay %d", timer.id, delay.sec); + DEBUG("Register new keep alive timer %d with delay %d", timer.id, delay.sec); if (timer.id == -1) - WARN("UserAgent: Timer already scheduled"); + WARN("Timer already scheduled"); switch (pjsip_endpt_schedule_timer(endpt_, &timer, &delay)) { case PJ_SUCCESS: break; default: - ERROR("UserAgent: Could not schedule new timer in pjsip endpoint"); + ERROR("Could not schedule new timer in pjsip endpoint"); /* fallthrough */ case PJ_EINVAL: - ERROR("UserAgent: Invalid timer or delay entry"); + ERROR("Invalid timer or delay entry"); break; case PJ_EINVALIDOP: ERROR("Invalid timer entry, maybe already scheduled"); @@ -649,7 +649,7 @@ Call *SIPVoIPLink::newOutgoingCall(const std::string& id, const std::string& toU static const char * const SIP_SCHEME = "sip:"; static const char * const SIPS_SCHEME = "sips:"; - DEBUG("UserAgent: New outgoing call"); + DEBUG("New outgoing call"); bool IPToIP = toUrl.find(SIP_SCHEME) == 0 or toUrl.find(SIPS_SCHEME) == 0; @@ -671,7 +671,7 @@ Call *SIPVoIPLink::newOutgoingCall(const std::string& id, const std::string& toU Call *SIPVoIPLink::SIPNewIpToIpCall(const std::string& id, const std::string& to) { - DEBUG("UserAgent: New IP to IP call to %s", to.c_str()); + DEBUG("New IP to IP call to %s", to.c_str()); SIPAccount *account = Manager::instance().getIP2IPAccount(); @@ -716,7 +716,7 @@ Call *SIPVoIPLink::SIPNewIpToIpCall(const std::string& id, const std::string& to Call *SIPVoIPLink::newRegisteredAccountCall(const std::string& id, const std::string& toUrl) { - DEBUG("UserAgent: New registered account call to %s", toUrl.c_str()); + DEBUG("New registered account call to %s", toUrl.c_str()); SIPAccount *account = dynamic_cast<SIPAccount *>(Manager::instance().getAccount(Manager::instance().getAccountFromCall(id))); @@ -900,7 +900,7 @@ SIPVoIPLink::offhold(const std::string& id) call->getAudioRtp().initSession(); call->getAudioRtp().start(static_cast<sfl::AudioCodec *>(audiocodec)); } catch (const SdpException &e) { - ERROR("UserAgent: Exception: %s", e.what()); + ERROR("%s", e.what()); } catch (...) { throw VoipLinkException("Could not create audio rtp session"); } @@ -1129,12 +1129,12 @@ SIPVoIPLink::SIPStartCall(SIPCall *call) pjsip_dialog *dialog = NULL; if (pjsip_dlg_create_uac(pjsip_ua_instance(), &pjFrom, &pjContact, &pjTo, NULL, &dialog) != PJ_SUCCESS) { - ERROR("UserAgent: Unable to sip create dialogs for user agent client"); + ERROR("Unable to sip create dialogs for user agent client"); return false; } if (pjsip_inv_create_uac(dialog, call->getLocalSDP()->getLocalSdpSession(), 0, &call->inv) != PJ_SUCCESS) { - ERROR("UserAgent: Unable to create invite session for user agent client"); + ERROR("Unable to create invite session for user agent client"); return false; } @@ -1142,7 +1142,7 @@ SIPVoIPLink::SIPStartCall(SIPCall *call) pjsip_dlg_set_route_set(dialog, sip_utils::createRouteSet(account->getServiceRoute(), call->inv->pool)); if (pjsip_auth_clt_set_credentials(&dialog->auth_sess, account->getCredentialCount(), account->getCredInfo()) != PJ_SUCCESS) { - ERROR("UserAgent: Could not initiaize credential for invite session authentication"); + ERROR("Could not initiaize credential for invite session authentication"); return false; } @@ -1151,19 +1151,19 @@ SIPVoIPLink::SIPStartCall(SIPCall *call) pjsip_tx_data *tdata; if (pjsip_inv_invite(call->inv, &tdata) != PJ_SUCCESS) { - ERROR("UserAgent: Could not initialize invite messager for this call"); + ERROR("Could not initialize invite messager for this call"); return false; } pjsip_tpselector *tp = sipTransport.initTransportSelector(account->transport_, call->inv->pool); if (pjsip_dlg_set_transport(dialog, tp) != PJ_SUCCESS) { - ERROR("UserAgent: Unable to associate transport fir invite session dialog"); + ERROR("Unable to associate transport fir invite session dialog"); return false; } if (pjsip_inv_send_msg(call->inv, tdata) != PJ_SUCCESS) { - ERROR("UserAgent: Unable to send invite message for this call"); + ERROR("Unable to send invite message for this call"); return false; } @@ -1333,19 +1333,19 @@ void sdp_media_update_cb(pjsip_inv_session *inv, pj_status_t status) SIPCall *call = static_cast<SIPCall *>(inv->mod_data[mod_ua_.id]); if (call == NULL) { - DEBUG("UserAgent: Call declined by peer, SDP negotiation stopped"); + DEBUG("Call declined by peer, SDP negotiation stopped"); return; } if (status != PJ_SUCCESS) { - WARN("UserAgent: Error: while negotiating the offer"); + WARN("Could not negotiate offer"); SIPVoIPLink::instance()->hangup(call->getCallId()); Manager::instance().callFailure(call->getCallId()); return; } if (!inv->neg) { - WARN("UserAgent: Error: no negotiator for this session"); + WARN("No negotiator for this session"); return; } @@ -1362,11 +1362,11 @@ void sdp_media_update_cb(pjsip_inv_session *inv, pj_status_t status) char buffer[1000]; memset(buffer, 0, sizeof buffer); pjmedia_sdp_print(remote_sdp, buffer, sizeof buffer); - DEBUG("SDP: Remote active SDP Session:\n%s", buffer); + DEBUG("Remote active SDP Session:\n%s", buffer); memset(buffer, 0, sizeof buffer); pjmedia_sdp_print(local_sdp, buffer, sizeof buffer); - DEBUG("SDP: Local active SDP Session:\n%s", buffer); + DEBUG("Local active SDP Session:\n%s", buffer); // Set active SDP sessions sdpSession->setActiveRemoteSdpSession(remote_sdp); @@ -1393,7 +1393,7 @@ void sdp_media_update_cb(pjsip_inv_session *inv, pj_status_t status) sfl::SdesNegotiator sdesnego(localCapabilities, crypto_offer); if (sdesnego.negotiate()) { - DEBUG("UserAgent: SDES negotiation successfull"); + DEBUG("SDES negotiation successfull"); nego_success = true; try { @@ -1402,12 +1402,12 @@ void sdp_media_update_cb(pjsip_inv_session *inv, pj_status_t status) Manager::instance().getDbusManager()->getCallManager()->secureSdesOn(call->getCallId()); } else { - ERROR("UserAgent: SDES negotiation failure"); + ERROR("SDES negotiation failure"); Manager::instance().getDbusManager()->getCallManager()->secureSdesOff(call->getCallId()); } } else { - DEBUG("UserAgent: No crypto offer available"); + DEBUG("No crypto offer available"); } // We did not find any crypto context for this media, RTP fallback @@ -1441,9 +1441,9 @@ void sdp_media_update_cb(pjsip_inv_session *inv, pj_status_t status) call->getAudioRtp().updateSessionMedia(static_cast<sfl::AudioCodec *>(audiocodec)); } } catch (const SdpException &e) { - ERROR("UserAgent: Exception: %s", e.what()); + ERROR("%s", e.what()); } catch (const std::exception &rtpException) { - ERROR("UserAgent: Exception: %s", rtpException.what()); + ERROR("%s", rtpException.what()); } } @@ -1471,7 +1471,7 @@ void transaction_state_changed_cb(pjsip_inv_session * inv, if (r_data && r_data->msg_info.msg->line.req.method.id == PJSIP_OTHER_METHOD) { std::string request = pjsip_rx_data_get_info(r_data); - DEBUG("UserAgent: %s", request.c_str()); + DEBUG("%s", request.c_str()); if (request.find("NOTIFY") == std::string::npos && request.find("INFO") != std::string::npos) { pjsip_dlg_create_response(inv->dlg, r_data, PJSIP_SC_OK, NULL, &t_data); @@ -1526,7 +1526,7 @@ void transaction_state_changed_cb(pjsip_inv_session * inv, Manager::instance().incomingMessage(call->getCallId(), from, findTextMessage(formattedMessage)); } catch (const sfl::InstantMessageException &except) { - ERROR("SipVoipLink: %s", except.what()); + ERROR("%s", except.what()); } } @@ -1535,13 +1535,13 @@ void update_contact_header(pjsip_regc_cbparam *param, SIPAccount *account) SIPVoIPLink *siplink = dynamic_cast<SIPVoIPLink *>(account->getVoIPLink()); if (siplink == NULL) { - ERROR("SIPVoIPLink: Could not find voip link from account"); + ERROR("Could not find voip link from account"); return; } pj_pool_t *pool = pj_pool_create(&cp_->factory, "tmp", 512, 512, NULL); if (pool == NULL) { - ERROR("SIPVoIPLink: Could not create temporary memory pool in transport header"); + ERROR("Could not create temporary memory pool in transport header"); return; } @@ -1555,7 +1555,7 @@ void update_contact_header(pjsip_regc_cbparam *param, SIPAccount *account) pjsip_sip_uri *uri = (pjsip_sip_uri*) contact_hdr->uri; if (uri == NULL) { - ERROR("SIPVoIPLink: Could not find uri in contact header"); + ERROR("Could not find uri in contact header"); pj_pool_release(pool); return; } @@ -1585,7 +1585,7 @@ void update_contact_header(pjsip_regc_cbparam *param, SIPAccount *account) updateContact = true; if (updateContact) { - DEBUG("SIPVoIPLink: Update contact header: %s:%s\n", recvContactHost.c_str(), recvContactPort.c_str()); + DEBUG("Update contact header: %s:%s\n", recvContactHost.c_str(), recvContactPort.c_str()); account->setContactHeader(recvContactHost, recvContactPort); siplink->sendRegister(account); } @@ -1616,13 +1616,13 @@ void processRegistrationError(SIPAccount &account, RegistrationState /*state*/) void registration_cb(pjsip_regc_cbparam *param) { if (param == NULL) { - ERROR("SipVoipLink: registration callback parameter is NULL"); + ERROR("registration callback parameter is NULL"); return; } SIPAccount *account = static_cast<SIPAccount *>(param->token); if (account == NULL) { - ERROR("SipVoipLink: account doesn't exist in registration callback"); + ERROR("account doesn't exist in registration callback"); return; } @@ -1642,7 +1642,7 @@ void registration_cb(pjsip_regc_cbparam *param) account->setRegistrationExpire(param->expiration); } -#define FAILURE_MESSAGE() ERROR("UserAgent: Could not register account %s with error %d", accountID.c_str(), param->code) +#define FAILURE_MESSAGE() ERROR("Could not register account %s with error %d", accountID.c_str(), param->code) if (param->status != PJ_SUCCESS) { FAILURE_MESSAGE();