On 20 Mar 2006 at 22:49, Marcin Michalak wrote:

> On 20 Mar 2006 at 21:26, Pekka Pessi wrote:
> 
> > On 3/20/06, Marcin Michalak <[EMAIL PROTECTED]> wrote:
> > >  I'm trying to create a .NET application and its complaining about
> > > the callback function. How should it be declared? In C it works, but
> > > when I use c++ it complains that conversion is not possible :-(
> > 
> > Try to add extern "C" to your declaration? something like
> > 
> > extern "C" int marcins_callback(marcins_magic_t *, nta_leg_t *,
> > nta_outgoing_t *, sip_t const *);
> Hi,
>  I tried that, but still doesn't work... I'll try some casting, but 
> that may be tricky...
>  Anyway, its not a good solution as well, because I need to access 
> some C++ functions inside my callback :-(
>  Marcin
Hi,
 I have some progress, at least it compiles...
In .h class file, I need to declare:

        static nta_request_f process_request;
        static nta_response_f process_response;

Then, in .cpp file the body is:
int ASIG::process_request(nta_leg_magic_t *lmagic,
                       nta_leg_t *leg,
                       nta_incoming_t *irq,
                       sip_t const *sip)
{
 context_t *context = (context_t *)lmagic;
...
}

int ASIG::process_response(nta_outgoing_magic_t *magic,
                                 nta_outgoing_t *req,
                                 sip_t const *sip)
{
 context_t *context = (context_t *)magic;
...
}

I'll check if it works :-)
  Marcin


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sofia-sip-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to