<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">I'm trying to implement ICE on SIP,<br>I reference the sdp-example of libnice and want to apply it to my SIP codes.<br><br>The example uses the standard IO to exchange the SDPs,<br>but in SIP it needs to listen the response from other side.<br><br>The question is, before I send INVITE I have to gather ICE candidates,<br>and wait for signals to proceed. This will block the main process by g_main_loop_run(),<br>so the SIP procedure can't be triggered normally.<br><br>But if I remove the g_main_loop_run(),according to the line 162 in the example above:<br></p><pre style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit">while (!exit_thread && !candidate_gathering_done)
</code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">this candidate_gathering_done will never be assigned since the signal fail to get through callback function. Is there any non-blocking way to multiplex ICE and SIP procedures?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">Thanks in advance. :)</p></div>