MT#56321 core::AmOfferAnswer add logging into most important places

We have to improve AmOfferAnswer functions in terms of adding
more logging, to let the debug of the OA be more clear.

Also in parallel the refactoring is done in scope of AmOfferAnswer
in order to make reading more convenient.

Change-Id: If7353f1285057760dd5fbeada984a5ef96af9854
mr11.3.1
Donat Zenichev 4 years ago
parent 60e16ed526
commit ab7c1851fd

@ -648,6 +648,8 @@ void AmMimeBody::setHeaders(const string& hdrs)
AmMimeBody* AmMimeBody::addPart(const string& content_type)
{
DBG("Adding a new part to an existing body.\n");
AmMimeBody* body = NULL;
if(ct.type.empty() && ct.subtype.empty()) {
// fill *this* body

@ -270,31 +270,34 @@ int AmOfferAnswer::onRxSdp(unsigned int m_cseq, const AmMimeBody& body, const ch
int AmOfferAnswer::onTxSdp(unsigned int m_cseq, const AmMimeBody& body)
{
// assume that the payload is ok if it is not empty.
// (do not parse again self-generated SDP)
if(body.empty()){
DBG("AmOfferAnswer::onTxSdp()\n");
/* assume that the payload is ok if it is not empty.
* (do not parse again self-generated SDP) */
if (body.empty()) {
DBG("Body is empty, cannot do anything here.\n");
return -1;
}
switch(state) {
switch (state) {
case OA_None:
case OA_Completed:
setState(OA_OfferSent);
cseq = m_cseq;
break;
case OA_None:
case OA_Completed:
setState(OA_OfferSent);
cseq = m_cseq;
break;
case OA_OfferRecved:
setState(OA_Completed);
break;
case OA_OfferRecved:
setState(OA_Completed);
break;
case OA_OfferSent:
// There is already a pending offer!!!
DBG("There is already a pending offer, onTxSdp fails\n");
return -1;
case OA_OfferSent:
/* There is already a pending offer */
DBG("There is already a pending offer, onTxSdp fails\n");
return -1;
default:
break;
default:
break;
}
return 0;

Loading…
Cancel
Save