<span id="result_box" class="short_text"><span style="background-color: rgb(255, 255, 255);" title="Ê¥µ®¿ìÀÖ">Merry Christmas</span></span> everyone!<br><br>I'm using FS 1.0.5pre9, I think there is a bug in mod_sofia when SDP changed in 200 OK response for INVITE message, <br>
<br>the scenario is :<br>A(FreeSwitch) B<br> ------INVITE -------> <br clear="all"> <----100 Tring--------<br>
<----180 Ring -------- with sdp m=audio 55066 RTP/AVP 0 120 c=IN IP4 10.36.143.76<br> <----UPDATE ------- with sdp m=audio 45486 RTP/AVP 0 120 c=IN IP4 10.36.143.76<br> -----200 OK ------> response for UPDATE message<br>
<---- 200 OK-------- response for INVITE message, with sdp m=audio 45486 RTP/AVP 0 120 c=IN IP4 10.36.143.76<br> --------ACK ---------><br><br>The
problem is, B changed the rtp port in UPDATE message and "200 OK"
response message, but FS didn't do update, so it still send and
receive data from port 55066. <br>I read the mod_sofia source code and debug log, I found that when get 200OK response ,mod_sofia should update rtp session when sdp information is different of the the pre sdp received in 180 ring response,<br>
I'm using proxy_media mode, and I think there is the same problem in normal mode.<br>
<br>
here is the outbound channel state change log<br>==============================<br>
entering state [received][100]<br>
entering state [calling][0]<br>
entering state [proceeding][180]<br>
entering state [proceeding][200]<br>
entering state [completing][200]<br>
entering state [ready][200]<br>
entering state [completed][200]<br>
entering state [ready][200] <br><br>
<br>The problem is in state [proceeding][200], The code is as follow:<br>sofia.c line 3876<br> if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {<br> if (sofia_glue_activate_rtp(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {<br>
goto done;<br> }<br> }<br><br>Since the rtp session is initialized when 180 RING response received, sofia_glue_activate_rtp will return SWITCH_STATUS_SUCCESS without change any thing,<br>
So, I think the code should be as follow<br><br>3876 if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { <br>3877 if (tech_pvt->rtp_session && !is_dup_sdp){ <br>
3878 sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE); <br>3879 if (sofia_glue_tech_proxy_remote_addr(tech_pvt) != SWITCH_STATUS_SUCCESS || sofia_glue_activate_rtp(tec h_pvt, 0) != SWITCH_STATUS_SUCCESS) { <br>
3880 sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE); <br>3881 goto done; <br>
3882 } <br>3883 sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE); <br>
3884 }else{ <br>3885 if (sofia_glue_activate_rtp(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) { <br>
3886 goto done; <br>3887 } <br>
3888 } <br>3889 } <br><br>When get 200OK reponse and sdp is changed, we should update remote port and set reinvite flag before call sofia_glue_activate_rtp.<br>
<br>Because I'm not so familiy with sofia and mod_sofia's source code, this code is only for PROXY MEDIA mode and doesn't check for codec changed.(in my scenario, only the remote port and ip are changed).<br><br>
Could some fs dev check this problem, and give a offical patch?<br><br>BTW, I guess maybe mod_sofia is just ignore UPDATE message too. (just ignore it if I was wrong)<br><br>Best Regards<br>-- <br>Lei.Tang<br><a href="mailto:lei.tlfly@gmail.com">lei.tlfly@gmail.com</a><br>