Loading ccsrc/EncDec/LibSip/LibSip_Encdec.cc +100 −21 Original line number Diff line number Diff line Loading @@ -4,8 +4,11 @@ #include "sip_codec_register_request.hh" #include "sip_codec_invite_request.hh" #include "sip_codec_options_request.hh" #include "sip_codec_bye_request.hh" #include "sip_codec_ack_request.hh" #include "sip_codec_subscribe_request.hh" #include "sip_codec_message_request.hh" #include "sip_codec_message_body.hh" #include "sip_codec_response.hh" Loading Loading @@ -67,7 +70,23 @@ namespace LibSip__EncdecDeclarations { return oct2bit(os); } BITSTRING fx__enc__OPTIONS__Request(const LibSip__SIPTypesAndValues::OPTIONS__Request& p) { return BITSTRING(); } BITSTRING fx__enc__OPTIONS__Request(const LibSip__SIPTypesAndValues::OPTIONS__Request& p) { loggers::get_instance().log_msg(">>> fx__enc__OPTIONS__Request: ", p); float duration; std::string tag("fx__enc__OPTIONS__Request"); loggers::get_instance().set_start_time(tag); OCTETSTRING os; sip_codec_options_request codec; if (codec.encode(p, os) == -1) { loggers::get_instance().warning("fx__enc__OPTIONS__Request: -1 result code was returned"); return int2bit(0, 1); } loggers::get_instance().set_stop_time(tag, duration); return oct2bit(os); } BITSTRING fx__enc__BYE__Request(const LibSip__SIPTypesAndValues::BYE__Request& p) { loggers::get_instance().log_msg(">>> fx__enc__BYE__Request: ", p); Loading @@ -87,8 +106,25 @@ namespace LibSip__EncdecDeclarations { return oct2bit(os); } BITSTRING fx__enc__ACK__Request(const LibSip__SIPTypesAndValues::ACK__Request& p) { loggers::get_instance().log_msg(">>> fx__enc__ACK__Request: ", p); float duration; std::string tag("fx__enc__ACK__Request"); loggers::get_instance().set_start_time(tag); OCTETSTRING os; sip_codec_ack_request codec; if (codec.encode(p, os) == -1) { loggers::get_instance().warning("fx__enc__ACK__Request: -1 result code was returned"); return int2bit(0, 1); } loggers::get_instance().set_stop_time(tag, duration); return oct2bit(os); } BITSTRING fx__enc__CANCEL__Request(const LibSip__SIPTypesAndValues::CANCEL__Request& p) { return BITSTRING(); } BITSTRING fx__enc__ACK__Request(const LibSip__SIPTypesAndValues::ACK__Request& p) { return BITSTRING(); } BITSTRING fx__enc__PRACK__Request(const LibSip__SIPTypesAndValues::PRACK__Request& p) { return BITSTRING(); } BITSTRING fx__enc__NOTIFY__Request(const LibSip__SIPTypesAndValues::NOTIFY__Request& p) { return BITSTRING(); } BITSTRING fx__enc__SUBSCRIBE__Request(const LibSip__SIPTypesAndValues::SUBSCRIBE__Request& p) { Loading @@ -109,10 +145,27 @@ namespace LibSip__EncdecDeclarations { return oct2bit(os); } BITSTRING fx__enc__MESSAGE__Request(const LibSip__SIPTypesAndValues::MESSAGE__Request& p) { loggers::get_instance().log_msg(">>> fx__enc__MESSAGE__Request: ", p); float duration; std::string tag("fx__enc__MESSAGE__Request"); loggers::get_instance().set_start_time(tag); OCTETSTRING os; sip_codec_message_request codec; if (codec.encode(p, os) == -1) { loggers::get_instance().warning("fx__enc__MESSAGE__Request: -1 result code was returned"); return int2bit(0, 1); } loggers::get_instance().set_stop_time(tag, duration); return oct2bit(os); } BITSTRING fx__enc__PUBLISH__Request(const LibSip__SIPTypesAndValues::PUBLISH__Request& p) { return BITSTRING(); } BITSTRING fx__enc__UPDATE__Request(const LibSip__SIPTypesAndValues::UPDATE__Request& p) { return BITSTRING(); } BITSTRING fx__enc__REFER__Request(const LibSip__SIPTypesAndValues::REFER__Request& p) { return BITSTRING(); } BITSTRING fx__enc__MESSAGE__Request(const LibSip__SIPTypesAndValues::MESSAGE__Request& p) { return BITSTRING(); } BITSTRING fx__enc__INFO__Request(const LibSip__SIPTypesAndValues::INFO__Request& p) { return BITSTRING(); } BITSTRING fx__enc__Response(const LibSip__SIPTypesAndValues::Response& p) { Loading Loading @@ -184,7 +237,15 @@ namespace LibSip__EncdecDeclarations { return 0; } INTEGER fx__dec__OPTIONS__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::OPTIONS__Request& p) { return INTEGER(0); } INTEGER fx__dec__OPTIONS__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::OPTIONS__Request& p) { loggers::get_instance().log_msg(">>> fx__dec__OPTIONS__Request: ", pdu); OCTETSTRING os = bit2oct(pdu); sip_codec_options_request codec; codec.decode(os, p); return 0; } INTEGER fx__dec__BYE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::BYE__Request& p) { loggers::get_instance().log_msg(">>> fx__dec__BYE__Request: ", pdu); Loading @@ -196,8 +257,17 @@ namespace LibSip__EncdecDeclarations { return 0; } INTEGER fx__dec__ACK__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::ACK__Request& p) { loggers::get_instance().log_msg(">>> fx__dec__ACK__Request: ", pdu); OCTETSTRING os = bit2oct(pdu); sip_codec_ack_request codec; codec.decode(os, p); return 0; } INTEGER fx__dec__CANCEL__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::CANCEL__Request& p) { return INTEGER(0); } INTEGER fx__dec__ACK__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::ACK__Request& p) { return INTEGER(0); } INTEGER fx__dec__PRACK__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::PRACK__Request& p) { return INTEGER(0); } INTEGER fx__dec__NOTIFY__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::NOTIFY__Request& p) { return INTEGER(0); } Loading @@ -211,10 +281,19 @@ namespace LibSip__EncdecDeclarations { return 0; } INTEGER fx__dec__MESSAGE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::MESSAGE__Request& p) { loggers::get_instance().log_msg(">>> fx__dec__MESSAGE__Request: ", pdu); OCTETSTRING os = bit2oct(pdu); sip_codec_message_request codec; codec.decode(os, p); return 0; } INTEGER fx__dec__PUBLISH__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::PUBLISH__Request& p) { return INTEGER(0); } INTEGER fx__dec__UPDATE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::UPDATE__Request& p) { return INTEGER(0); } INTEGER fx__dec__REFER__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::REFER__Request& p) { return INTEGER(0); } INTEGER fx__dec__MESSAGE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::MESSAGE__Request& p) { return INTEGER(0); } INTEGER fx__dec__INFO__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::INFO__Request& p) { return INTEGER(0); } INTEGER fx__dec__Response(BITSTRING& pdu, LibSip__SIPTypesAndValues::Response& p) { Loading ccsrc/Framework/include/params.hh +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #pragma once #include <vector> #include <string> #include <map> /*! Loading ccsrc/Ports/LibSip/SipPort.cc +23 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,18 @@ namespace LibSip__Interface { loggers::get_instance().set_stop_time(_time_key, duration); } // End of outgoing_send void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::ACK__Request& send_par, const Address4SIP *destination_address) { loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par); loggers::get_instance().log(">>> SipPort::outgoing_send: %s", destination_address); float duration; loggers::get_instance().set_start_time(_time_key); params params; static_cast<sip_layer*>(_layer)->sendMsg(send_par, params); loggers::get_instance().set_stop_time(_time_key, duration); } // End of outgoing_send void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::REGISTER__Request& send_par, const Address4SIP *destination_address) { loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par); loggers::get_instance().log(">>> SipPort::outgoing_send: %s", destination_address); Loading Loading @@ -172,5 +184,16 @@ namespace LibSip__Interface { loggers::get_instance().set_stop_time(_time_key, duration); } void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::BYE__Request& send_par, const Address4SIP *destination_address) { loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par); loggers::get_instance().log(">>> SipPort::outgoing_send: %s", destination_address); float duration; loggers::get_instance().set_start_time(_time_key); params params; static_cast<sip_layer*>(_layer)->sendMsg(send_par, params); loggers::get_instance().set_stop_time(_time_key, duration); } } ccsrc/Ports/LibSip/SipPort.hh +2 −2 Original line number Diff line number Diff line Loading @@ -45,9 +45,9 @@ namespace LibSip__Interface { void outgoing_send(const LibSip__SIPTypesAndValues::REGISTER__Request& send_par, const Address4SIP *destination_address); void outgoing_send(const LibSip__SIPTypesAndValues::INVITE__Request& send_par, const Address4SIP *destination_address); void outgoing_send(const LibSip__SIPTypesAndValues::OPTIONS__Request& send_par, const Address4SIP *destination_address); virtual void outgoing_send(const LibSip__SIPTypesAndValues::BYE__Request& send_par, const Address4SIP *destination_address) { }; void outgoing_send(const LibSip__SIPTypesAndValues::BYE__Request& send_par, const Address4SIP *destination_address); virtual void outgoing_send(const LibSip__SIPTypesAndValues::CANCEL__Request& send_par, const Address4SIP *destination_address) { }; virtual void outgoing_send(const LibSip__SIPTypesAndValues::ACK__Request& send_par, const Address4SIP *destination_address) { }; void outgoing_send(const LibSip__SIPTypesAndValues::ACK__Request& send_par, const Address4SIP *destination_address); virtual void outgoing_send(const LibSip__SIPTypesAndValues::PRACK__Request& send_par, const Address4SIP *destination_address) { }; virtual void outgoing_send(const LibSip__SIPTypesAndValues::NOTIFY__Request& send_par, const Address4SIP *destination_address) { }; void outgoing_send(const LibSip__SIPTypesAndValues::SUBSCRIBE__Request& send_par, const Address4SIP *destination_address); Loading ccsrc/Protocols/Held/held_codec.cc +12 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,18 @@ int held_codec::encode (const LibItsHttp__XmlMessageBodyTypes::XmlBody& msg, OCT s.replace(idx, f.length(), t); idx += t.length(); } // End of 'while' statement // TITAN issue: Not possible to remove prefix id:device /*f.assign("id:"); t.assign(""); while ((idx = s.find(f)) != std::string::npos) { s.replace(idx, f.length(), t); idx += t.length(); }*/ // End of 'while' statement data = OCTETSTRING(s.length(), (const unsigned char*)s.c_str()); } loggers::get_instance().log_msg("held_codec::encode: After encoding: ", data); Loading Loading
ccsrc/EncDec/LibSip/LibSip_Encdec.cc +100 −21 Original line number Diff line number Diff line Loading @@ -4,8 +4,11 @@ #include "sip_codec_register_request.hh" #include "sip_codec_invite_request.hh" #include "sip_codec_options_request.hh" #include "sip_codec_bye_request.hh" #include "sip_codec_ack_request.hh" #include "sip_codec_subscribe_request.hh" #include "sip_codec_message_request.hh" #include "sip_codec_message_body.hh" #include "sip_codec_response.hh" Loading Loading @@ -67,7 +70,23 @@ namespace LibSip__EncdecDeclarations { return oct2bit(os); } BITSTRING fx__enc__OPTIONS__Request(const LibSip__SIPTypesAndValues::OPTIONS__Request& p) { return BITSTRING(); } BITSTRING fx__enc__OPTIONS__Request(const LibSip__SIPTypesAndValues::OPTIONS__Request& p) { loggers::get_instance().log_msg(">>> fx__enc__OPTIONS__Request: ", p); float duration; std::string tag("fx__enc__OPTIONS__Request"); loggers::get_instance().set_start_time(tag); OCTETSTRING os; sip_codec_options_request codec; if (codec.encode(p, os) == -1) { loggers::get_instance().warning("fx__enc__OPTIONS__Request: -1 result code was returned"); return int2bit(0, 1); } loggers::get_instance().set_stop_time(tag, duration); return oct2bit(os); } BITSTRING fx__enc__BYE__Request(const LibSip__SIPTypesAndValues::BYE__Request& p) { loggers::get_instance().log_msg(">>> fx__enc__BYE__Request: ", p); Loading @@ -87,8 +106,25 @@ namespace LibSip__EncdecDeclarations { return oct2bit(os); } BITSTRING fx__enc__ACK__Request(const LibSip__SIPTypesAndValues::ACK__Request& p) { loggers::get_instance().log_msg(">>> fx__enc__ACK__Request: ", p); float duration; std::string tag("fx__enc__ACK__Request"); loggers::get_instance().set_start_time(tag); OCTETSTRING os; sip_codec_ack_request codec; if (codec.encode(p, os) == -1) { loggers::get_instance().warning("fx__enc__ACK__Request: -1 result code was returned"); return int2bit(0, 1); } loggers::get_instance().set_stop_time(tag, duration); return oct2bit(os); } BITSTRING fx__enc__CANCEL__Request(const LibSip__SIPTypesAndValues::CANCEL__Request& p) { return BITSTRING(); } BITSTRING fx__enc__ACK__Request(const LibSip__SIPTypesAndValues::ACK__Request& p) { return BITSTRING(); } BITSTRING fx__enc__PRACK__Request(const LibSip__SIPTypesAndValues::PRACK__Request& p) { return BITSTRING(); } BITSTRING fx__enc__NOTIFY__Request(const LibSip__SIPTypesAndValues::NOTIFY__Request& p) { return BITSTRING(); } BITSTRING fx__enc__SUBSCRIBE__Request(const LibSip__SIPTypesAndValues::SUBSCRIBE__Request& p) { Loading @@ -109,10 +145,27 @@ namespace LibSip__EncdecDeclarations { return oct2bit(os); } BITSTRING fx__enc__MESSAGE__Request(const LibSip__SIPTypesAndValues::MESSAGE__Request& p) { loggers::get_instance().log_msg(">>> fx__enc__MESSAGE__Request: ", p); float duration; std::string tag("fx__enc__MESSAGE__Request"); loggers::get_instance().set_start_time(tag); OCTETSTRING os; sip_codec_message_request codec; if (codec.encode(p, os) == -1) { loggers::get_instance().warning("fx__enc__MESSAGE__Request: -1 result code was returned"); return int2bit(0, 1); } loggers::get_instance().set_stop_time(tag, duration); return oct2bit(os); } BITSTRING fx__enc__PUBLISH__Request(const LibSip__SIPTypesAndValues::PUBLISH__Request& p) { return BITSTRING(); } BITSTRING fx__enc__UPDATE__Request(const LibSip__SIPTypesAndValues::UPDATE__Request& p) { return BITSTRING(); } BITSTRING fx__enc__REFER__Request(const LibSip__SIPTypesAndValues::REFER__Request& p) { return BITSTRING(); } BITSTRING fx__enc__MESSAGE__Request(const LibSip__SIPTypesAndValues::MESSAGE__Request& p) { return BITSTRING(); } BITSTRING fx__enc__INFO__Request(const LibSip__SIPTypesAndValues::INFO__Request& p) { return BITSTRING(); } BITSTRING fx__enc__Response(const LibSip__SIPTypesAndValues::Response& p) { Loading Loading @@ -184,7 +237,15 @@ namespace LibSip__EncdecDeclarations { return 0; } INTEGER fx__dec__OPTIONS__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::OPTIONS__Request& p) { return INTEGER(0); } INTEGER fx__dec__OPTIONS__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::OPTIONS__Request& p) { loggers::get_instance().log_msg(">>> fx__dec__OPTIONS__Request: ", pdu); OCTETSTRING os = bit2oct(pdu); sip_codec_options_request codec; codec.decode(os, p); return 0; } INTEGER fx__dec__BYE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::BYE__Request& p) { loggers::get_instance().log_msg(">>> fx__dec__BYE__Request: ", pdu); Loading @@ -196,8 +257,17 @@ namespace LibSip__EncdecDeclarations { return 0; } INTEGER fx__dec__ACK__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::ACK__Request& p) { loggers::get_instance().log_msg(">>> fx__dec__ACK__Request: ", pdu); OCTETSTRING os = bit2oct(pdu); sip_codec_ack_request codec; codec.decode(os, p); return 0; } INTEGER fx__dec__CANCEL__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::CANCEL__Request& p) { return INTEGER(0); } INTEGER fx__dec__ACK__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::ACK__Request& p) { return INTEGER(0); } INTEGER fx__dec__PRACK__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::PRACK__Request& p) { return INTEGER(0); } INTEGER fx__dec__NOTIFY__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::NOTIFY__Request& p) { return INTEGER(0); } Loading @@ -211,10 +281,19 @@ namespace LibSip__EncdecDeclarations { return 0; } INTEGER fx__dec__MESSAGE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::MESSAGE__Request& p) { loggers::get_instance().log_msg(">>> fx__dec__MESSAGE__Request: ", pdu); OCTETSTRING os = bit2oct(pdu); sip_codec_message_request codec; codec.decode(os, p); return 0; } INTEGER fx__dec__PUBLISH__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::PUBLISH__Request& p) { return INTEGER(0); } INTEGER fx__dec__UPDATE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::UPDATE__Request& p) { return INTEGER(0); } INTEGER fx__dec__REFER__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::REFER__Request& p) { return INTEGER(0); } INTEGER fx__dec__MESSAGE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::MESSAGE__Request& p) { return INTEGER(0); } INTEGER fx__dec__INFO__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::INFO__Request& p) { return INTEGER(0); } INTEGER fx__dec__Response(BITSTRING& pdu, LibSip__SIPTypesAndValues::Response& p) { Loading
ccsrc/Framework/include/params.hh +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #pragma once #include <vector> #include <string> #include <map> /*! Loading
ccsrc/Ports/LibSip/SipPort.cc +23 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,18 @@ namespace LibSip__Interface { loggers::get_instance().set_stop_time(_time_key, duration); } // End of outgoing_send void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::ACK__Request& send_par, const Address4SIP *destination_address) { loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par); loggers::get_instance().log(">>> SipPort::outgoing_send: %s", destination_address); float duration; loggers::get_instance().set_start_time(_time_key); params params; static_cast<sip_layer*>(_layer)->sendMsg(send_par, params); loggers::get_instance().set_stop_time(_time_key, duration); } // End of outgoing_send void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::REGISTER__Request& send_par, const Address4SIP *destination_address) { loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par); loggers::get_instance().log(">>> SipPort::outgoing_send: %s", destination_address); Loading Loading @@ -172,5 +184,16 @@ namespace LibSip__Interface { loggers::get_instance().set_stop_time(_time_key, duration); } void SipPort::outgoing_send(const LibSip__SIPTypesAndValues::BYE__Request& send_par, const Address4SIP *destination_address) { loggers::get_instance().log_msg(">>> SipPort::outgoing_send: ", send_par); loggers::get_instance().log(">>> SipPort::outgoing_send: %s", destination_address); float duration; loggers::get_instance().set_start_time(_time_key); params params; static_cast<sip_layer*>(_layer)->sendMsg(send_par, params); loggers::get_instance().set_stop_time(_time_key, duration); } }
ccsrc/Ports/LibSip/SipPort.hh +2 −2 Original line number Diff line number Diff line Loading @@ -45,9 +45,9 @@ namespace LibSip__Interface { void outgoing_send(const LibSip__SIPTypesAndValues::REGISTER__Request& send_par, const Address4SIP *destination_address); void outgoing_send(const LibSip__SIPTypesAndValues::INVITE__Request& send_par, const Address4SIP *destination_address); void outgoing_send(const LibSip__SIPTypesAndValues::OPTIONS__Request& send_par, const Address4SIP *destination_address); virtual void outgoing_send(const LibSip__SIPTypesAndValues::BYE__Request& send_par, const Address4SIP *destination_address) { }; void outgoing_send(const LibSip__SIPTypesAndValues::BYE__Request& send_par, const Address4SIP *destination_address); virtual void outgoing_send(const LibSip__SIPTypesAndValues::CANCEL__Request& send_par, const Address4SIP *destination_address) { }; virtual void outgoing_send(const LibSip__SIPTypesAndValues::ACK__Request& send_par, const Address4SIP *destination_address) { }; void outgoing_send(const LibSip__SIPTypesAndValues::ACK__Request& send_par, const Address4SIP *destination_address); virtual void outgoing_send(const LibSip__SIPTypesAndValues::PRACK__Request& send_par, const Address4SIP *destination_address) { }; virtual void outgoing_send(const LibSip__SIPTypesAndValues::NOTIFY__Request& send_par, const Address4SIP *destination_address) { }; void outgoing_send(const LibSip__SIPTypesAndValues::SUBSCRIBE__Request& send_par, const Address4SIP *destination_address); Loading
ccsrc/Protocols/Held/held_codec.cc +12 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,18 @@ int held_codec::encode (const LibItsHttp__XmlMessageBodyTypes::XmlBody& msg, OCT s.replace(idx, f.length(), t); idx += t.length(); } // End of 'while' statement // TITAN issue: Not possible to remove prefix id:device /*f.assign("id:"); t.assign(""); while ((idx = s.find(f)) != std::string::npos) { s.replace(idx, f.length(), t); idx += t.length(); }*/ // End of 'while' statement data = OCTETSTRING(s.length(), (const unsigned char*)s.c_str()); } loggers::get_instance().log_msg("held_codec::encode: After encoding: ", data); Loading