/*check for the presence of at least one stream with requested direction */ static bool_t has_dir(const SalMediaDescription *md, SalStreamDir stream_dir){ int i; /* we are looking for at least one stream with requested direction, inactive streams are ignored*/ for(i=0;i<md->nstreams;++i){ const SalStreamDescription *ss=&md->streams[i]; if (ss->dir==stream_dir) return TRUE; if (stream_dir==SalStreamSendOnly && (is_null_address(md->addr) || is_null_address(ss->addr))) return TRUE; } return FALSE; }
/*check for the presence of at least one stream with requested direction */ static bool_t has_dir(const SalMediaDescription *md, SalStreamDir stream_dir){ int i; /* we are looking for at least one stream with requested direction, inactive streams are ignored*/ for(i=0;i<md->n_active_streams;++i){ const SalStreamDescription *ss=&md->streams[i]; if (ss->dir==stream_dir) return TRUE; /*compatibility check for phones that only used the null address and no attributes */ if (ss->dir==SalStreamSendRecv && stream_dir==SalStreamSendOnly && (is_null_address(md->addr) || is_null_address(ss->rtp_addr))) return TRUE; } return FALSE; }