On Mon, Oct 16, 2017, at 06:45 AM, Nir Simionovich wrote:
> Ok, that helped - looks like I'm linking correctly now.
> 
> Different question, I remember their used to be a "safe string copy"
> function that I'm supposed to use,
> instead of using strcpy. Mainly, I want to parse my configuration file
> correctly, but I can't find any
> specific methodology for doing this in a uniform asteriskish manner.

>From a configuration perspective there's two APIs:

If only .conf files are needed then there is the Asterisk Config Options
API, include/asterisk/config_options.h, which is used by the skeleton
application apps/app_skel.c for configuration parsing, storing, and
usage.

If realtime is needed then there is the Asterisk Sorcery API,
include/asterisk/sorcery.h, which is used by PJSIP and other things -
with the simplest being res/res_mwi_external.c

It's highly recommended to use one of them instead of rolling your own
configuration parsing. They take care of things (such as safe atomic
reloads).

The "safe string copy" you are thinking of is probably ast_copy_string.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

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