Hi Team,

 

I am facing issue where 

 

I have created new module which carries one global variable.

            

            plin_EXIBSInterface.c

                        

                        int RrbsConnStatus = 0;

                        

                        void PostXMLToEXIBS(){

                                    ast_debug(2,"RrbsConnStatus in
PostXMLToEXIBS=%d\n",RrbsConnStatus);

                                    RrbsConnStatus++;

                        }

                        

            plin_EXIBSInterface.h

                        extern int RrbsConnStatus;

 

I have imported above .h file into main/asterik.c.

 

But same .h i have imported into apps/app_voicemail.c

 

Outcome is, global variable not getting shared among the imported c
files(EXE and SHARED LIBRARY).

 

Other details are,

            

            I have created .exe by linking asterisk.c along with other set
of .c files with plin_EXIBSInterface.o

            I have created app_voicemail.so by linking plin_EXIBSInterface.o

            Made asterisk .exe up, so obviously "app_voicemail.so" will be
loaded.

            

            Invoking PostXMLToEXIBS() from asterisk.c and in
plin_EXIBSInterface.c it prints "RrbsConnStatus in PostXMLToEXIBS=0". again
i am calling from app_voicemail.c it prints as "RrbsConnStatus in
PostXMLToEXIBS=0". Since i have updated "RrbsConnStatus" during first call
to "PostXMLToEXIBS()", in second attempt from app_voicemail.c, it has to
print RrbsConnStatus as 1 only. But i am getting 0 still.

            

            From above, understood that app_voicemail.so keeping separate
copy.

            

            Is this the actual behaviour of asterisk design?

            Also in my case, how i can share the data between EXE and .so
without using static variable and other concept?

            

            Can anyone suggestion really appreciated.

            

Regards,

Boobalan



-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to