int response_complete(http_parser* p){ if(p->status_code /100 != 1){ struct session * s = p->data; session_time_mark(s, &s->rep_time); session_report(s, 0); } return 0; }
/* * Following need to be sent by rtcp: * - SR/RR depends on the condition * - SDES:CNAME * - BYE if bye */ int vrtp_rtcp_out(profile_handler_t *handler, xrtp_rtcp_compound_t *rtcp) { vrtp_handler_t *h = (vrtp_handler_t *)handler; /* APP packet for vorbis codebook transfer */ xrtp_session_t *ses = rtcp->session; uint32 rtpts_h; int signum; void *minfo; uint8 *app_mi = NULL; char appname[4] = {'V','O','R','B'}; session_report(h->session, rtcp, h->timestamp_send); if(session_distribute_mediainfo(ses, &rtpts_h, &signum, &minfo)) { vorbis_info_t *vinfo = (vorbis_info_t*)minfo; int applen = vinfo->header_identification_len + vinfo->header_comment_len + vinfo->header_setup_len + 16; if(applen > 0) { int nheader=0; uint8 *app; app_mi = xmalloc(applen); app_mi[0] = rtpts_h & 0xF000; app_mi[1] = rtpts_h & 0x0F00; app_mi[2] = rtpts_h & 0x00F0; app_mi[3] = rtpts_h & 0x000F; app_mi[4] = (char)0xFF; app_mi[5] = (char)0xFF; app_mi[6] = (char)0xFF; app_mi[7] = (char)0xFF; app_mi[8] = (char)0x0; app_mi[9] = signum & 0xFF; memset(&app_mi[10], 0, 6); /* len set to zero */ app = &app_mi[16]; vrtp_log(("audio/vorbis.vrtp_rtcp_out: vinfo@%d\n", (int)vinfo)); if(vinfo->header_identification_len) { app_mi[8] |= 0x80; app_mi[10] = (vinfo->header_identification_len & 0xFF00) >> 8; app_mi[11] = vinfo->header_identification_len & 0x00FF; memcpy(app, vinfo->header_identification, vinfo->header_identification_len); app += vinfo->header_identification_len; nheader++; }
void session_close(struct session * s, char nids_state){ session_report(s, nids_state); free_item(&s->client_parser); free_item(&s->server_parser); free(s); }