Backed out changeset 789a60e48ee2 (bug 837035) to see if it resolves the Win PGO mochitest-2 crashes.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 07 Mar 2013 19:25:35 -0500
changeset 124175 6cdb9f903c027b777144c74ab5333307811f3c4f
parent 124174 ca3ccb294e2eb96588747e87b41329be353ff39d
child 124176 3cb82d9f3f9c03141211304ab0bbb7bbb843a988
push id24408
push userryanvm@gmail.com
push dateFri, 08 Mar 2013 04:58:11 +0000
treeherdermozilla-central@cb432984d5ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs837035
milestone22.0a1
backs out789a60e48ee2605186ced79288c914a715336a36
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 789a60e48ee2 (bug 837035) to see if it resolves the Win PGO mochitest-2 crashes.
media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
media/webrtc/signaling/src/sipcc/core/gsm/h/fsm.h
media/webrtc/signaling/src/sipcc/core/gsm/h/lsm.h
media/webrtc/signaling/src/sipcc/core/gsm/lsm.c
media/webrtc/signaling/src/sipcc/core/sdp/sdp.h
media/webrtc/signaling/src/sipcc/core/sdp/sdp_access.c
media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr_access.c
media/webrtc/signaling/src/sipcc/include/vcm.h
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -1050,67 +1050,28 @@ short vcmGetDtlsIdentity(const char *pee
 
   return ret;
 }
 
 /* Set negotiated DataChannel parameters.
  *
  *  @param[in]  peerconnection - the peerconnection in use
  *  @param[in]  streams - the number of streams for this data channel
- *  @param[in]  local_datachannel_port - the negotiated sctp port
- *  @param[in]  remote_datachannel_port - the negotiated sctp port
+ *  @param[in]  sctp_port - the negotiated sctp port
  *  @param[in]  protocol - the protocol as a string
  *
  *  @return 0 success, error failure
  */
-static short vcmInitializeDataChannel_m(const char *peerconnection, cc_uint16_t streams,
-  int local_datachannel_port, int remote_datachannel_port, const char* protocol)
+short vcmSetDataChannelParameters(const char *peerconnection, cc_uint16_t streams, int sctp_port, const char* protocol)
 {
-  nsresult res;
-
   CSFLogDebug( logTag, "%s: PC = %s", __FUNCTION__, peerconnection);
 
-  sipcc::PeerConnectionWrapper pc(peerconnection);
-  ENSURE_PC(pc, VCM_ERROR);
-
-  res = pc.impl()->InitializeDataChannel(local_datachannel_port, remote_datachannel_port, streams);
-  if (NS_FAILED(res)) {
-    return VCM_ERROR;
-  }
-
   return 0;
 }
 
