<div dir="ltr"><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;margin-top:0px;color:rgb(65,65,65);font-size:14px">Hi everyone,</p><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;margin-top:0px;color:rgb(65,65,65);font-size:14px">Sorry if this mail is a repost, but I can't figure out if my first mail went through, because I have first been registered now. </p><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;color:rgb(65,65,65);font-size:14px">I have an issue which I can't fix myself.</p><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;color:rgb(65,65,65);font-size:14px">I want to use a command line argument variable in a different file than asterisk.c. I know it can be realized using the "extern" keyword. The command line argument handling works just fine. But at the moment a SIP message gets into the system and the line, where the variable is used, get executed, the system remains silent. This is the code:</p><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;color:rgb(65,65,65);font-size:14px"><strong>asterisk.c</strong></p><blockquote style="border-left:5px solid rgb(236,236,236);background-color:rgb(240,240,240);clear:both;margin-left:0px;margin-right:0px;padding:12px;color:rgb(65,65,65);font-family:helvetica,arial,sans-serif;font-size:14px"><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;margin-top:0px;margin-bottom:0px"><code style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace;font-size:1em;color:rgb(51,51,51);background-image:initial;background-position:initial;background-repeat:initial;background-color:rgb(248,248,248)">#include "asterisk/chan_sip.h"</code><br>int VAR = 0;<br>[parsing of command line arguments and set VAR to value]<br>printf("%d\n", VAR); <== correct output</p></blockquote><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;color:rgb(65,65,65);font-size:14px"><strong>chan_sip.h</strong></p><blockquote style="border-left:5px solid rgb(236,236,236);background-color:rgb(240,240,240);clear:both;margin-left:0px;margin-right:0px;padding:12px;color:rgb(65,65,65);font-family:helvetica,arial,sans-serif;font-size:14px"><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;margin-top:0px;margin-bottom:0px">extern int VAR;</p></blockquote><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;color:rgb(65,65,65);font-size:14px"><strong>chan_sip.c</strong></p><blockquote style="border-left:5px solid rgb(236,236,236);background-color:rgb(240,240,240);clear:both;margin-left:0px;margin-right:0px;padding:12px;color:rgb(65,65,65);font-family:helvetica,arial,sans-serif;font-size:14px"><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;margin-top:0px;margin-bottom:0px"><code style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace;font-size:1em;color:rgb(51,51,51);background-image:initial;background-position:initial;background-repeat:initial;background-color:rgb(248,248,248)">#include "asterisk/chan_sip.h"</code><br>extern int VAR;<br>printf("%d\n", VAR); <== system prints nothing</p></blockquote><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;color:rgb(65,65,65);font-size:14px">I actually do not want to pass the variable as a function argument. </p><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;color:rgb(65,65,65);font-size:14px">Can you spot any mistakes? Thank you in advance!<br></p><p style="font-family:"helvetica neue",helvetica,arial,sans-serif;color:rgb(65,65,65);font-size:14px">Regards,<br>Juliannn</p></div>