Understanding simple_pjsua.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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?
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20081114/44159362/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux