sdp_helpr_funcs.h

00001 /*
00002  * $Id: sdp_helpr_funcs.h 4807 2008-09-02 15:00:48Z osas $
00003  *
00004  * SDP parser helpers
00005  *
00006  * Copyright (C) 2008-2009 SOMA Networks, INC.
00007  * Copyright (C) 2010 VoIP Embedded, Inc
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted provided that the following conditions are met:
00011  * 
00012  *  1. Redistributions of source code must retain the above copyright notice,
00013  *  this list of conditions and the following disclaimer.
00014  *  2. Redistributions in binary form must reproduce the above copyright
00015  *  notice, this list of conditions and the following disclaimer in the
00016  *  documentation and/or other materials provided with the distribution.
00017  * 
00018  * THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR
00019  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00020  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
00021  * EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00022  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00023  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00024  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00025  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00026  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00027  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00028  *
00029  */
00030 
00031 
00032 
00033 #ifndef _SDP_HLPR_FUNCS_H
00034 #define  _SDP_HLPR_FUNCS_H
00035 
00036 #include "../../str.h"
00037 #include "../msg_parser.h"
00038 
00045 int get_mixed_part_delimiter(str * body, str * mp_delimiter);
00046 
00047 int extract_rtpmap(str *body, str *rtpmap_payload, str *rtpmap_encoding, str *rtpmap_clockrate, str *rtpmap_parmas);
00048 int extract_fmtp( str *body, str *fmtp_payload, str *fmtp_string );
00049 int extract_ptime(str *body, str *ptime);
00050 int extract_sendrecv_mode(str *body, str *sendrecv_mode, int *is_on_hold);
00051 int extract_mediaip(str *body, str *mediaip, int *pf, char *line);
00052 int extract_media_attr(str *body, str *mediamedia, str *mediaport, str *mediatransport, str *mediapayload, int *is_rtp);
00053 int extract_bwidth(str *body, str *bwtype, str *bwwitdth);
00054 
00055 /* RFC3605 attributes */
00056 int extract_rtcp(str *body, str *rtcp);
00057 
00058 /* RFC4975 attributes */
00059 int extract_accept_types(str *body, str *accept_types);
00060 int extract_accept_wrapped_types(str *body, str *accept_wrapped_types);
00061 int extract_max_size(str *body, str *max_size);
00062 int extract_path(str *body, str *path);
00063 
00064 char *find_sdp_line(char *p, char *plimit, char linechar);
00065 char *find_next_sdp_line(char *p, char *plimit, char linechar, char *defptr);
00066 
00067 char* get_sdp_hdr_field(char* , char* , struct hdr_field* );
00068 
00069 char *find_sdp_line_delimiter(char *p, char *plimit, str delimiter);
00070 char *find_next_sdp_line_delimiter(char *p, char *plimit, str delimiter, char *defptr); 
00071 char * find_first_sdp_line(char* pstart, char* plimit, char linechar,
00072                  char* defptr);
00073 #endif