[asterisk-dev] Using command line arguments in other file than asterisk.c

Corey Farrell git at cfware.com
Thu Sep 15 11:09:04 CDT 2016


A custom command-line option is undesirable due to the limited number
of possible option codes / chance of future conflict if we need to add
a standard option.  If you really need a custom option just for your
own chan_sip, it would be better to add it to sip.conf and parse it
during config load.  Another option would be to have chan_sip
recognize an environmental variable.

You haven't said what your option is needed for so nobody can judge if
you have a common need that should be added to chan_sip.

On Wed, Sep 14, 2016 at 11:48 AM, Julian Fleischhauer
<julian.fleischhauer at gmail.com> wrote:
>
> 2016-09-14 11:18 GMT+02:00 Tzafrir Cohen <tzafrir.cohen at xorcom.com>:
>>
>> On Tue, Sep 13, 2016 at 05:09:59PM +0200, Julian Fleischhauer wrote:
>> > Hi everyone,
>> >
>> > 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.
>> >
>> > I have an issue which I can't fix myself.
>> >
>> > I want to use a command line argument variable in a different file than
>> > asterisk.c.
>>
>> Command-line arguments are kept in ast_options. 'git grep -w
>> ast_options' would show you many places in the code where they are
>> tested. Those options are also asterisk.conf options as command-line
>> arguments generally relate to asterisk.conf options.
>>
>
> I've already tried using ast_options but I figured out that it will be
> difficult because ast_flags is an unsigned int, which has a maximal size of
> 32 bit. Unfortunately, there are already 31 different option flags, and I
> need to use four additional ones.
>
> Regards,
> Juliannn
>
>
> --
> _____________________________________________________________________
> -- 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



More information about the asterisk-dev mailing list