Re: [Ekiga-devel-list] Deviating address-call



> From: patxungo83 hotmail com
> To: ekiga-devel-list gnome org
> Date: Mon, 26 May 2008 22:13:46 +0000
> Subject: Re: [Ekiga-devel-list] Deviating address-call
>
>
> Hello Damien:
>
> Thanks a lot for your answer.
>
> We're students from Spain and we're working on a simple project and basically we want to redirect a certain number of SIPs without change ekiga code and by using LD_PRELOAD. We know we could use a SIP proxy, but that's not the objective of the project
>
> I finally was able to make the changes I asked before by modifying Opal SetUpCall.
> On,
>
> BOOL OpalManager::SetUpCall(const PString & partyA,
> const PString & partyB,
> PString & token,
> void * userData
> )
> {
>
> OpalCall * call = CreateCall();
> token = call->GetToken();
>
> [...]
> char **host; int *port;
>
> if (EndsWith((string)partyB,"company.net")==0) {
> if (getAddress((char *)p,(char **)&host,(int *)&port)) {
> newPartyB = userName&"@"&(char *)host&":"&(*port);
> call->SetPartyB(newPartyB);
> }
> }//else we call SetPartyB with default arguments.
> else call->SetPartyB(partyB);
>
> [...]
>
> Now, the problem happens when we make a call ending on "company.net". We get this:
>
> managerMOD.so: undefined symbol: _Z10getAddressPcPS_Pi
>
> As we say before, we use LD_PRELOAD to override SetUpCall and we compile that function:
>
>
> Where we write the SetUpCall library, is compiled with this. Here are the most important parts of Makefile:
>
> /**
> [...]
> # Dynamic library OPAL building
> managerMOD: managerMOD.o parserxx.o eg_common.o eg_sip.o
> gcc -shared -o managerMOD.so managerMOD.o eg_common.o eg_sip.o parserxx.o -ldl -L/usr/local/lib/
>
> [...]
> managerMOD.o:
> $(CC) $(CFLAGS) $(INCLUDES) -c -o managerMOD.o ./src/lib/overrided_opal/managerMOD.cxx
>
> [...]
> //The rest of .o named on managerMOD are compiled like the previous example.
> **/
>
> The getAddress(...) function is implemented on eg_common.cxx and managerMOD.h includes eg_common.h.
>
> We would be very thankful if you could give us some hint about that undefined symbol problem. Any ideas?
>
> Thanks a lot!
>
>
> _________________________________________________________________
> MSN Video.
> http://video.msn.com/?mkt=es-es
> _______________________________________________
> Ekiga-devel-list mailing list
> Ekiga-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/ekiga-devel-list

Hello again:

Finally I solve the problem. We are mixing C and C++ code, and because of nambling the getAddress symbolwas unresolved. The solution:

#ifndef CTEST_H
#define CTEST_H

#ifdef __cplusplus
extern "C" {
#endif

int getAddress(char *__name, char **__host, int *__port);

#ifdef __cplusplus
}
#endif

#endif

The magic "C" extern on .h.

I'm very happy to finally get this code runnning. Thank you because of your attention and good luck with this excellent project.

--
A. G. A.

_________________________________________________________________
Tecnología, moda, motor, viajes,…suscríbete a nuestros boletines para estar siempre a la última
http://newsletters.msn.com/hm/maintenanceeses.asp?L=ES&C=ES&P=WCMaintenance&Brand=WL&RU=http%3a%2f%2fmail.live.com


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