Sending Re-INVITE with updated m/c line

After the ICE check is completed, the address and ports for both source and destination for the media are decided. The chosen addresses and ports may differ from the address and port in the m/c line of the SDP. ICE requires that a re-INVITE be sent with the m/c lines for each channel updated to the chosen addresses and ports.
If a mismatch exists in the addresses and ports for both the source and destination for the media chosen, the AnyFirewall™ Engine will fire an EAfEventICENeedUpdatedOffer event. The application should call MakeOffer again for the session to obtain the SDP with the updated m/c lines.


struct AfEvent stAfEvent;
int iRet = m_pAFEngine->Recv(m_iEventChannel, (char *)&stAfEvent,
                                8,
                                AF_NON_BLOCKING
                        );
  if (iRet > 0)
  {
        switch (stAfEvent.uEvent)
        {  
            //Obtain the SDP with the updated m/c line for the session
            case EAfEventICENeedUpdatedOffer:
            SendReinvite();
            break;
            …
        }
  }
…
void SendReinvite()
{
    …
    //Obtain the SDP with the updated m/c line for the session
    AfSessionInfo *sessionInfo = m_pAFEngine->MakeOffer(m_iSession);
    std::string sUpdatedSDPInfo = CreateSdpFromStruct(sessionInfo);
    …
}