[asterisk-users] Define an array of sip number in sip.conf

Zeeshan Zakaria zishanov at gmail.com
Fri Mar 19 09:19:54 CDT 2010


Good idea Leif.

On 2010-03-19 10:16 AM, "Leif Madsen" <leif.madsen at asteriskdocs.org> wrote:

Zeeshan Zakaria wrote:
> You'll have to type them all in manually. Or do what I did several
> times...
Using the script approach, you can generate many extensions with an #exec in
sip.conf which will then trigger a script (such as via PHP or whatever) and
whatever information you output via STDOUT will then be used when chan_sip
is
loaded.

Using a template will make what you need to output much easier.

Something like...

#!/usr/bin/php
<?php
$x=1000;
while ($x < 2000) {
       echo "[$x](my_template)\n";
$x++;
};
?>


Then define in sip.conf [my_template](!)

Then fill in whatever information you need for the extensions.

Then you can use
#exec make_extensions.php

Leif.

--

_____________________________________________________________________
-- Bandwidth and Colocation Pr...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100319/90ea6a9e/attachment.htm 


More information about the asterisk-users mailing list