[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    [asterisk-dev] Asterisk - 13.6.0 - Problem in sharing data between EXE and SO file:
From:       "Boobalan M" <boobalan.mb () plintron ! com>
Date:       2016-01-06 12:59:25
Message-ID: 003601d14880$653c7610$2fb56230$ () mb () plintron ! com
[Download RAW message or body]

This is a multipart message in MIME format.

[Attachment #2 (multipart/alternative)]
This is a multipart message in MIME format.


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




[Attachment #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:x="urn:schemas-microsoft-com:office:excel" \
xmlns:p="urn:schemas-microsoft-com:office:powerpoint" \
xmlns:a="urn:schemas-microsoft-com:office:access" \
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" \
xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" \
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" \
xmlns:b="urn:schemas-microsoft-com:office:publisher" \
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" \
xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" \
xmlns:odc="urn:schemas-microsoft-com:office:odc" \
xmlns:oa="urn:schemas-microsoft-com:office:activation" \
xmlns:html="http://www.w3.org/TR/REC-html40" \
xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" \
xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" \
xmlns:Repl="http://schemas.microsoft.com/repl/" \
xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" \
xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" \
xmlns:ppda="http://www.passport.com/NameSpace.xsd" \
xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" \
xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" \
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" \
xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" \
xmlns:udc="http://schemas.microsoft.com/data/udc" \
xmlns:xsd="http://www.w3.org/2001/XMLSchema" \
xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" \
xmlns:ec="http://www.w3.org/2001/04/xmlenc#" \
xmlns:sp="http://schemas.microsoft.com/sharepoint/" \
xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" \
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" \
xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" \
xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" \
xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" \
xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" \
xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" \
xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" \
xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" \
xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" \
xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" \
xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" \
xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" \
xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" \
xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Tahoma","sans-serif";
	color:#1919FF;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>Hi Team,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>I am facing issue where <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>I have created new module which carries one global \
variable.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<span style='background:yellow;mso-highlight:yellow'>plin_EXIBSInterface.c</span><o:p></o:p></span></p>


<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
int RrbsConnStatus = 0;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
void PostXMLToEXIBS(){<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<span style='background: \
yellow;mso-highlight:yellow'>ast_debug(2,&quot;RrbsConnStatus in \
PostXMLToEXIBS=%d\n&quot;,RrbsConnStatus);</span><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
RrbsConnStatus++;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<span style='background:yellow;mso-highlight:yellow'>plin_EXIBSInterface.h</span><o:p></o:p></span></p>


<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
extern int RrbsConnStatus;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>I have imported above .h file into <span style='background:yellow;
mso-highlight:yellow'>main/asterik.c</span>.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>But same .h i have imported into <span style='background:yellow;
mso-highlight:yellow'>apps/app_voicemail.c</span><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>Outcome is, global variable not getting shared among the
imported c files(EXE and SHARED LIBRARY).<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>Other details are,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I \
have created .exe by linking asterisk.c along with other set of .c files with \
plin_EXIBSInterface.o<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I \
have created app_voicemail.so by linking plin_EXIBSInterface.o<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
Made asterisk .exe up, so obviously &quot;app_voicemail.so&quot; will be \
loaded.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
Invoking PostXMLToEXIBS() from asterisk.c and in plin_EXIBSInterface.c it prints \
&quot;<span style='background:yellow; mso-highlight:yellow'>RrbsConnStatus in \
PostXMLToEXIBS=0</span>&quot;. again i am calling from app_voicemail.c it prints as \
&quot;<span style='background: yellow;mso-highlight:yellow'>RrbsConnStatus in \
PostXMLToEXIBS=0</span>&quot;. Since i have updated &quot;RrbsConnStatus&quot; during \
first call to &quot;PostXMLToEXIBS()&quot;, in second attempt from app_voicemail.c, \
it has to print RrbsConnStatus as 1 only. But i am getting 0 \
still.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
From above, understood that app_voicemail.so keeping separate \
copy.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Is \
this the actual behaviour of asterisk design?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
Also in my case, how i can share the data between EXE and .so without using static \
variable and other concept?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Can \
anyone suggestion really appreciated.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>Regards,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";
color:#1919FF'>Boobalan<o:p></o:p></span></p>

</div>

</body>

</html>



-- 
_____________________________________________________________________
-- 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic