Add & Assign Line URI's or Phone Numbers to SfB (Lync) Account


Summary

This article provide a summary for on how to Add & Assign Line URI's or Phone Numbers to Skype4B\Lync Accounts.

Applies To

This article applies to MachPanel build v5.3.10 and above.

How to Add Phone Group or Line URI's?

  • To import Phone numbers for Skype4B\Lync account in  MachPanel, navigate to the following path:Home » Service Director » Skype4B Hosting » Call Settings.
  • Click on  Import Numbers button to import Phone numbers.

  • For new numbers input is required for this purpose. Select Country, Area/Region, Type are added to import Phone Numbers On Fly. CSV format is also updated to include these attributes:


  • For Existing Numbers, you can use following scripts as per your requirement:

Important Note: Prior to performing any update take backup of your MachPanel Database, Control Servers. See below KB article for more details on how to take backup. http://kb.machsol.com/Knowledgebase/Article/50248

Updating specific number:
UPDATE HB_tblLyncPhoneNumbers SET Country = 'Country_Id', Area = 'Area_Name', [Type] = 'DID'
WHERE Number = '+215789654'

Updating all numbers starting with some country code:
UPDATE HB_tblLyncPhoneNumbers SET Country = 'Country_Id', Area = 'Area_Name', [Type] = 'DID'
WHERE Number LIKE '+21%'

Updating all numbers in a phone group:
UPDATE HB_tblLyncPhoneNumbers SET Country = 'Country_Id', Area = 'Area_Name', [Type] = 'DID'
WHERE PhoneGroupId = 123
Note: Please change 'Country_Id', 'Area_Name' as per your panel.

  • Now, navigate to  Home » Service Director » Skype4B Hosting» Accounts » Manage Service. Select Phone Numbers tab. You will be able to see phone numbers for that customer account:

How to Add Phone Groups & assign Phone Numbers to users?

  • To assign line URI's to a particular Customer or Reseller, you have to assign DID's in Service plan as shown below:

  • If “Automatic Provisioning” is selected then at the time of provisioning for such Package/Addon, the mentioned DID Specification should be available to automatically assign such type of numbers with desired quantity
  • The Line URI extension option should be checked and "Enterprise Voice" policy in Telephony should be assigned for Line URI's, Private Line, Extensions etc.

  • Scripts to update existing/sold packages/addons DID specification:
Insert DIDSets for all Active packages

UPDATE PDL
SET PDL.DIDSets = CAST(C.CountryId AS NVARCHAR(20)) + '^' + C.City + '^' + 'DID' + '^' + PD.ResourceQuantity
FROM HB_tblPackagesDetail_Lync PDL
INNER JOIN HB_tblPackagesDetail PD ON PDL.PackageID = PD.PackageID
INNER JOIN HB_tblPackages P ON PD.PackageID = P.PackageID
INNER JOIN tblCustomers C ON P.CustomerID = C.CustomerID
WHERE CAST(PDL.DIDSets AS NVARCHAR(MAX)) = ''
AND PD.ResourceID = (SELECT ResourceID FROM HB_tblResources WHERE ResourceInternalID = 610)

Insert DIDSets for All Addons


UPDATE ADL
SET ADL.DIDSets = CAST(C.CountryId AS NVARCHAR(20)) + '^' + C.CompanyCity + '^' + 'DID' + '^' + AD.ResourceQuantity
FROM HB_tblAddonTypeDetail_Lync ADL
INNER JOIN HB_tblAddonTypeDetail AD ON ADL.AddonTypeId = AD.AddonTypeId
INNER JOIN HB_tblAddonTypes A ON AD.AddonTypeId = A.AddOnTypeId
INNER JOIN tblCompanies C ON A.CompanyId = C.CompanyID
WHERE CAST(ADL.DIDSets AS NVARCHAR(MAX)) = ''
AND AD.ResourceID = (SELECT ResourceID FROM HB_tblResources WHERE ResourceInternalID = 610)
GO

Insert DIDSets for All Sold Packages

UPDATE PSL
SET PSL.DIDSets = CAST(C.CountryId AS NVARCHAR(20)) + '^' + C.City + '^' + 'DID' + '^' + PSD.ResourceQuantity
FROM HB_tblPackagesSoldPolicies_Lync PSL
INNER JOIN HB_tblPackagesSoldDetail PSD ON PSL.SoldPackageID = PSD.SoldPackageID
INNER JOIN HB_tblOCSHosting OH ON PSD.SoldPackageID = OH.SoldPackageID
INNER JOIN tblCustomers C ON OH.CustomerID = C.CustomerID
WHERE CAST(PSL.DIDSets AS NVARCHAR(MAX)) = ''
AND [Status] = 1 AND IsCancelled = 0
AND PSD.ResourceID = (SELECT ResourceID FROM HB_tblResources WHERE ResourceInternalID = 610)

Insert DIDSets for All Sold Addons


UPDATE ASDL
SET ASDL.DIDSets = CAST(C.CountryId AS NVARCHAR(20)) + '^' + C.City + '^' + 'DID' + '^' + ASD.ResourceQuantity
FROM HB_tblAddonsSoldDetail_Lync ASDL
INNER JOIN HB_tblAddonsSoldDetail ASD ON ASDL.SoldAddonID = ASD.SoldAddonId
INNER JOIN HB_tblAddonsSold ADS ON ASD.SoldAddonID = ADS.SoldAddonID
INNER JOIN tblCustomers C ON ADS.CustomerID = C.CustomerID
WHERE CAST(DIDSets AS NVARCHAR(MAX)) = ''
AND [Status] = 1 AND IsCancelled = 0
AND ResourceID = (SELECT ResourceID FROM HB_tblResources WHERE ResourceInternalID = 610)
  • Now Create\Add a new Phone Group or Edit the existing one as shown below:

  • Now select Owner it could be the Host (Provider) or Your Reseller, Select Customer and assign numbers.

  • Navigate to the path: Home » Service Director » Skype4B Hosting » Accounts » Manage Service. Select Users tab and click on Add New User button.

  • Now you can select and assign existing line URI \ phone number from the drop down list. See the snapshot below: