Skip to content

Instantly share code, notes, and snippets.

@rday
Created August 30, 2013 14:43
Show Gist options
  • Save rday/6390601 to your computer and use it in GitHub Desktop.
Save rday/6390601 to your computer and use it in GitHub Desktop.
Asterisk mod sample
static void *rtp_thread(void *args)
{
struct ap_info* thread_info = args;
struct ast_frame *f = NULL;
struct ast_rtp *astRtp = NULL; // XXX <-- Replaced by rtp_engine
int pktCnt=0;
int res = 0;
astRtp = ast_rtp_new_fd(thread_info->sockFd); // XXX <-- Doesn't event exist anymore
fd_flush(thread_info->timerFd);
ast_log(LOG_WARNING, "NEW rtpthread has started - Network Port: %d TimerPort: %d\n", thread_info->sockFd, thread_info->timerFd);
for(;;) {
f = ast_rtp_read(astRtp); // XXX <-- Yea not really the same anymore
if( !f ) {
ast_log(LOG_WARNING, "%d - Ending Thread on Frame(%d) size-%d to ztc\n", thread_info->sockFd, f->subclass.integer, f->datalen);
break;
}
/* ... */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment