Ejemplo n.º 1
0
/**
 * Returns a media description to run the streams with, based on a local offer
 * and the returned response (remote).
**/
int offer_answer_initiate_outgoing(MSFactory *factory, const SalMediaDescription *local_offer,
					const SalMediaDescription *remote_answer,
					SalMediaDescription *result){
	int i;
	const SalStreamDescription *ls,*rs;

	for(i=0;i<local_offer->nb_streams;++i){
		ms_message("Processing for stream %i",i);
		ls=&local_offer->streams[i];
		rs=&remote_answer->streams[i];
		if (rs && ls->proto == rs->proto && rs->type == ls->type) {
			initiate_outgoing(factory, ls,rs,&result->streams[i]);
			memcpy(&result->streams[i].rtcp_xr, &ls->rtcp_xr, sizeof(result->streams[i].rtcp_xr));
			if ((ls->rtcp_xr.enabled == TRUE) && (rs->rtcp_xr.enabled == FALSE)) {
				result->streams[i].rtcp_xr.enabled = FALSE;
			}
			result->streams[i].rtcp_fb.generic_nack_enabled = ls->rtcp_fb.generic_nack_enabled & rs->rtcp_fb.generic_nack_enabled;
			result->streams[i].rtcp_fb.tmmbr_enabled = ls->rtcp_fb.tmmbr_enabled & rs->rtcp_fb.tmmbr_enabled;
		}
		else ms_warning("No matching stream for %i",i);
	}
	result->nb_streams=local_offer->nb_streams;
	result->bandwidth=remote_answer->bandwidth;
	strcpy(result->addr,remote_answer->addr);
	strcpy(result->ice_pwd, local_offer->ice_pwd);
	strcpy(result->ice_ufrag, local_offer->ice_ufrag);
	memcpy(&result->rtcp_xr, &local_offer->rtcp_xr, sizeof(result->rtcp_xr));
	if ((local_offer->rtcp_xr.enabled == TRUE) && (remote_answer->rtcp_xr.enabled == FALSE)) {
		result->rtcp_xr.enabled = FALSE;
	}

	return 0;
}
Ejemplo n.º 2
0
/**
 * Returns a media description to run the streams with, based on a local offer
 * and the returned response (remote).
**/
int offer_answer_initiate_outgoing(const SalMediaDescription *local_offer,
                                   const SalMediaDescription *remote_answer,
                                   SalMediaDescription *result) {
    int i,j;
    const SalStreamDescription *ls,*rs;

    for(i=0,j=0; i<local_offer->nb_streams; ++i) {
        ms_message("Processing for stream %i",i);
        ls=&local_offer->streams[i];
        rs=sal_media_description_find_stream((SalMediaDescription*)remote_answer,ls->proto,ls->type);
        if (rs) {
            initiate_outgoing(ls,rs,&result->streams[j]);
            memcpy(&result->streams[i].rtcp_xr, &ls->rtcp_xr, sizeof(result->streams[i].rtcp_xr));
            if ((ls->rtcp_xr.enabled == TRUE) && (rs->rtcp_xr.enabled == FALSE)) {
                result->streams[i].rtcp_xr.enabled = FALSE;
            }
            ++j;
        }
        else ms_warning("No matching stream for %i",i);
    }
    result->nb_streams=local_offer->nb_streams;
    result->bandwidth=remote_answer->bandwidth;
    strcpy(result->addr,remote_answer->addr);
    memcpy(&result->rtcp_xr, &local_offer->rtcp_xr, sizeof(result->rtcp_xr));
    if ((local_offer->rtcp_xr.enabled == TRUE) && (remote_answer->rtcp_xr.enabled == FALSE)) {
        result->rtcp_xr.enabled = FALSE;
    }

    return 0;
}
Ejemplo n.º 3
0
enum status  do_call(enum status cur_status, int key_value)
{
    /* variables */
      /* none */



    /* start the outgoing call */
    initiate_outgoing();


    /* and return the new status - STAT_CONNECTING */
    return  STAT_CONNECTING;

}
Ejemplo n.º 4
0
/**
 * Returns a media description to run the streams with, based on a local offer
 * and the returned response (remote).
**/
int offer_answer_initiate_outgoing(const SalMediaDescription *local_offer,
                                   const SalMediaDescription *remote_answer,
                                   SalMediaDescription *result) {
    int i,j;
    const SalStreamDescription *ls,*rs;
    for(i=0,j=0; i<local_offer->nstreams; ++i) {
        ms_message("Processing for stream %i",i);
        ls=&local_offer->streams[i];
        rs=sal_media_description_find_stream((SalMediaDescription*)remote_answer,ls->proto,ls->type);
        if (rs) {
            initiate_outgoing(ls,rs,&result->streams[j]);
            ++j;
        }
        else ms_warning("No matching stream for %i",i);
    }
    result->nstreams=j;
    result->bandwidth=remote_answer->bandwidth;
    strcpy(result->addr,remote_answer->addr);
    return 0;
}