Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Provision large numbers of phone 1

Status
Not open for further replies.

JazzWizzard

Technical User
Oct 28, 2019
67
CA
Hello guys,

Let's say I have a large amount of phones I want to deploy. Is there a way to bind an extension to a phone's MAC address to that when the phone boots up, it can download its config file and automatically register with its extension?

If we could import, say, a CSV file with extensions and corresponding MAC addresses, that would be a huge time saver!

Thanks!
 
If you've got later SIP phones, you can make the last line of your config "GET $MACADDR.txt" and make each MAC a named text file and have that text file be "SET EXTENSION 1234" and "SET PASSWORD 1234" or whatever.

It's in the 96x1 SIP release notes.
 
Do you have to create a txt file for every single phones, or 1 txt file can contain all the MAC and extension/passwords?
 
A text file for each MAC address. It contains the login name/password for the phone with that MAC address.
 
you could if you really wanted to, but it'd be easier with a lot of 2 line text files

IF $MACADDR = 001234ABCDEF go to FIRSTPHONE
IF $MACADDR = 004567ABCDEF go to SECONDPHONE
#FIRSTPHONE
Set extn 1234
set pw 1234
goto end
#SECONDPHONE
set ext 4567
set pw 4567
goto end
#END
 
I did something similar with Polycom SIP phones where each phone needed a [MAC].cfg file. A PowerShell script can be used to copy a template file then edit the appropriate fields. Here's how it would basically work:

Create the template file named "MACADDR.TXT"
Code:
SET FORCE_SIP_USERNAME = Extension
SET FORCE_SIP_PASSWORD = Password

We'll copy this to a new file for each MAC, then swap out "Extension" and "Password" with the correct information.

Create the list of MAC addresses, extensions, and passwords as a CSV file "MACLIST.CSV" with the first row as column headers used in the script. Keep the two Columns of "Extension" and "Password" as these will be used in the script.
Code:
MAC,OldExt,NewExt,OldPassword,NewPassword
004e234f812,Extension,12345,Password,12345
004e1f183b2,Extension,54321,Password,54321

Create a Script "MakeMACFiles.ps1"
Code:
Param (
    [String]$List = "MACList.csv",
    [String]$FilePath = "W:\",
    [String]$FileExt = ".txt",
    [String]$MacFile = ""
)
$ReplacementList = Import-Csv $List;
    foreach ($ReplacementItem in $ReplacementList)
    {
          $MACFile = $FilePath + $ReplacementItem.MAC + $FileExt
          Copy-Item MACADDR.txt $MACFile
          $Content = Get-Content $MACFile;
          $Content = $Content -Replace($ReplacementItem.OldExt, $ReplacementItem.NewExt)
          $Content = $Content -Replace($ReplacementItem.OldPassword, $ReplacementItem.NewPassword)
          Set-Content $MACFile -Value $Content
    }

The Script will process each line in the MACList.csv and copy the template "MACADDR.TXT" to W:\[MAC].txt, then swap out "Extension" and "Password" for the appropriate entries.

I haven't tested this specific script and I'm not 100% sure about the MACADDR.TXT file so you'll probably need to test with one or two before trying to create a hundred.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top