Koozali.org: home of the SME Server

Adding extensions quickly

Offline del

  • *
  • 765
  • +0/-0
Adding extensions quickly
« on: April 01, 2012, 11:25:07 AM »
Hi All,

Is there anyway in SAIL or from the command line I can add a lot of extensions quickly? Or do I need to do them one at a time? They would be general sip softphones.

Kind regards,
Del
« Last Edit: April 01, 2012, 11:31:54 AM by del »
If at first you don't succeed, then sky-diving is not for you!
"Life is like a coin. You can spend it anyway you wish, but you can only spend it once." --Author Unknown

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Adding extensions quickly
« Reply #1 on: April 02, 2012, 11:36:34 AM »
yes there is a bulk loader called csvload.pl.   It requires perl text/CSV which you can download and install from pbone or sailpbx.com...


Code: [Select]
wget http://www.sailpbx.com/sail/sail-3.1/perl-Text-CSV-1.12-1.el5.rf.noarch.rpm
rpm -Uvh perl-Text-CSV-1.12-1.el5.rf.noarch.rpm


You will find csvload.pl in /opt/sark/scripts.  Before you use it make sure you take a copy of your database (/opt/sark/db/sark.db).

usage is as follows

perl /opt/sark/scripts/csvload.pl csvfilename {dbfilename}

dbfilename is only necessary if you are working on a copy of sark.db - leave it blank to work on /opt/sark/db/sark.db.

Create a CSV file using your favourite spreadsheet tool.  The columns are as follows...

Code: [Select]
$macaddr      optional
$vendordevice             any valid device type (see below)
$pkey extension number or 'auto' to generate
$name  users callerid name
$ddi          associate a DDI with this extension (optional)
$location                    local/remote (default is local)
$cluster                     cluster (default is 'default')

At its simplest level you can create a spreadsheet with only three columns filled out; i.e. the device, key and the name. so a valid csv might look like this
Code: [Select]
,General SIP,auto,Alice
,General SIP,auto,Fred
,General SIP,auto,Dave
,General SIP,auto,Sue


This above would create 4 'General SIP' extensions and automatically allocate extension numbers to them.

Kind Regards

S



Allowed device types

Code: [Select]
Aastra 480i
Aastra 51i
Aastra 53i
Aastra 55i
Aastra 57i
Aastra 9112i
Aastra 9133i
Aastra VXT
AastraVXT
Cisco 7940
Cisco 7960
General SIP
Grandstream 10x
Grandstream GXP 2000
MAILBOX
Polycom IP320/330
Polycom VXT
SPA-1000
SPA-2000
SPA-2002
SPA-2102
SPA-3000FXS
SPA-3102FXS
SPA-841
SPA-901
SPA-921
SPA-922
SPA-941
SPA-942
SPA-962
SPA-PAP2T
Siemens C460IP
Siemens C470IP
Siemens S450IP
Snom 300
Snom 300 VXT
Snom 300 XML
Snom 320
Snom 320 VXT
Snom 320 XML
Snom 360
Snom 360 VXT
Snom 360 XML
Snom 370
Snom 370 VXT
Snom 370 XML
Snom 820
Snom 820 VXT
Snom 820 XML
Snom 870
Snom 870 VXT
Snom 870 XML
Snom VXT
Yealink T18
Yealink T20
Yealink T22
Yealink T26
Yealink T28
Yealink T2x
Yealink VXT
« Last Edit: April 02, 2012, 11:52:28 AM by SARK devs »

Offline del

  • *
  • 765
  • +0/-0
Re: Adding extensions quickly
« Reply #2 on: April 02, 2012, 12:13:37 PM »
Hi Selintra,

I'll download the script and give it a try, is there anyway I can choose the password (secret)? If not is there a way I can quickly view/list the passwords for all extensions?

Kind regards,
Del

If at first you don't succeed, then sky-diving is not for you!
"Life is like a coin. You can spend it anyway you wish, but you can only spend it once." --Author Unknown

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Adding extensions quickly
« Reply #3 on: April 02, 2012, 01:00:24 PM »
SARK generates a random 8 digit password automatically for each extension, I would strongly recommend you use them as they are but you can view/override them in the extension edit if you wish.  The loader won't override them.     

Kind Regards

S




Offline del

  • *
  • 765
  • +0/-0
Re: Adding extensions quickly
« Reply #4 on: April 02, 2012, 01:45:43 PM »
SARK generates a random 8 digit password automatically for each extension, I would strongly recommend you use them as they are but you can view/override them in the extension edit if you wish.  The loader won't override them.     

Kind Regards

S

I know what you are saying but I want to be able to keep a record of the passwords in a spreadsheet so I can provision the softphones without going through each extension to find the secret. Anyhow I have edited the csvloader.pl and have stopped it from generating the password and got it to allow me to put my own in the .csv file, I have used the same 8 digit format in my password generating tool and can copy and paste them into the .csv file all at once  8-)
Once again thank you for all your help.

Kind regards,
Del
If at first you don't succeed, then sky-diving is not for you!
"Life is like a coin. You can spend it anyway you wish, but you can only spend it once." --Author Unknown