#include "sal.h"
#include <eXosip2/eXosip.h>
-#define keywordcmp(key,b) strncmp(key,b,sizeof(key))
+#define keywordcmp(key,b) strcmp(key,b)
#ifdef FOR_LATER
sdp_message_t *media_description_to_sdp(const SalMediaDescription *desc){
int i;
sdp_message_t *msg=create_generic_sdp(desc);
- for(i=0;i<desc->nstreams;++i){
+ for(i=0;i<desc->n_total_streams;++i){
add_line(msg,i,&desc->streams[i]);
}
return msg;
}
}
+ desc->n_active_streams = 0;
+
/* for each m= line */
for (i=0; !sdp_message_endof_media (msg, i) && i<SAL_MEDIA_DESCRIPTION_MAX_STREAMS; i++)
{
strncpy(stream->rtp_addr,rtp_addr,sizeof(stream->rtp_addr));
if (rtp_port)
stream->rtp_port=atoi(rtp_port);
+ if (stream->rtp_port > 0)
+ desc->n_active_streams++;
stream->ptime=_sdp_message_get_a_ptime(msg,i);
if (strcasecmp("audio", mtype) == 0){
for (k=0;valid_count < SAL_CRYPTO_ALGO_MAX && (attr=sdp_message_attribute_get(msg,i,k))!=NULL;k++){
char tmp[256], tmp2[256];
if (keywordcmp("crypto",attr->a_att_field)==0 && attr->a_att_value!=NULL){
- int nb = sscanf(attr->a_att_value, "%d %256s inline:%256s",
+ int nb = sscanf(attr->a_att_value, "%d %255s inline:%255s",
&stream->crypto[valid_count].tag,
tmp,
tmp2);
}
}
}
- desc->nstreams=i;
+ desc->n_total_streams=i;
return 0;
}