We have 5 servers in a cluster with 96 DAHDI channels each and need to find a way to set the outbound callerid without having to write 96 individual config blocks in each of the chan_dahdi.conf files.
In addition to the sip trunk DID phone number each line also has a 5 digit number which we use internally. We have a mysql database of the person's name, DID, 5 digit ext, and server they're on, but does not include their DAHDI channel.
My thought is to use a macro that runs an agi script to query the db and set the callerid, but I'm not sure how to write the macro. If the caller is in the [homeoffice] context and the macro is in the [outboundsiptrunk] context, how do I extract the proper info needed to pass to the agi script?