2007/5/21, Jerry Richards <[EMAIL PROTECTED]>: > Is there an example of how an NUA should handle the SDP body? I realize > there is SDP parsing capability in sofia-sip, but I haven't found any > documentation on how to handle it at the application level.
If you have an audio-only device, it should be relatively simple. When you set up a call, you ask for your media subsystem about the RTP address it uses and the list of codecs that it supports. Next you generate an "user SDP" based on that information. Your IP address goes onto a c= line, your RTP port in m=audio line and list also all of your codecs at the end of a m= line. For example, if you just support PCMU and PCMA, you generate user SDP which should look like this: c=IN IP4 68.143.177.19 m=audio 5004 RTP/AVP 0 8 You include the generated user SDP in SOATAG_USER_SDP_STR() or SOATAG_USER_SDP() in nua_invite()/nua_respond(). After the SDP Offer/Answer has been taken care, you get a nua_i_state event which contains "remote SDP" in SOATAG_REMOTE_SDP() or SOATAG_REMOTE_SDP_STR(). You use the remtoe SDP in order to find out which audio codec the remote end wants you to use and the destination address for the RTP. You look for a m=audio line that has not been rejected. From the m=line, get the RTP port number and the first codec that you support. The remote IP address can be found from the c=line, either it is a media-specific c= line after m= line (in m_connections field in the sdp_media_t structure) or if there is none, the session-level c= line (before m= lines, in the sdp_connection field in the sdp_session_t structure). The m=line also contains information about activity state of the media stream (should you send, receive, both or if the audio is inactive). -- Pekka.Pessi mail at nokia.com ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel