I needed to create 300 phones with 3 DNs each i.e a total of 900 DNs.
First I created 900 DNs using SQL.
Then I added 300 phones using SQL. Although I wanted to attach three DNS from the already created DNs to each phone, the SQL would only allow me to attach just one DN to each phone.
Now I need to attach the remaining two DNs to each phone. For that I have so far figured out that I need to add one row for attaching one DN to one phone, so I need to add 600 rows altogether to the table.
I need help with SQL statement to insert data into devicenumplanmap. Below is the example statement I am trying to use, but it throws up an error '115'..
run sql INSERT INTO devicenumplanmap (fkdevice,numplanindex,fknumplan,tkringsetting) VALUES ('1c586191-c8a2-1a80-0fdc-aa67e451f58e','2','ba818ed8-8688-4755-aeff-20162c0dacad','4');
I have retrieved the values of fkdevice and fknumplanindex by quering the device table and the numplan table.
any help please ? I do not want to do it manually.
Solved! Go to Solution.
After getting stuck with SQL, I did try to use CSV upload just for one phone to investigate but that too throws error when I put more than one DN on a phone. It works fine with just one DN. My device type is third party sip advanced. Attached is my CSV file, if you could spot any error please. For this file to work I have to remove the last four columns which relate to DN 2 and DN 3 and their partitions.
That's the least preferred way to do that task, has no validation and you could end up with orphaned entries or break something.
If you wanted to do this programatically, you should have used AXL. Otherwise, as advised, use BAT for that purpose.
Easiest way is to configure what you want manually, and then export that config to use as a sample.