-/* Set negotiated DataChannel parameters.
- *
- *  @param[in]  peerconnection - the peerconnection in use
- *  @param[in]  streams - the number of streams for this data channel
- *  @param[in]  local_datachannel_port - the negotiated sctp port
- *  @param[in]  remote_datachannel_port - the negotiated sctp port
- *  @param[in]  protocol - the protocol as a string
- *
- *  @return 0 success, error failure
- */
-short vcmInitializeDataChannel(const char *peerconnection, cc_uint16_t streams,
-  int local_datachannel_port, int remote_datachannel_port, const char* protocol)
-{
-  short ret;
-
-  VcmSIPCCBinding::getMainThread()->Dispatch(
-      WrapRunnableNMRet(&vcmInitializeDataChannel_m,
-                        peerconnection,
-                        streams,
-                        local_datachannel_port,
-                        remote_datachannel_port,
-                        protocol,
-                        &ret),
-      NS_DISPATCH_SYNC);
-
-  return ret;
-}
 
 
 /**
  *   Should we remove this from external API
  *
  *  @param[in] mcap_id - group identifier to which stream belongs.
  *  @param[in]     group_id         - group identifier
  *  @param[in]     stream_id        - stream identifier
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -597,32 +597,21 @@ PeerConnectionImpl::CreateFakeMediaStrea
     new Fake_VideoGenerator(static_cast<DOMMediaStream*>(*aRetval));
 #endif
     }
   }
 
   return NS_OK;
 }
 
-// Stubbing this call out for now.
-// We can remove it when we are confident of datachannels being started
-// correctly on SDP negotiation
-NS_IMETHODIMP
-PeerConnectionImpl::ConnectDataConnection(uint16_t aLocalport,
-                                          uint16_t aRemoteport,
-                                          uint16_t aNumstreams)
-{
-  return NS_OK; // InitializeDataChannel(aLocalport, aRemoteport, aNumstreams);
-}
-
 // Data channels won't work without a window, so in order for the C++ unit
 // tests to work (it doesn't have a window available) we ifdef the following
 // two implementations.
-nsresult
-PeerConnectionImpl::InitializeDataChannel(uint16_t aLocalport,
+NS_IMETHODIMP
+PeerConnectionImpl::ConnectDataConnection(uint16_t aLocalport,
                                           uint16_t aRemoteport,
                                           uint16_t aNumstreams)
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
 #ifdef MOZILLA_INTERNAL_API
   if (mDataConnection) {
     CSFLogError(logTag,"%s DataConnection already connected",__FUNCTION__);
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -217,20 +217,16 @@ public:
     return Initialize(aObserver, aWindow, &aConfiguration, nullptr, aThread, nullptr);
   }
 
   // Validate constraints and construct a MediaConstraints object
   // from a JS::Value.
   NS_IMETHODIMP CreateOffer(MediaConstraints& aConstraints);
   NS_IMETHODIMP CreateAnswer(MediaConstraints& aConstraints);
 
-  nsresult
-  InitializeDataChannel(uint16_t aLocalport, uint16_t aRemoteport, uint16_t aNumstreams);
-
-
 private:
   PeerConnectionImpl(const PeerConnectionImpl&rhs);
   PeerConnectionImpl& operator=(PeerConnectionImpl);
   nsresult Initialize(IPeerConnectionObserver* aObserver,
                       nsIDOMWindow* aWindow,
                       const IceConfiguration* aConfiguration,
                       const JS::Value* aRTCConfiguration,
                       nsIThread* aThread,
--- a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
+++ b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
@@ -527,22 +527,17 @@ gsmsdp_init_media (fsmdef_media_t *media
     media->previous_sdp.profile_level = 0;
 
     media->hold  = FSM_HOLD_NONE;
     media->flags = 0;                    /* clear all flags      */
     media->cap_index = CC_MAX_MEDIA_CAP; /* max is invalid value */
     media->video = NULL;
     media->candidate_ct = 0;
     media->rtcp_mux = FALSE;
-
-    media->local_datachannel_port = 0;
-    media->remote_datachannel_port = 0;
-    media->datachannel_streams = WEBRTC_DATACHANNEL_STREAMS_DEFAULT;
-    sstrncpy(media->datachannel_protocol, WEBRTC_DATA_CHANNEL_PROT, SDP_MAX_STRING_LEN);
-
+    media->protocol = NULL;
     media->payloads = NULL;
     media->num_payloads = 0;
 }
 
 /**
  *
  * Returns a pointer to a new the fsmdef_media_t for a given dcb.
  * The default media parameters will be intialized for the known or
@@ -1454,21 +1449,21 @@ gsmsdp_set_sctp_attributes (void *sdp_p,
     uint16_t a_inst;
 
     if (sdp_add_new_attr(sdp_p, level, 0, SDP_ATTR_FMTP, &a_inst)
         != SDP_SUCCESS) {
          return;
     }
 
     /* Use SCTP port in place of fmtp payload type */
