What I do is run virtual interfaces on one box, and run multiple instances of atftpd inside xinetd, each one bound to a different IP and a different root directory. Thus, my file structure looks like this -
/home/phones/ /home/phones/cisco/ /home/phones/cisco/7960 (root directory for one of the atftpd instances) /home/phones/cisco/7961 (root directory for another atftpd instance) Then, with a little dhcpd.conf magic, you can easily point different sets of phones to different tftp servers, using pools that match on key Product ID (I think) strings. --Warren Selby On Fri, Oct 23, 2009 at 8:54 AM, Steve Edwards <[email protected]>wrote: > > Steve Edwards <[email protected]> writes: > > > >> atftpd can do PCRE substitutions to transform a requested file name > >> into something else. I've not used this facility, but I'm guessing you > >> could transform: > >> > >> SIPDefault.cnf -> cisco/SIPDefault.cnf > >> sip.cfg -> polycom/sip.cfg > >> spa841.cfg -> sipura/spa841.cfg > > > On Fri, 23 Oct 2009, Benny Amorsen wrote: > > > Cute, but all that accomplishes is renaming. I want to run a script > > which returns a different configuration based on the file name (and > > possibly the client IP address). Unfortunately there is also no > > UserAgent-header in TFTP... > > So, break out your H&S or your wallet :) > > How about adding an option to atftpd to enable "check the execute bit" on > the requested file. If the file has the execute bit, set the MAC, IP > Address, etc. as environment variables, exec the file, and return the > output to the requester? > > Then, you could write (for example) spa841.cfg as a shell script which > have access to the MAC, etc. and could run sed/replace/preprocessor/m4 and > create the "file" on the fly. > > -- > Thanks in advance, > ------------------------------------------------------------------------- > Steve Edwards [email protected] Voice: +1-760-468-3867 PST > Newline Fax: +1-760-731-3000 > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
_______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
