Hi, Thanks lot for your information. I got the idea. But still I have a problem. If I use this lines in a C++ it gives some errors. Can't we use function pointers in C++ applications? Thank You. Anupama Pathirage ________________________________ From: Nigel Hsiung <nigelcz@xxxxxxxxxxx> To: pjsip at lists.pjsip.org Sent: Friday, November 14, 2008 5:00:22 PM Subject: Re: Understanding simple_pjsua.c cfg.cb.on_incoming_call is a callback or function pointer. It is pointing to the "address of" (&) the on_incoming_call(). Normally, ur application calls a lib function to get something done. Sometimes the lib function may not know what needs to be done when something happens, like in this case when theres an incoming call - it cannot reject/ring/accept/ the call. The decision is best left to ur application code. You customize and create the logic of what needs to be done for an on_incoming_call() and pass it to the lib. This allows the library to call/notify ur application function when an incoming call occurs. Hope this helps, Nigel ________________________________ Date: Thu, 13 Nov 2008 03:05:33 -0800 From: piyumali2004@xxxxxxxxx To: pjsip at lists.pjsip.org Subject: Understanding simple_pjsua.c Hi, Can any one please explain me, what is the purpose of the following line of codes in the sample "simple_pjsua.c"(line numbers 129-131) ? cfg.cb.on_incoming_call = &on_incoming_call; cfg.cb.on_call_media_state = &on_call_media_state; cfg.cb.on_call_state = &on_call_state; Specially what is the purpose of using '&' here? Regards, Anupama Pathirage. ________________________________ Connect to the next generation of MSN Messenger Get it now! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20081116/c9cf1bc7/attachment.html>