chan-sccp / sccp_manager

SCCP Manager
21 stars 13 forks source link

Bulk import/export of extensions/phones #34

Open szenzero opened 3 years ago

szenzero commented 3 years ago

A feature Bulk Handler module provides for extensions/DISs/routes would be nice to have. The idea is to populate a csv file with required values (MAC, type, line, etc) and feed it to parser. Also, it should be able to export values in database back to csv.

samam9911 commented 2 years ago

that would be a great feature to have and very much needed

steve-lad commented 2 years ago

Bulk Handler functions with Sccp_Manager - these are FreePbx controlled parameters (Extensions, Routes, DIS).

Please be more specific on what you want to achieve (and why) .

szenzero commented 2 years ago

Hello, the idea is to have something similar to Cisco's BAT especially if you have multiple (50+/100+) phones/lines/extensions to add/modify. In theory, you could use FPBX Bulk Handler to insert routes/DIDs and then prepare SQL INSERTs to handle SCCPmanager part instead of clicking "submit" one by one but I think all-in-one solution would be more appropriate. I.e. to extend existing FPBX Bulk handler with SCCP_manager data or to use something that would handle SCCP_manager and then hook into FPBX BulkHandler...

steve-lad commented 2 years ago

This is still not clear to me, even if the concept is understood.

From a phone perspective, this would mean creating an error free csv/json with all parameters and then importing; mac addresses alone would be a pain going this route. Instead, using existing functionality, simply set site defaults, connect the phone(s) using hotline, and then for each phone, add a description (optional) and save and everything is done....

Please help me understand what I have missed

samam9911 commented 2 years ago

is there a wiki or more info on how to connect phones using hotline? Thanks!

steve-lad commented 2 years ago

Hotline is detailed in the Help (for Hotline) in Server Config->Devices tab. It is a security risk and should only be used on internal networks. Depending on subnet rules and size, it is fast to achieve a connection . You may need to set the phone TFTP address on your phone manually if it cannot find the tftp server (ie if you do not advertise by dhcp for that subnet).

Its the way that I convert from SIP to SCCP, and it works.

samam9911 commented 2 years ago

Thanks steve-lad! wish I knew this before I entered all my 70 cisco phones manually. It would have worked perfectly for my situation as I just replaced my dead cisco pbx with freepbx, same dhcp server, same tftp server, and phones already sccp.

steve-lad commented 2 years ago

Glad to have helped. Maybe you could write something up on the WiKi? BTW, it will be even faster in v16 :-)

steve-lad commented 2 years ago

This module already handles sccp_manager line (extension) data via export. I have tried a simple import, but there appears to be some issues with this module - it does a limited parse for the preview, and the data can neither be saved nor updated.

I suspect that the issue is that it tries to insert a primary key of 0 for the first row!

Let me know if it works for you and attach a sample csv (that works)

szenzero commented 2 years ago

Yeah, by using hotline, all of your phones will autoregister (if dhcp is setup correctly) but you'll still have to manually assign lines(extensions) to devices (one by one). An example use case would be if you wanted to migrate from Call manager deployment to Asterisk+SCCP. You could export data from CCM and get something like this (and much much more): image and then import it into SCCPM. Device name/MAC address is already there (copy-paste, no need to type it in), device type, extension number; add a DID and your setup is completed...

steve-lad commented 2 years ago

I think that this is the only use case - otherwise you will not have all of the mac addresses. Can you attach, after obfuscation or password protected) the output file that you refer (export from CCM) - I would like to see what data is available (ie line data (extensions have to exist) and button assignments (assuming multiple lines)

szenzero commented 2 years ago

Couldn't find any phone with multiple lines/DNs assigned, but there is one with speeddials. Book11.xlsx