📄 sdp_negoc.h
字号:
char *(*fcn_get_other_port) (void *, int); };/** * Initialise (and Allocate) a sdp_config element (this element is global). * This method must be called when the application is started. */ int sdp_config_init ();/** * Free resource stored by a sdp_config element. * This method must be called once when the application is stopped. */ void sdp_config_free ();/** * Set the local username ('o' field) of all local SDP packet. * @param tmp The username. */ int sdp_config_set_o_username (char *tmp);/** * Set the local session id ('o' field) of all local SDP packet. * WARNING: this field should be updated for each new SDP packet? * @param tmp The session id. */ int sdp_config_set_o_session_id (char *tmp);/** * Set the local session version ('o' field) of all local SDP packet. * WARNING: this field should be updated for each new SDP packet? * @param tmp The session version. */ int sdp_config_set_o_session_version (char *tmp);/** * Set the local network type ('o' field) of all local SDP packet. * @param tmp The network type. */ int sdp_config_set_o_nettype (char *tmp);/** * Set the local address type ('o' field) of all local SDP packet. * @param tmp The address type. */ int sdp_config_set_o_addrtype (char *tmp);/** * Set the local IP address ('o' field) of all local SDP packet. * @param tmp The IP address. */ int sdp_config_set_o_addr (char *tmp);/** * Set the local network type ('c' field) of all local SDP packet. * @param tmp The network type. */ int sdp_config_set_c_nettype (char *tmp);/** * Set the local address type ('c' field) of all local SDP packet. * @param tmp The address type. */ int sdp_config_set_c_addrtype (char *tmp);/** * Set the local IP address ('c' field) of all local SDP packet. * @param tmp The IP address. */ int sdp_config_set_c_addr (char *tmp);/** * Set the local ttl for multicast address ('c' field) of all local SDP packet. * @param tmp The ttl for multicast address. */ int sdp_config_set_c_addr_multicast_ttl (char *tmp);/** * Set the local int for multicast address ('c' field) of all local SDP packet. * @param tmp The int for multicast address. */ int sdp_config_set_c_addr_multicast_int (char *tmp);/** * Add a supported audio codec. * Those codecs will be accepted as long as you return 0 when * the callback 'fcn_accept_audio_codec' is called with the specific payload. * @param payload The payload. * @param number_of_port The number of port (channel) for this codec. * @param proto The protocol. * @param c_nettype The network type in the 'c' field. * @param c_addrtype The address type in the 'c' field. * @param c_addr The address in the 'c' field. * @param c_addr_multicast_ttl The ttl for multicast address in the 'c' field. * @param c_addr_multicast_int The int for multicast address in the 'c' field. * @param a_rtpmap The rtpmap attribute in the 'a' field. */ int sdp_config_add_support_for_audio_codec (char *payload, char *number_of_port, char *proto, char *c_nettype, char *c_addrtype, char *c_addr, char *c_addr_multicast_ttl, char *c_addr_multicast_int, char *a_rtpmap);/** * Add a supported video codec. * Those codecs will be accepted as long as you return 0 when * the callback 'fcn_accept_video_codec' is called with the specific payload. * @param payload The payload. * @param number_of_port The number of port (channel) for this codec. * @param proto The protocol. * @param c_nettype The network type in the 'c' field. * @param c_addrtype The address type in the 'c' field. * @param c_addr The address in the 'c' field. * @param c_addr_multicast_ttl The ttl for multicast address in the 'c' field. * @param c_addr_multicast_int The int for multicast address in the 'c' field. * @param a_rtpmap The rtpmap attribute in the 'a' field. */ int sdp_config_add_support_for_video_codec (char *payload, char *number_of_port, char *proto, char *c_nettype, char *c_addrtype, char *c_addr, char *c_addr_multicast_ttl, char *c_addr_multicast_int, char *a_rtpmap);/** * Add a supported (non-audio and non-video) codec. * Those codecs will be accepted as long as you return 0 when * the callback 'fcn_accept_other_codec' is called with the specific payload. * @param payload The payload. * @param number_of_port The number of port (channel) for this codec. * @param proto The protocol. * @param c_nettype The network type in the 'c' field. * @param c_addrtype The address type in the 'c' field. * @param c_addr The address in the 'c' field. * @param c_addr_multicast_ttl The ttl for multicast address in the 'c' field. * @param c_addr_multicast_int The int for multicast address in the 'c' field. * @param a_rtpmap The rtpmap attribute in the 'a' field. */ int sdp_config_add_support_for_other_codec (char *payload, char *number_of_port, char *proto, char *c_nettype, char *c_addrtype, char *c_addr, char *c_addr_multicast_ttl, char *c_addr_multicast_int, char *a_rtpmap);#ifndef DOXYGEN/** * Free resource in the global sdp_config.. */ int sdp_config_remove_audio_payloads ();/** * Free resource in the global sdp_config.. */ int sdp_config_remove_video_payloads ();/** * Free resource in the global sdp_config.. */ int sdp_config_remove_other_payloads ();#endif/** * Set the callback for setting info ('i' field) in a local SDP packet. * This callback is called once each time we need an 'i' field. * @param fcn The callback. */ int sdp_config_set_fcn_set_info (int (*fcn) (sdp_context_t *, sdp_t *));/** * Set the callback for setting a URI ('u' field) in a local SDP packet. * This callback is called once each time we need an 'u' field. * @param fcn The callback. */ int sdp_config_set_fcn_set_uri (int (*fcn) (sdp_context_t *, sdp_t *));/** * Set the callback for setting an email ('e' field) in a local SDP packet. * This callback is called once each time we need an 'e' field. * @param fcn The callback. */ int sdp_config_set_fcn_set_emails (int (*fcn) (sdp_context_t *, sdp_t *));/** * Set the callback for setting a phone ('p' field) in a local SDP packet. * This callback is called once each time we need an 'p' field. * @param fcn The callback. */ int sdp_config_set_fcn_set_phones (int (*fcn) (sdp_context_t *, sdp_t *));/** * Set the callback for setting an attribute ('a' field) in a local SDP packet. * This callback is called once each time we need an 'a' field. * @param fcn The callback. */ int sdp_config_set_fcn_set_attributes (int (*fcn) (sdp_context_t *, sdp_t *, int));/** * Set the callback used to accept a codec during a negotiation. * This callback is called once each time we need to accept a codec. * @param fcn The callback. */ int sdp_config_set_fcn_accept_audio_codec (int (*fcn) (sdp_context_t *, char *, char *, int, char *));/** * Set the callback used to accept a codec during a negotiation. * This callback is called once each time we need to accept a codec. * @param fcn The callback. */ int sdp_config_set_fcn_accept_video_codec (int (*fcn) (sdp_context_t *, char *, char *, int, char *));/** * Set the callback used to accept a codec during a negotiation. * This callback is called once each time we need to accept a codec. * @param fcn The callback. */ int sdp_config_set_fcn_accept_other_codec (int (*fcn) (sdp_context_t *, char *, char *, char *, char *));/** * Set the callback for setting the port number ('m' field) in a local SDP packet. * This callback is called once each time a 'm' line is accepted. * @param fcn The callback. */ int sdp_config_set_fcn_get_audio_port (char *(*fcn) (sdp_context_t *, int));/** * Set the callback for setting the port number ('m' field) in a local SDP packet. * This callback is called once each time a 'm' line is accepted. * @param fcn The callback. */ int sdp_config_set_fcn_get_video_port (char *(*fcn) (sdp_context_t *, int));/** * Set the callback for setting the port number ('m' field) in a local SDP packet. * This callback is called once each time a 'm' line is accepted. * @param fcn The callback. */ int sdp_config_set_fcn_get_other_port (char *(*fcn) (sdp_context_t *, int));/** * Start the automatic negotiation for a UA * NOTE: You can previously set context->mycontext to point to your * personal context. This way you'll get access to your personal context * in the callback and you can easily take the correct decisions. * After this method is called, the negotiation will happen and * callbacks will be called. You can modify, add, remove SDP fields, * and accept and refuse the codec from your preferred list by using * those callbacks. * Of course, after the negotiation happen, you can modify the * SDP packet if you wish to improve it or just refine some attributes. * @param ctx The context holding the remote SDP offer. */ int sdp_context_execute_negotiation (sdp_context_t * ctx); int sdp_build_offer (sdp_context_t * con, sdp_t ** sdp, char *audio_port, char *video_port); int __sdp_build_offer (sdp_context_t * con, sdp_t ** sdp, char *audio_port, char *video_port, char *audio_codec, char *video_codec); /* for non "on-hold sdp" in outgoing invite */ int sdp_put_on_hold (sdp_t * sdp); /* for an "on hold sdp" in outgoing invite */ int sdp_put_off_hold (sdp_t * sdp);#ifndef DOXYGEN/* deprecated for spelling reasons... */#define sdp_context_execute_negociation sdp_context_execute_negotiation#endif/** @} */#ifdef __cplusplus}#endif#endif /*_SDP_NEGOC_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -