Hi Samuel, maybe my question wasn't exactly clear. I don't need to receive or hang up an incoming call, I need to make an outgoing call from my sip client to exeternal phones. The problem is that I don't know exatly when the external phone is ringing because via SIP aren't sent packets about that. Davide Samuel Vinson wrote: > Hi Davide, > > I don't think it works like you described. > When your client receive a call, the callback "on_incoming_call" is called. > You must reply with msg 180 : > pjsua_call_answer(call_id, 180, NULL, NULL); > If you reply immediately by msg 200, the call is established. > > To reply you must call the following function to send msg 200 : > pjsua_call_answer(current_call, 200, NULL, NULL); > > Samuel > > > Davide Marrone a ?crit : >> Hi, >> I'm writing a simple client using PJSUA, the only things that the client >> should do is start a call and at the first ring of the recipient hang up >> the call. With the SIP providers that I have tried the SIP message "180 >> Ringing" isn't sent to the client so I can't handle all the procedure >> only with on_call_state callback. >> >> Dumping the traffic of XTen-XLite I have noticed that the singal of >> ringing is sent to client with RTP packet. >> The problem so is that I need a callback for the incomung RTP traffic, I >> want to analize that traffic and hang up the call when the ringing >> packet arrives. >> I saw the source code and a lower level is used "on_rx_rtp" callback, in >> PJSUA I saw the function pjsua_media_transports_attach that is declared >> but unfortunately is not yet implemented. >> The question is, how can I read the RTP packets using PJSUA? I read >> siprtp.c that use directly PJMEDIA but I can't understand how to >> integrate PJMEDIA with PJSUA, what I have to do for getting a callback >> like on_rx_rtcp? >> >> regards >> Davide >>