-    (void) sdp_attr_set_fmtp_payload_type(sdp_p, level, 0, a_inst, media->local_datachannel_port);
-
-    sdp_attr_set_fmtp_data_channel_protocol (sdp_p, level, 0, a_inst, media->datachannel_protocol);
-
-    sdp_attr_set_fmtp_streams (sdp_p, level, 0, a_inst, media->datachannel_streams);
+    (void) sdp_attr_set_fmtp_payload_type(sdp_p, level, 0, a_inst, media->sctp_port);
+
+    sdp_attr_set_fmtp_data_channel_protocol (sdp_p, level, 0, a_inst, WEBRTC_DATA_CHANNEL_PROT);
+
+    sdp_attr_set_fmtp_streams (sdp_p, level, 0, a_inst, 16);
 }
 
 /*
  * gsmsdp_set_remote_sdp
  *
  * Description:
  *
  * Sets the specified SDP as the remote SDP in the DCB.
@@ -2444,17 +2439,17 @@ gsmsdp_update_local_sdp_media (fsmdef_dc
 
     if (media->support_direction != SDP_DIRECTION_INACTIVE) {
         gsmsdp_set_connection_address(sdp_p, media->level, dcb_p->ice_default_candidate_addr);
     }
 
     (void) sdp_set_media_type(sdp_p, level, media->type);
 
 
-    (void) sdp_set_media_portnum(sdp_p, level, port, media->local_datachannel_port);
+    (void) sdp_set_media_portnum(sdp_p, level, port, media->sctp_port);
 
     /* Set media transport and crypto attributes if it is for SRTP */
     gsmsdp_update_local_sdp_media_transport(dcb_p, sdp_p, media, transport,
                                             all_formats);
 
     if (all_formats) {
         /*
          * Add all supported media formats to the local sdp.
@@ -3303,47 +3298,37 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dc
                 return (media->payloads[0].codec_type);
             }
         }
     }
 
     return (RTP_NONE);
 }
 
-/*
- * gsmsdp_negotiate_datachannel_attribs
- *
- * dcb_p - a pointer to the current dcb
- * sdp_p - the sdp we are analyzing
- * media - the media info
- * offer - Boolean indicating if the remote SDP came in an OFFER.
- */
 static void
-gsmsdp_negotiate_datachannel_attribs(fsmdef_dcb_t* dcb_p, cc_sdp_t* sdp_p, uint16_t level,
-    fsmdef_media_t* media, boolean offer)
+gsmsdp_negotiate_datachannel_attribs(fsmdef_dcb_t* dcb_p, cc_sdp_t* sdp_p, uint16_t level, fsmdef_media_t* media)
 {
     uint32          num_streams;
     char           *protocol;
 
     sdp_attr_get_fmtp_streams (sdp_p->dest_sdp, level, 0, 1, &num_streams);
 
-    media->datachannel_streams = num_streams;
-
-    sdp_attr_get_fmtp_data_channel_protocol(sdp_p->dest_sdp, level, 0, 1, media->datachannel_protocol);
-
-    media->remote_datachannel_port = sdp_get_media_sctp_port(sdp_p->dest_sdp, level);
-
-    /*
-     * TODO: remove the following block when SCTP code is updated
-     * See bug 837035 comment #5
-     */
-    if (offer) {
-        /* Increment port for answer SDP */
-        media->local_datachannel_port = media->remote_datachannel_port + 1;
-    }
+    media->streams = num_streams;
+
+    if(media->protocol == NULL) {
+        media->protocol = cpr_malloc(SDP_MAX_STRING_LEN+1);
+        if (media->protocol == NULL)
+        	return;
+    }
+    sdp_attr_get_fmtp_data_channel_protocol(sdp_p->dest_sdp, level, 0, 1, media->protocol);
+
+    media->sctp_port = sdp_attr_get_fmtp_payload_type (sdp_p->dest_sdp, level, 0, 1);
+
+    /* Increment port for answer SDP */
+    media->sctp_port++;
 }
 
 /*
  * gsmsdp_add_unsupported_stream_to_local_sdp
  *
  * Description:
  *
  * Adds a rejected media line to the local SDP. If there is already a media line at
@@ -4526,17 +4511,17 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t 
                     unsupported_line = TRUE;
                     /* Failed codec negotiation */
                     cause = CC_CAUSE_PAYLOAD_MISMATCH;
                     GSM_DEBUG(DEB_L_C_F_PREFIX"codec mismatch at %d\n",
                               DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname), i);
                     break;
                 }
             } else {
-                gsmsdp_negotiate_datachannel_attribs(dcb_p, sdp_p, i, media, offer);
+                gsmsdp_negotiate_datachannel_attribs(dcb_p, sdp_p, i, media);
             }
 
             /*
              * Both media transport (RTP/SRTP) and codec are
              * now negotiated to common ones, update transport
              * parameters to be used for SRTP, if there is any.
              */
             gsmsdp_update_negotiated_transport(dcb_p, sdp_p, media,
@@ -4645,16 +4630,27 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t 
                           }
 
                           /* Now add the track to the single media stream.
                              use index 0 because we only have one stream */
                           result = gsmsdp_add_remote_track(0, i, dcb_p, media);
                           MOZ_ASSERT(result);  /* TODO(ekr@rtfm.com) add real
                                                  error checking, but this
                                                  "can't fail" */
