Esempio n. 1
0
static void media_destructor(void *arg)
{
	struct menc_media *st = arg;

	mem_deref(st->uh);
	mem_deref(st->rtpsock);

	if (st->zrtp_stream)
		zrtp_stream_stop(st->zrtp_stream);
}
Esempio n. 2
0
int AmZRTPSessionState::stopStreams(){
  if (NULL == zrtp_audio)
    return -1;

  zrtp_status_t status = zrtp_stream_stop(zrtp_audio);
  if (zrtp_status_ok != status) {
    ERROR("stopping ZRTP stream\n");
    return -1;
  }
  return 0;
}
Esempio n. 3
0
/*----------------------------------------------------------------------------*/
void zrtp_session_down(zrtp_session_t *session)
{
	int i =0;
	
    if (!session) {
		return;
	}		

	/* Stop ZRTP engine and clear all crypto sources for every stream in the session. */
	zrtp_mutex_lock(session->streams_protector);
	for(i=0; i<ZRTP_MAX_STREAMS_PER_SESSION; i++) {
		zrtp_stream_t *the_stream = &session->streams[i]; 		
		zrtp_stream_stop(the_stream);
	}
	zrtp_mutex_unlock(session->streams_protector);

	/* Release memory allocated on initialization */
	if (session->secrets.rs1) {
		zrtp_sys_free(session->secrets.rs1);
	}
	if (session->secrets.rs2) {
		zrtp_sys_free(session->secrets.rs2);
	}
	if (session->secrets.auxs) {
		zrtp_sys_free(session->secrets.auxs);
	}
	if (session->secrets.pbxs) {
		zrtp_sys_free(session->secrets.pbxs);
	}

	/* We don't need the session key anymore - clear it */
	zrtp_wipe_zstring(ZSTR_GV(session->zrtpsess));

	/* Removing session from the global list */    
	zrtp_mutex_lock(session->zrtp->sessions_protector);
	mlist_del(&session->_mlist);
	zrtp_mutex_unlock(session->zrtp->sessions_protector);		
	
	zrtp_mutex_destroy(session->streams_protector);
	zrtp_mutex_destroy(session->init_protector);
	
	zrtp_sys_free(session);
}