[Asterisk-Users] Having trouble with extensions in an include file and retrieve_extensions_from_mysql.pl

beonice beonice at yahoo.com
Thu Feb 17 06:39:20 MST 2005


Folks,

I've been running asterisk successfully using the
extensions.conf and voicemail.conf.

Now that I've got asterisk happily looking up MySQL
tables for the VM configuration, I decided to try out
the contributed script
 
/usr/src/asterisk/contrib/scripts/retrieve_extensions_from_mysql.pl

I edited the script so that its output goes to a
separate  extensions_from_mysql.conf file.

The resulting extensions_from_mysql.conf file looks
something like this:
[vp_context]
exten => 1000,1,Record(/tmp/rec:gsm)    ;
exten => 1000,2,Playback(/tmp/rec)      ;
exten => 1000,3,Background(goodbye)     ;
exten => 1000,4,Hangup()    ;

I decided to #include this in my main extensions.conf,
like so:

[main_vp_context]
exten => s,1,Answer
#include <extensions_from_mysql.conf>
exten => #,1,Background(goodbye)   ; Notify caller
exten => #,2,Hangup()     ; Hang up
exten => t,1,Hangup()     ; Hang up if timeout
exten => i,1,Playback(invalid) ; Play "invalid
                               ; extension" if caller
                               ; misdials an extension

Basically, I expect asterisk to load the two as
separate contexts, and I could swear that it used to.

In fact, when I set the verbosity higher, asterisk is
definitely still loading them as separate contexts.

As of yesterday, though, when I have this format,
asterisk won't accept incoming calls. It barfs with
the message:
Feb 16 21:53:14 NOTICE[4330]: chan_iax2.c:5757
socket_read: Rejected connect attempt from
66.234.228.170, request
'##########@voicepulse_connect_context' does not exist

The only way to get asterisk to receive calls again is
to edit the included file to ensure it does not have a
context line in it. So I commented out the line where
the retrieve_extensions_from_mysql.pl sticks the
context information into the created file.

Now, it all works fine.

But it's no good.

What about when I want to have a sip.conf and have a
list of extensions that do different things in the sip
context? I really like the contributed script for its
ability to add multiple context sections.

Anyone see a possible reason for the problem? Do you
have any ideas how to use an include file which
contains multiple contexts? Or will I have to generate
multiple include files, one per included context,
without the context lines in these files?

Thanks for any help!

Cheers,
Maya






	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail



More information about the asterisk-users mailing list