+                      } else {
+                          /*
+                           * Inform VCM that a Data Channel has been negotiated
+                           */
+                          int pc_stream_id; /* Set but unused. Provided to
+                                                fulfill the API contract
+                                                TODO(adam@nostrum.com):
+                                                use or remove */
+
+                          lsm_data_channel_negotiated(dcb_p->line, dcb_p->call_id,
+                                                      media, &pc_stream_id);
                       }
                   }
               }
             }
 
             break;
 
         default:
@@ -5065,17 +5061,17 @@ gsmsdp_add_media_line (fsmdef_dcb_t *dcb
           }
 
           /* allocate port successful, save the port */
 
           media->src_port = data.open_rcv.port;
 
           if(media_cap->type == SDP_MEDIA_APPLICATION) {
             config_get_value(CFGID_SCTP_PORT, &sctp_port, sizeof(sctp_port));
-            media->local_datachannel_port = sctp_port;
+            media->sctp_port = sctp_port;
           }
 
           /*
            * Setup the local soruce address.
            */
           if (addr_type == CPR_IP_ADDR_IPV6) {
               gsmsdp_get_local_source_v6_address(media);
           } else if (addr_type == CPR_IP_ADDR_IPV4) {
--- a/media/webrtc/signaling/src/sipcc/core/gsm/h/fsm.h
+++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/fsm.h
@@ -225,25 +225,23 @@ typedef struct fsmdef_media_t_ {
     /*
      * rtcp-mux indicates media stream is muxed for RTP and RTCP
      */
     boolean        rtcp_mux;
 
     /*
      * port number used in m= data channel line
      */
-    uint16_t       local_datachannel_port;
-    uint16_t       remote_datachannel_port;
+    uint16_t       sctp_port;
 
     /*
      * Data Channel properties
      */
-#define WEBRTC_DATACHANNEL_STREAMS_DEFAULT 16
-    uint32         datachannel_streams;
-    char           datachannel_protocol[SDP_MAX_STRING_LEN + 1];
+    uint32         streams;
+    char          *protocol;
 
     /*
      * This field contains the number of elements in the payloads field.
      */
     int32_t num_payloads;
 
     /*
      * List of active lists of payloads negotiated
--- a/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm.h
+++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/lsm.h
@@ -169,12 +169,12 @@ int lsm_get_video_mute (callid_t call_id
 void lsm_set_video_window (callid_t call_id, int flags, int x, int y, int h, int w);
 void lsm_get_video_window (callid_t call_id, int *flags, int *x, int *y, int *h, int *w);
 boolean lsm_is_kpml_subscribed (callid_t call_id);
 void
 lsm_util_tone_start_with_speaker_as_backup (vcm_tones_t tone, short alert_info,
                                     cc_call_handle_t call_handle, groupid_t group_id,
                                     streamid_t stream_id, uint16_t direction);
 
-void lsm_initialize_datachannel (fsmdef_dcb_t *dcb, fsmdef_media_t *media);
+void lsm_data_channel_negotiated (line_t line, callid_t call_id, fsmdef_media_t *media, int *pc_stream_id);
 
 #endif //_LSM_H_
 
--- a/media/webrtc/signaling/src/sipcc/core/gsm/lsm.c
+++ b/media/webrtc/signaling/src/sipcc/core/gsm/lsm.c
@@ -29,18 +29,16 @@
 #include "dialplan.h"
 #include "sip_interface_regmgr.h"
 #include "gsm.h"
 #include "phntask.h"
 #include "fim.h"
 #include "util_string.h"
 #include "platform_api.h"
 
-static const char* logTag = "lsm";
-
 #ifndef NO
 #define NO  (0)
 #endif
 
 #ifndef YES
 #define YES (1)
 #endif
 
@@ -902,18 +900,17 @@ lsm_rx_start (lsm_lcb_t *lcb, const char
             continue;
         }
 
         /*
          * Check to see if the receive port can be opened.
          * For SRTP, the receive can not be opened if the remote's crypto
          * parameters are not received yet.
          */
-        if (media->type != SDP_MEDIA_APPLICATION &&
-            !gsmsdp_is_crypto_ready(media, TRUE)) {
+        if (!gsmsdp_is_crypto_ready(media, TRUE)) {
             LSM_DEBUG(DEB_L_C_F_PREFIX"%s: Not ready to open receive port (%d)\n",
                       DEB_L_C_F_PREFIX_ARGS(LSM, dcb->line, dcb->call_id, fname1), fname, media->src_port);
             continue;
         }
 
         /*
          * Open the RTP receive channel if it is not already open.
          */
@@ -1049,23 +1046,16 @@ lsm_rx_start (lsm_lcb_t *lcb, const char
                     lsm_util_tone_start_with_speaker_as_backup(tone, VCM_ALERT_INFO_OFF,
                                                                lsm_get_ms_ui_call_handle(dcb->line, dcb->call_id, CC_NO_CALL_ID),
                                                                dcb->group_id,
                                                                ((media != NULL) ? media->refid : CC_NO_MEDIA_REF_ID),
                                                                direction);
                 }
             }
         }
-
-        if (media->type == SDP_MEDIA_APPLICATION) {
-            /* Enable datachannels
-               Datachannels are always two-way so initializing only here in rx_start.
-            */
-            lsm_initialize_datachannel(dcb, media);
-        }
     }
 }
 
 /**
  * The function starts transmit channel for a given media entry.
  *
  * @param[in] lcb       - pointer to the lsm_lcb_t.
  * @param[in] fname     - pointer to to const. char for the name
@@ -5306,45 +5296,50 @@ void lsm_add_remote_stream (line_t line,
 
         vcmCreateRemoteStream(media->cap_index, dcb->peerconnection,
                 pc_stream_id);
 
     }
 }
 
 /*
- * lsm_initialize_datachannel
+ * lsm_data_channel_negotiated
  *
  * Description:
- *    The function initializes the datachannel with port and
- *    protocol info.
+ *    The function informs the API of a negotiated data channel m= line
  *
  * Parameters:
- *   [in]  dcb - pointer to get the peerconnection id
- *   [in]  media - pointer to get the datachannel info
+ *   [in]  line - line
+ *   [in]  call_id - GSM call ID
+ *   [in]  media - media line to add as remote stream
+ *   [out] pc_stream_id
  * Returns: None
  */
