[Asterisk-Users] Having trouble with extensions in an include file and retrieve_extensions_from_mysql.pl
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 '[EMAIL PROTECTED]' 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 ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Having trouble with extensions in an include file and retrieve_extensions_from_mysql.pl
beonice wrote: 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 snip 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? The only thing that seems out of place to me is your #include in [main_vp_context]. It looks to me like you intend for the s, #, t, and i extensions to be in [main_vp_context]. The way you layed out this example, that's not what is happenning. I think you wanted this: Your extensions_from_mysql.conf should still look like: [vp_context] exten = 1000,1,Record(/tmp/rec:gsm); exten = 1000,2,Playback(/tmp/rec) ; exten = 1000,3,Background(goodbye) ; exten = 1000,4,Hangup(); Then, in extensions.conf: #include extensions_from_mysql.conf [main_vp_context] exten = s,1,Answer 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 include = vp_context This way, you define both contexts, and include the extensions that were defined in [vp_context] into [main_vp_context]. I don't know if this will resolve your other problem, but I believe this is the dialplan you were trying to build. -- Andrew Thompson http://aktzero.com/ http://dev.asteriskdocs.org/ ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Having trouble with extensions in an include file and retrieve_extensions_from_mysql.pl
--- Andrew Thompson [EMAIL PROTECTED] wrote: --- snip --- The only thing that seems out of place to me is your #include in [main_vp_context]. It looks to me like you intend for the s, #, t, and i extensions to be in [main_vp_context]. The way you layed out this example, that's not what is happenning. I think you wanted this: Your extensions_from_mysql.conf should still look like: [vp_context] exten = 1000,1,Record(/tmp/rec:gsm); exten = 1000,2,Playback(/tmp/rec) ; exten = 1000,3,Background(goodbye) ; exten = 1000,4,Hangup(); Then, in extensions.conf: #include extensions_from_mysql.conf [main_vp_context] exten = s,1,Answer 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 include = vp_context This way, you define both contexts, and include the extensions that were defined in [vp_context] into [main_vp_context]. I don't know if this will resolve your other problem, but I believe this is the dialplan you were trying to build. Hi, Andrew. Yes, I see what you are saying. This sounds backwards, but it's actually doing what I _want_ it to do. :) From what I see in the dialplan, what asterisk does is, it loads the handlers for '#', 't' and 'i' as part of vp_context, not as part of main_vp_context. That actually happens to be as I wanted it. main_vp_context is simply a place-holder for when I am testing without the include file, and in those cases, I simply comment out my include file and voila, those handlers now handle the main_vp_context incoming cases. I know, I'm weird. :) I'm seriously concerned that my problem may be caused by some interaction between asterisk and voicepulse: at the time of writing this, even with a simple extensions.conf that has no included files at all, I cannot dial in to the asterisk box ... all calls are being rejected. Now I've spent a few minutes on (non-toll-free) hold with Voicepulse, sent them copies of my extensions.conf and iax.conf and am waiting for a response. Life really is exciting on the bleeding edge. Cheers, Maya __ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Having trouble with extensions in an include file and retrieve_extensions_from_mysql.pl
beonice wrote: Yes, I see what you are saying. This sounds backwards, but it's actually doing what I _want_ it to do. :) From what I see in the dialplan, what asterisk does is, it loads the handlers for '#', 't' and 'i' as part of vp_context, not as part of main_vp_context. That actually happens to be as I wanted it. main_vp_context is simply a place-holder for when I am testing without the include file, and in those cases, I simply comment out my include file and voila, those handlers now handle the main_vp_context incoming cases. I know, I'm weird. :) Not necessarily... I'm thinking other words... ;) Back to your original post... 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 '[EMAIL PROTECTED]' does not exist So, where is this voicepulse_connect_context context? -- Andrew Thompson http://aktzero.com/ http://dev.asteriskdocs.org/ ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Having trouble with extensions in an include file and retrieve_extensions_from_mysql.pl
I've finally figured the problem. It turns out that it had nothing to do with the include file. When I was commenting out unnecessary extensions in the main extensions.conf, I commented out the line: exten = _NXXNXX,1,Background(welcome) ; I did not realise (it's not mentioned anywhere) that this particular extension NEEDS to be handled, but as soon as I added this line back in, it fixed the problem. Now I have asterisk reading multiple contexts happily from the included file, answering the phone when it rings, and letting me leave myself voicemail. Very cool. Could someone explain why this line is so important? I'm assuming that incoming calls in other countries will have different patterns for the incoming dialed number. How does asterisk handle that? Can we add the explanation to that question into the FAQ somewhere? Thanks again, everyone! Cheers, Maya --- beonice [EMAIL PROTECTED] wrote: --- Andrew Thompson [EMAIL PROTECTED] wrote: --- snip --- The only thing that seems out of place to me is your #include in [main_vp_context]. It looks to me like you intend for the s, #, t, and i extensions to be in [main_vp_context]. The way you layed out this example, that's not what is happenning. I think you wanted this: Your extensions_from_mysql.conf should still look like: [vp_context] exten = 1000,1,Record(/tmp/rec:gsm); exten = 1000,2,Playback(/tmp/rec) ; exten = 1000,3,Background(goodbye) ; exten = 1000,4,Hangup(); Then, in extensions.conf: #include extensions_from_mysql.conf [main_vp_context] exten = s,1,Answer 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 include = vp_context This way, you define both contexts, and include the extensions that were defined in [vp_context] into [main_vp_context]. I don't know if this will resolve your other problem, but I believe this is the dialplan you were trying to build. Hi, Andrew. Yes, I see what you are saying. This sounds backwards, but it's actually doing what I _want_ it to do. :) From what I see in the dialplan, what asterisk does is, it loads the handlers for '#', 't' and 'i' as part of vp_context, not as part of main_vp_context. That actually happens to be as I wanted it. main_vp_context is simply a place-holder for when I am testing without the include file, and in those cases, I simply comment out my include file and voila, those handlers now handle the main_vp_context incoming cases. I know, I'm weird. :) I'm seriously concerned that my problem may be caused by some interaction between asterisk and voicepulse: at the time of writing this, even with a simple extensions.conf that has no included files at all, I cannot dial in to the asterisk box ... all calls are being rejected. Now I've spent a few minutes on (non-toll-free) hold with Voicepulse, sent them copies of my extensions.conf and iax.conf and am waiting for a response. Life really is exciting on the bleeding edge. Cheers, Maya __ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users __ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Having trouble with extensions in an include file and retrieve_extensions_from_mysql.pl
--- Andrew Thompson [EMAIL PROTECTED] wrote: ... snip ... Back to your original post... 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 '[EMAIL PROTECTED]' does not exist So, where is this voicepulse_connect_context context? Ah. When I posted, I shortened it to vp_context. This is what used to be in the main extensions.conf, then that got changed to main_vp_context while voicepulse_connect_context moved into extensions_from_mysql.conf. I should be more careful when I post. :) Cheers, Maya __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users