Jump to content

Can You Build A Trunk With Powershell ?


rick

Recommended Posts

Hi Rick,


 


this little script


 


  • creates a user
  • adds an internal number to that user
  • creates a trunk group
  • creates a trunk
  • defines a number range to the trunk
  • connects an external number with the internal number of above user

 




Import-Module IpPbx
Connect-IpPbx

$userEntry = New-IpPbxUser -UserName "Stefan"
Add-IpPbxUser -UserEntry $userEntry

$Number = New-IpPbxInternalNumber -InternalNumber "200"
Add-IpPbxInternalNumberToUser -InternalNumberEntry $Number -UserName "Stefan"

New-IpPbxTrunkGroup -TrunkGroupName "TestTrunkGroup1" -TrunkGroupType SIP | Add-IpPbxTrunkgroup
New-IpPbxTrunk -TrunkName "TestTrunk1" | Add-IpPbxTrunk -TrunkGroupName "TestTrunkGroup1"

$NumberRangeEntry = New-IpPbxTrunkNumberRange -CountryCode "49" -AreaCode "231" -SubscriberNumber "4666" -ExtensionStart "100" -ExtensionEnd "999"
Add-IpPbxTrunkNumberRange -TrunkName "TestTrunk1" -TrunkNumberRangeEntry $NumberRangeEntry

$Number = New-IpPbxPublicNumber -PublicNumber "+492314666200"
Add-IpPbxPublicNumber -PublicNumber $Number -InternalNumber "200"

Disconnect-IpPbx
Remove-Module IpPbx


Hope you get the information you need from this example.

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.