/** * Set session's SDES item for automatic sending of RTCP compound packets. * If some items are not specified, use NULL. **/ void rtp_session_set_source_description(RtpSession *session, const char *cname, const char *name, const char *email, const char *phone, const char *loc, const char *tool, const char *note) { mblk_t *m; mblk_t *chunk = sdes_chunk_new(session->snd.ssrc); if (strlen(cname)>255) { /* * rfc3550, * 6.5 SDES: Source Description RTCP Packet * ... * Note that the text can be no longer than 255 octets, * * */ ortp_warning("Cname [%s] too long for session [%p]",cname,session); } sdes_chunk_set_full_items(chunk, cname, name, email, phone, loc, tool, note); if (session->full_sdes != NULL) freemsg(session->full_sdes); session->full_sdes = chunk; chunk = sdes_chunk_new(session->snd.ssrc); m = sdes_chunk_set_minimal_items(chunk, cname); m = sdes_chunk_pad(m); if (session->minimal_sdes != NULL) freemsg(session->minimal_sdes); session->minimal_sdes = chunk; }
static mblk_t * sdes_chunk_set_full_items(mblk_t *m, const char *cname, const char *name, const char *email, const char *phone, const char *loc, const char *tool, const char *note) { m = sdes_chunk_set_minimal_items(m, cname); m = sdes_chunk_append_item(m, RTCP_SDES_NAME, name); m = sdes_chunk_append_item(m, RTCP_SDES_EMAIL, email); m = sdes_chunk_append_item(m, RTCP_SDES_PHONE, phone); m = sdes_chunk_append_item(m, RTCP_SDES_LOC, loc); m = sdes_chunk_append_item(m, RTCP_SDES_TOOL, tool); m = sdes_chunk_append_item(m, RTCP_SDES_NOTE, note); m = sdes_chunk_pad(m); return m; }
/** * Set session's SDES item for automatic sending of RTCP compound packets. * If some items are not specified, use NULL. **/ void rtp_session_set_source_description(RtpSession *session, const char *cname, const char *name, const char *email, const char *phone, const char *loc, const char *tool, const char *note){ mblk_t *chunk = sdes_chunk_new(session->snd.ssrc); mblk_t *m=chunk; const char *_cname=cname; if (_cname==NULL) { _cname="Unknown"; } chunk=sdes_chunk_append_item(chunk, RTCP_SDES_CNAME, _cname); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_NAME, name); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_EMAIL, email); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_PHONE, phone); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_LOC, loc); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_TOOL, tool); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_NOTE, note); chunk=sdes_chunk_pad(chunk); if (session->sd!=NULL) freemsg(session->sd); session->sd=m; }
void rtp_session_add_contributing_source(RtpSession *session, uint32_t csrc, const char *cname, const char *name, const char *email, const char *phone, const char *loc, const char *tool, const char *note) { mblk_t *chunk = sdes_chunk_new(csrc); mblk_t *m=chunk; char *_cname=(char*)cname; if (_cname==NULL) { _cname="toto"; } chunk=sdes_chunk_append_item(chunk, RTCP_SDES_CNAME, cname); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_NAME, name); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_EMAIL, email); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_PHONE, phone); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_LOC, loc); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_TOOL, tool); chunk=sdes_chunk_append_item(chunk, RTCP_SDES_NOTE, note); chunk=sdes_chunk_pad(chunk); putq(&session->contributing_sources,m); }