Showing posts with label vb. Show all posts
Showing posts with label vb. Show all posts

Thursday, July 15, 2010

Sip Configure Script

So I just wrote a program to create a batch of SIP entries for the Asterisk phone system. (see below) Basically every phone that is going to connect to the phone system through SIP needs an entry in this file. When you are creating a new phone system that has hundreds of phones, that can get a bit tedious. Therefore, I create a program.

Naturally if there are a lot of phones that belong in the same context (a set of programming rules that defines how a dialed number behaves) there will be significant redundancy. Which is why Asterisk supports templates. By declaring a template at the beginning of the file, each individual phone record only needs to indicate it is building off the template. The only new lines are the lines that indicate how it is different from the template.

This is only the beginning of my Asterisk VB fun. I plan to improve this more and create some other automatic generation files. It currently doesn't support SIP declarations that are not numbers (you can name a phone "Phil" and dial it that way too) or values with leading zeroes.