-void lsm_initialize_datachannel (fsmdef_dcb_t *dcb, fsmdef_media_t *media)
+void lsm_data_channel_negotiated (line_t line, callid_t call_id, fsmdef_media_t *media, int *pc_stream_id)
 {
-    if (!dcb) {
-        CSFLogError(logTag, "%s DCB is NULL", __FUNCTION__);
-        return;
-    }
-
-    if (!media) {
-        CSFLogError(logTag, "%s media is NULL", __FUNCTION__);
-        return;
-    }
-
-    /*
-     * have access to media->streams, media->protocol, media->local/remote_datachannel_port
-     */
-    vcmInitializeDataChannel(dcb->peerconnection, media->datachannel_streams,
-        media->local_datachannel_port, media->remote_datachannel_port,
-        media->datachannel_protocol);
+    static const char fname[] = "lsm_data_channel_negotiated";
+    fsmdef_dcb_t   *dcb;
+    lsm_lcb_t *lcb;
+
+    lcb = lsm_get_lcb_by_call_id(call_id);
+    if (lcb) {
+        dcb = lcb->dcb;
+        if (dcb == NULL) {
+            LSM_ERR_MSG(get_debug_string(DEBUG_INPUT_NULL), fname);
+            return;
+        }
+
+        /*
+         * have access to media->streams, media->protocol, media->sctp_port
+         * vcmSetDataChannelParameters may need renaming TODO: jesup
+         */
+
+        vcmSetDataChannelParameters(dcb->peerconnection, media->streams, media->sctp_port, media->protocol);
+
+    }
 }
 
 /**
  *
  * Peform non call related action
  *
  * @param line_t     line
  * @param callid_t      gsm_id
--- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h
+++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h
@@ -1158,17 +1158,16 @@ extern u32 sdp_get_media_profile_payload
 extern sdp_result_e sdp_insert_media_line(void *sdp_ptr, u16 level);
 extern void sdp_delete_media_line(void *sdp_ptr, u16 level);
 extern sdp_result_e sdp_set_media_type(void *sdp_ptr, u16 level,
                                        sdp_media_e media);
 extern sdp_result_e sdp_set_media_port_format(void *sdp_ptr, u16 level,
                                        sdp_port_format_e port_format);
 extern sdp_result_e sdp_set_media_portnum(void *sdp_ptr, u16 level,
                                           int32 portnum, int32 sctpport);
-extern int32 sdp_get_media_sctp_port(void *sdp_ptr, u16 level);
 extern sdp_result_e sdp_set_media_portcount(void *sdp_ptr, u16 level,
                                             int32 num_ports);
 extern sdp_result_e sdp_set_media_vpi(void *sdp_ptr, u16 level, int32 vpi);
 extern sdp_result_e sdp_set_media_vci(void *sdp_ptr, u16 level, u32 vci);
 extern sdp_result_e sdp_set_media_vcci(void *sdp_ptr, u16 level, int32 vcci);
 extern sdp_result_e sdp_set_media_cid(void *sdp_ptr, u16 level, int32 cid);
 extern sdp_result_e sdp_set_media_transport(void *sdp_ptr, u16 level,
                                             sdp_transport_e transport);
--- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_access.c
+++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_access.c
@@ -2011,41 +2011,16 @@ sdp_result_e sdp_set_media_portnum (void
         return (SDP_INVALID_PARAMETER);
     }
 
     mca_p->port = portnum;
     mca_p->sctpport = sctp_port;
     return (SDP_SUCCESS);
 }
 
-/* Function:    sdp_get_media_sctp_port
- * Description: Gets the value of the sctp port number parameter for the m=
- *              media token line.
- * Parameters:  sdp_ptr     The SDP handle returned by sdp_init_description.
- *              level       The media level to set the param.  Will be 1-n.
- * Returns:     sctp_port or -1 on failure
- */
-int32 sdp_get_media_sctp_port(void *sdp_ptr, u16 level)
-{
-    sdp_t      *sdp_p = (sdp_t *)sdp_ptr;
-    sdp_mca_t  *mca_p;
-
-    if (!sdp_verify_sdp_ptr(sdp_p)) {
-        return -1;
-    }
-
-    mca_p = sdp_find_media_level(sdp_p, level);
-    if (!mca_p) {
-        sdp_p->conf_p->num_invalid_param++;
-        return -1;
-    }
-
-    return mca_p->sctpport;
-}
-
 /* Function:    sdp_set_media_portcount
  * Description: Sets the value of the port count parameter for the m=
  *              media token line.  If the port count is not valid with the
  *              port format specified for the media line, this call will
  *              fail.
  * Parameters:  sdp_ptr     The SDP handle returned by sdp_init_description.
  *              level       The media level to set the param.  Will be 1-n.
  *              num_ports   Port count to set.
--- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr_access.c
+++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr_access.c
@@ -1,16 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "sdp_os_defs.h"
 #include "sdp.h"
 #include "sdp_private.h"
-#include "fsm.h"
 #include "CSFLog.h"
 
 static const char* logTag = "sdp_attr_access";
 
 /* Attribute access routines are all defined by the following parameters.
  *
  * sdp_ptr     The SDP handle returned by sdp_init_description.
  * level       The level the attribute is defined.  Can be either
@@ -6655,17 +6654,16 @@ sdp_result_e sdp_attr_get_fmtp_streams (
 
     attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num);
     if (!attr_p) {
         if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) {
             CSFLogError(logTag, "%s fmtp attribute, level %u instance %u "
                       "not found.", sdp_p->debug_str, level, inst_num);
         }
         sdp_p->conf_p->num_invalid_param++;
-        *val = WEBRTC_DATACHANNEL_STREAMS_DEFAULT;
         return (SDP_INVALID_PARAMETER);
     } else {
         *val = attr_p->attr.fmtp.streams;
         return (SDP_SUCCESS);
     }
 }
 
 sdp_result_e sdp_attr_set_fmtp_streams (void *sdp_ptr, u16 level,
--- a/media/webrtc/signaling/src/sipcc/include/vcm.h
+++ b/media/webrtc/signaling/src/sipcc/include/vcm.h
@@ -667,20 +667,19 @@ int vcmTxStart(cc_mcapid_t mcap_id,
 
   short vcmGetDtlsIdentity(const char *peerconnection,
         char *digest_alg,
         size_t max_digest_alg_len,
         char *digest,
         size_t max_digest_len);
 
 
-  short vcmInitializeDataChannel(const char *peerconnection,
+  short vcmSetDataChannelParameters(const char *peerconnection,
         cc_uint16_t streams,
-        int local_datachannel_port,
-        int remote_datachannel_port,
+        int sctp_port,
         const char* protocol);
 
 /*!
  *  Close the receive stream.
  *
  *  @param[in]    mcap_id - Media Capability ID
  *  @param[in]    group_id - group identifier that belongs to the stream.
  *  @param[in]    stream_id - stream id of the given media type.