Active Unassigned DN’s – Updating with SQL

Update to a previous post

Disclaimer :

Provided as is – you break your box all on your own buddy!  Lab this first.

 The offending DNs can be queried using:

select n.dnorpattern from numplan n
left outer join devicenumplanmap m on m.fkdevice = n.pkid
where m.fkdevice is null
and n.tkpatternusage = ‘2’
and n.iscallable = ‘t’

  • m.fkdevice is null assures the Route Plan element is unassigned
  • tkpatternusage = ‘2’ matches DNs only
  • iscallable=’t’ defines the “Active” checkbox on the DN page – and our offending behaviour.

Some help came from here.

Construct your own UPDATE SQL statement to fix it!  As assistance – start here, it’s not too difficult.


Tagged , , , , , ,

2 thoughts on “Active Unassigned DN’s – Updating with SQL

  1. Nikhil says:

    I need to modify this script to change this header. Can any one pls help me on this.

    Remote-Party-ID “London Test” ;party=calling;screen=yes;privacy=off


    Remote-Party-ID “London Test” ;party=calling;screen=yes;privacy=full

    The script is

    M = {}
    function M.outbound_INVITE(msg)
    local fromtag = msg:getHeaderValueParameter(“From”, “tag”)
    local pai = msg:getHeader(“P-Asserted-Identity”)
    local uri = string.match(pai, “()”)
    local uri2 = string.match(pai, “()”)
    if uri or uri2
    msg:modifyHeader(“From”, “Anonymous “)
    msg:addHeaderValueParameter(“From”, “tag”, fromtag)
    msg:addHeader(“Privacy”, “id”)
    return M

    I tried applying below but it failed.

    function M.outbound_INVITE(msg)
    local remote = msg:getHeader(“Remote-Party-ID”)
    local privacy = string.find(remote, “off”)
    local target = string.sub(remote, privacy)
    local replace = string.gsub(target, “full”)
    msg:modifyHeader(“Remote-Party-ID”, replace)
    return M

    Can anyone pls help me on this?



  2. jonathan says:

    Hi Nikhil.

    Happy to help. Your post is a little confusing. Please can you confirm what exactly you need to change? Is it only the privacy setting in the RPID? Also, please confirm the call direction? Is this inbound to CUCM, or outbound on the SIP trunk?

    Also, why are you trying to use a normalization script for this – why not set privacy on the line or trunk?



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Collaboration Engineer

All things Technology - Posts to save for when you need them

Gerry Keleghan's Blog

A Blog about Cisco Unified Communications


my personal journey to ccie collaboration

Striving for greatness

Thoughts on DevOps, emerging tech, and open source

Network Experts Blog

“Knowledge comes by eyes always open and working hands.”

SIP Adventures

A unified communications blog by Andrew Prokop

The Cloverhound Blog

Cloverhound Employees Talk Unified Communications and Contact Center


Fog navigator. Get out of the clouds. Down to earth solutions. @Warcop

Cisco Collab Engineering Tips

Michael White - CCIE #26626


Photography by Manos,


Thoughts and experiences of a Cisco Collaboration engineer after clearing the CCIE lab...

The Daily Post

The Art and Craft of Blogging

The Blog

The latest news on and the WordPress community.

%d bloggers like this: