Don't think you actually can, per se. What you can do is set a variable and redirect to the line that has this defined or undefined.
Let's say that you have 4 lines; SIP/1001 and DAHDI/1 have faxdetect=yes defined in sip.conf and chan_dahdi.conf. SIP/1002 and DAHDI/2 have faxdetect=no in the respective places. Simple Perl AGI to set dialplan variable: cat selline.pl #!/usr/local/bin/perl ################################################################# # # Send USEFAX to Dialplan # ################################################################# use strict; use warnings; require Asterisk::AGI; # turn off I/O buffering $| = 1; # the AGI object my $agi = new Asterisk::AGI; my %input = $agi->ReadParse(); print STDOUT "SET VARIABLE USEFAX \"ON\" \n"; print STDOUT "SET VARIABLE USEFAX \"OFF\" \n"; exit; In the Dialplan Exten => s,1,Answer() Exten => s,n,AGI(selline.pl) Exten => s,n,Gotoif($ exten => s,1,Gotoif($[${USEFAX} = ON]?on:off) exten => s,n(on),Dial(SIP/1001) exten => s,n,hangup exten => s,n(off),Dial(SIP/1002) exten => s,n,hangup From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of David Cunningham Sent: Friday, January 04, 2013 1:11 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] faxdetect on/off on the fly? Hi Danny, Can you please elaborate on how in the dialplan we can set faxdetect on and off? We currently have it set on in sip.conf. Thanks. On 3 January 2013 17:21, Danny Nicholas <da...@debsinc.com> wrote: From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of David Cunningham Sent: Thursday, January 03, 2013 3:13 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] faxdetect on/off on the fly? Hello, We want the ability to choose from an AGI script whether or not to enable faxdetect for calls over SIP or DAHDI. Is this possible, or can anyone suggest a workaround? Thanks for any advice. You should be able to call the AGI and set a dialplan variable and use Gotoif to do/not do faxdetect. Reading the .sample files for 11.0 it seems that normally these are "configured until restart/reload" but with a little testing, the default should be overrideable. -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- David Cunningham, Voisonics http://voisonics.com/ USA: +1 213 221 1092 UK: +44 (0) 20 3298 1642 Australia: +61 (0) 2 8063 9019
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users