r3001 - in asterisk/trunk/debian: . patches

Lionel Elie Mamane lionel at mamane.lu
Sat Jan 13 14:40:42 CET 2007


On Sat, Jan 13, 2007 at 02:17:01PM +0100, Kilian Krause wrote:
> On Sat, Jan 13, 2007 at 02:13:39PM +0100, Lionel Elie Mamane wrote:
>> On Sat, Jan 13, 2007 at 12:05:56PM +0100, Kilian Krause wrote:

>>> Log:
>>> - Revert r2998: We don't ship that dir in the first place to then move it over.
>>>   We just have asterisk look for it in the right place right away.

>> That would be a very good solution if we actually did that. I tested
>> asterisk-bristuff version 1.2.14~dfsg-2, exactly the i386 .deb you
>> uploaded and asterisk still tries to put them in
>> /usr/share/asterisk/sounds/priv-callerintros/ .

> I don't see why it should do so from the source.

Glancing at the source code after "make -f debian/rules patch", I see
in app_dial.c:

                else if( privdb_val == AST_PRIVACY_UNKNOWN ) {
                        /* Get the user's intro, store it in priv-callerintros/$CID,
                           unless it is already there-- this should be done before the
                           call is actually dialed  */

                        /* make sure the priv-callerintros dir actually exists */
                        snprintf(privintro, sizeof(privintro), "%s/sounds/priv-callerintros", ast_config_AST_VAR_DIR);
                        if (mkdir(privintro, 0755) && errno != EEXIST) {
                                ast_log(LOG_WARNING, "privacy: can't create directory priv-callerintros: %s\n", strerror(errno));
                                res = -1;
                                goto out;
                        }

That part is all fine and dandy, it _creates_ the directory in the
right place if it doesn't exist anymore. But then for opening the
file:

                        snprintf(privintro,sizeof(privintro),"priv-callerintros/%s", privcid);
                        if( ast_fileexists(privintro,NULL,NULL ) > 0 && strncmp(privcid,"NOCALLERID",10) != 0) {
(...)
                                res = ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0);

For the actual file, it uses a relative name; I presume the
ast_fileexists and ast_play_and_record stick
ast_config_AST_DATA_DIR "/sounds/" in front of it automatically if it
doesn't start with a slash. Lemme check... Yeah, that is it.

I'm changing that line to

                        snprintf(privintro,sizeof(privintro),"%s/sounds/priv-callerintros/%s", ast_config_AST_VAR_DIR, privcid);

and testing that. Stay tuned.

-- 
Lionel



More information about the Pkg-voip-maintainers mailing list