local RTP port unreachable when using mjsip/jmf
I create a sip session with mjsip to an external voip provider. Then I transmit a test wav file over rtp to the provider using RtpManager.
The prog开发者_开发技巧ram runs with no errors and I answer the sip call. However, no audio is transmitted. When I diagnose the network traffic with wireshark, I see a bunch of RTP traffic from my localhost (behind some kind of nat) to the voip provider and nothing back.
After a while I get the ICMP error "Destination unreachable (Port unreachable)" from the provider to my localhost.
The software linphone works using the same localhost and voip provider - though it is using a different sip stack.
Any suggestions?
Thanks
You've already answered your own question, but yes, you're right: The Callee/UAS will, after some period of time, regard the connection as having failed to be established if it hasn't received an ACK.
The SIP RFC tells us that the UAS's server INVITE transaction will enter the Completed state when it sends a 200 OK. Receipt of an ACK sends it to the Confirmed state.
If, however, the UAS either has a transport error when sending the 200 OK or fails to timeously receive an ACK (Timer H fires (64T1 = 64500m = 32 seconds by default), the UAS will move to the Terminated state.
D'oh!
The issue was found to be that I did not send an ACK to a SIP 200 message when my call was accepted in my call listener class. So the voip client ignored the corresponding rtp requests.
public void onCallAccepted(Call call, String sdp, Message resp){
System.out.println("call accepted");
call.ackWithAnswer(sdp); //this was the missing line I needed
this.setupRtpSession(call);
}
Hopefully this helps anyone with a similar problem
精彩评论