Logo Search packages:      
Sourcecode: wengophone version File versions  Download package

int osip_rfc3264_complete_answer ( struct osip_rfc3264 config,
sdp_message_t remote_sdp,
sdp_message_t local_sdp,
sdp_media_t med,
int  mline 

Agree to support a specific codec. This method should be called for each codec returned by osip_rfc3264_match(...) that the calle agree to support.

config The element to work on.
remote_sdp The remote SDP packet.
local_sdp The local SDP packet to complete.
med One of the media returned by osip_rfc3264_match.
mline The position of the media line to complete.

Definition at line 818 of file osip_rfc3264.c.

References sdp_attribute::a_att_field, sdp_attribute::a_att_value, sdp_media::a_attributes, sdp_message::m_medias, sdp_media::m_payloads, osip_list_add(), osip_list_eol(), osip_list_get(), and sdp_attribute_init().

  osip_rfc3264_t *cnf = (osip_rfc3264_t*) config;
  sdp_media_t *remote_med = NULL;
  sdp_media_t *local_med = NULL;
  int pos;
  if (cnf==NULL) return -1;
  if (remote_sdp==NULL) return -1;
  if (med==NULL) return -1;
  if (mline<0) return -1;
  if (local_sdp==NULL) return -1;
  while (!osip_list_eol(remote_sdp->m_medias, pos))
      remote_med = (sdp_media_t *) osip_list_get(remote_sdp->m_medias, pos);
      local_med = (sdp_media_t *) osip_list_get(local_sdp->m_medias, pos);
      if (pos==mline) break;
      remote_med = NULL;
      local_med = NULL;
  if (remote_med==NULL) return -1;

  pos = 0;
  while (!osip_list_eol (med->a_attributes, pos))
      sdp_attribute_t *attr =
      (sdp_attribute_t *) osip_list_get (med->a_attributes, pos);

      if (0==osip_strcasecmp("rtpmap", attr->a_att_field)
        &&  attr->a_att_value!=NULL)
        sdp_attribute_t *mattr;
        char *tmp;

        /* fill the m= line */
        tmp = (char*) osip_list_get(med->m_payloads, 0);
        if (tmp!=NULL)
          osip_list_add(local_med->m_payloads, osip_strdup(tmp), -1);
          return -1;

        mattr->a_att_field = osip_strdup(attr->a_att_field);
        mattr->a_att_value = osip_strdup(attr->a_att_value);

        /* fill the a= line */
        osip_list_add (local_med->a_attributes, mattr, -1);
        return 0;

  return -1; /* no rtpmap found? It is mandatory in audio and video media */

Generated by  Doxygen 1.6.0   Back to index