Develop a module for Asterisk using either AGI or AMI that can either be initiated by calling the module when initiating a call or activated by a DTMF sequence during a call (the DTMF sequence must be sent to the module). The module will then perform a simple query to an external server and depending on the response to the query redirect the call to/through another Asterisk server.