"garypty" <[email protected]> wrote:

send (my_socket, message, strlen(message), 0);          // Send out a
request message
recv (my_socket, recv_buffer, sizeof(recv_buffer), 0);           // Blocked
the thread for receiving a respond
debug_flag++;
// start microphone and speaker here.../

I use Wireshark to sniff the traffic. My device did send out a request
message (an INVITE message in SIP) and the other end did respond a message
(a 180 RINGING respond) and my device did reply an ACK for that response.
However I found that the "/debug_flag/" did not increment and the thread is
still blocked.

Why shouldn't it? The little I know about SIP, is it that it can use both UDP
and TCP. I assume you use UDP, or?

So how do your protocol receiver-function know when a complete response has been completed? I assume you'll have to wait until a CRLF is received. You could try calling 'recv (s,&ch,1)' in a loop and decode the response char-by-char until you see a CR-LF combination. Or maybe lwIP does have
a fgets() for sockets?

--gv

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to