Friday, June 3, 2016

Sonus SBC Call Actions

I haven't found a place that explains the real life use case for this; so I thought I would write one for anyone that may search one day for how to do this.

I usually use this as a first step in the call flow, to manipulate the call before it gets to the routing stage.

As a simple example (don't want to get too complicated here). Let's say you want to mask certain caller IDs based on the "department" field in AD.

First thing, you need to setup the AD integration (lots of details on Google about how to do this), and make sure you synchronise (or otherwise leave it set to online) the AD attributes:

  • msRTCSIP-Line
  • department
Once you have got that working, you should create a manipulation table that will make the required changes to your call based on certain rules. In our case, it should check the "department" field and change the CallingNumber based on that.


Next an "Action" needs to be created to direct the call flow. In our example, we need to call to continue down its path regardless of the outcome.


This action will need to be used in an "Action Set" to modify the call flow. Again, in this case, we will allow the call to continue down the same path regardless. Quick gotcha here, the "Continue" option in the "Action Set" does not mean continue the call; it means continue the processing of the rules, so if you put "Continue" the call will fail...


Finally, you need to apply this "Action Set" to a signalling group for it to take affect. In our case, we will apply it to the "To/From SfB" so that it will be intercepted before the call is made out to the PSTN...


Wednesday, May 25, 2016

Last Login Timestamp

Ok ... here is one that I have used with some of my customers to clean up their user database ...

This script will go through a pool or all the pools in the deployment and check the last login timestamp for all the users that have logged in to each of the member servers (or SBAs).

You can use the -Unique switch to get only the latest login or drop the switch to get all timestamps available in the deployment.

You have also the option of producing the results in a Grid format, or a CSV file. Alternatively, do not specify any output format, and the result will be an array of objects that you can use to pipe into other commands.

If you get an error reading from the SQL database, you might not have access to that server's RTCLocal database; or you may need to open the correct ports (check out the infamous Get-CsConnections.ps1 script by Pat Richard on how to do that).

Hope this helps, and as always your feedback is highly appreciated.

Download
v.0.01 - 2016-05-25 - Get-CsUserLastLogin.v.0.01.zip

Wednesday, January 13, 2016

New Year ... New Holiday Lists

Since its the new year, and everyone is updating their RGS holiday lists, I thought I would contribute with a quick one-liner to help all those who want to quickly view which RGS groups have what holiday lists (you would think Microsoft would make that easier for you).

$Workflows = get-CsRGSWorkflow
$Holidays = @()

foreach($Workflow in $Workflows){

   $List = @($Workflow.HolidaySetIDList)
   $S = ""
   if ($List){
     $S = [string]::Join(", ",($List |%{$Holiday = $_;Get-CsRgsHolidaySet -ShowAll|?{$_.Identity -match $Holiday.InstanceId}}).Name)
   }
   $Workflow |Add-Member "HolidaySet" $S
   $Holidays += $Workflow |Select-Object Name,LineURI,Language,TimeZone,HolidaySet
}

return $Holidays

Wednesday, September 30, 2015

Changing the primary SIP domain

Recently I came across a situation where it was necessary to change the primary SIP domain for a Lync 2013 customer (although this will work for any Lync or Skype for Business deployment). This is not a very difficult process but there are a few gotchas which I would like to share...

  1. Make sure that you change the SIP address for all your users after making the change to the new SIP domain
  2. Make sure you run the bootstrap after you have made the change on all servers
  3. Make sure you modify all your RGS workflows to use the new SIP domain
  4. Finally, and the hardest one (because its not documented anywhere); you will need to manually edit the application contacts using ADSIEdit.exe to use the new SIP domain

 Changing the Application Contacts

First open ADSIEdit and go to the configuration node, and navigate to the Application Contacts folder:



 Once there, open each entry and modify the msRTCSIP-PrimaryUserAddress and Proxy address to use the new SIP domain:



Don't forget to restart the services that you have changed !!

Monday, September 7, 2015

Lync/SfB Disabled your AD Disabled Users

I have noticed this with many customers I have visited. Their off-boarding process usually misses disabling the user from Lync/SfB.

The end result is that users being disabled in AD are still active and visible in Lync/SfB; this also has licensing implications, especially with today's O365 licensing and auditing. Add to that, the DID number assigned to the user will still be in use and will not be freed up.

I came up with this script that will quickly go through the AD/SfB environment and spit-out (or also disable) all users that are already disabled in AD.

Download
v.0.01 - 2015-09-06 - Get-CsDisabledUsers.v.0.01.zip
v.0.02 - 2016-05-17 - Get-CsDisabledUsers.v.0.02.zip

Wednesday, July 22, 2015

Lync QoS Script

QoS has always been a hot discussion on the table when implementing Lync/SfB ... especially when you have voice traffic to deal with.

There are many great blogs out there that discuss the QoS settings and ports to use, and how to set them up; my favourite is this post by Jeff Schertz which inspired me to write this script.

This is a very simple scripts which I believe picks up where the above post left off; it will read the ports from the current environment, and create the GPO policies required for both servers and clients automatically (provided it has access to the AD environment).

Please run this script with administrative privileges, using a Domain Admin account.

Download
v.0.01 - 2015-03-16 - Create-QoS-Policy.v.0.01.zip
v.0.02 - 2017-01-31 - Create-QoS-Policy.v.0.02.zip


Monday, May 4, 2015

Lync Mirroring Status Disconnected

Ok, this is a very quick one that caught me by surprise. At one of our customers; changes to the Lync settings were not taking affect. Checking the replication status, I found that replication was down for over 10 days. Running "Get-CsManagementStoreReplicationStatus" I found ...

This immediately pointed me to the SQL servers. When I checked the servers, I found the primary server was completely down. The mirror server had taken over as the principle, but apparently, Lync wasn't talking to it :( ... Checking the mirroring status "Get-CsDatabaseMirrorState" confirmed this limbo state ...
Looking at the SQL Managment Studio on both servers; I found that both servers were showing the databases as "Principle"; while the failed server was showing "Principle, Disconnected / In Recovery"; the mirror server was showing "Principle, Disconnceted"

Solution

After a bit of research and asking around; I came to this article, which helped resolve the issue. I have summarized the steps below, so that it is easier for anyone searching for this in the future...
  1. Connect to Mirror DB server
  2. Click on "New Query..."
  3. type the command "alter endpoint mirroring_endpoint state=stopped"
  4. Press the button "Execute"
  5. Wait until the command completes, at this point you have disabled the replication between the servers.
  6. Execute the command "alter endpoint mirroring_endpoint state=started"
  7. This will re-start the mirroring process, and this time, the database server will see the primary server as up, and will start replicating back to it the information that it lost.

At this point you have two options, of either leaving the second SQL server as the principle, and the original one as the Mirror, or you can failover the Databses back to the original state. In both cases, Lync doesn't mind, and doesn't care.