= Background = == pjsua_call.c == Currently this is how the media channel interacts with SIP call in PJSUA-LIB. '''pjsua_call_make_call()''' : :: '''pjsua_call_on_incoming()''' : :: '''pjsua_call_update()''' : :: '''pjsua_call_reinvite()''' : :: '''pjsua_call_on_rx_offer()''' : :: '''pjsua_call_on_create_offer()''' : :: pjsua_media_channel_init();[[BR]] pjsua_media_channel_create_sdp(&local_sdp, rem_sdp); '''pjsua_call_on_media_update()''' : :: pjsua_media_channel_update(); '''pjsua_call_on_state_changed(DISCONNECTED)''' : :: '''pjsua_call_on_media_update(HOLD)''' : :: pjsua_media_channel_deinit(); == pjsua_media.c == and this is the implementation of media channel functions above: '''pjsua_media_channel_init()''' : :: pjmedia_transport_srtp_create(); '''pjsua_media_channel_create_sdp()''' : :: pjmedia_endpt_create_sdp();[[BR]] pjmedia_transport_media_create(); '''pjsua_media_channel_update()''' : :: pjmedia_transport_media_start();[[BR]] pjmedia_session_create(); '''pjsua_media_channel_deinit()''' : :: stop_media_session();[[BR]] pjmedia_transport_media_stop();[[BR]] pjmedia_transport_close(srtp); = New = ''New code in italics''. == pjsua_call.c == Currently this is how the media channel interacts with SIP call in PJSUA-LIB. '''pjsua_call_make_call()''' : :: '''pjsua_call_on_incoming()''' : :: ~~pjsua_media_channel_init();~~[[BR]] ~~pjsua_media_channel_create_sdp(&local_sdp, rem_sdp);~~[[BR]] ''pjsua_media_channel_init(&local_sdp, rem_sdp);'' '''pjsua_call_update()''' : :: '''pjsua_call_reinvite()''' : :: '''pjsua_call_on_rx_offer()''' : :: '''pjsua_call_on_create_offer()''' : :: ~~pjsua_media_channel_init(&local_sdp, rem_sdp);~~[[BR]] pjsua_media_channel_create_sdp(&local_sdp, rem_sdp); '''pjsua_call_on_media_update()''' : :: pjsua_media_channel_update(); '''pjsua_call_on_state_changed(DISCONNECTED)''' : :: '''pjsua_call_on_media_update(HOLD)''' : :: pjsua_media_channel_deinit(); == pjsua_media.c == and this is the implementation of media channel functions above: '''pjsua_media_channel_init(&local_sdp, rem_sdp)''' : :: pjmedia_transport_srtp_create();[[BR]] ~~pjmedia_transport_media_create(local_sdp, rem_sdp);~~[[BR]] ''pjmedia_transport_media_create(rem_sdp);''[[BR]] ''pjmedia_transport_encode_sdp(local_sdp, rem_sdp);'' '''pjsua_media_channel_create_sdp(&local_sdp, rem_sdp)''' : :: pjmedia_endpt_create_sdp();[[BR]] ~~pjmedia_transport_media_create(local_sdp, rem_sdp);~~[[BR]] ''pjmedia_transport_encode_sdp(local_sdp, rem_sdp);'' '''pjsua_media_channel_update()''' : :: pjmedia_transport_media_start();[[BR]] pjmedia_session_create(); '''pjsua_media_channel_deinit()''' : :: stop_media_session();[[BR]] pjmedia_transport_media_stop();[[BR]] pjmedia_transport_close(srtp);