EEM script on Call manager express to automatically update the configuration of auto-registered phones

Unanswered Question
Jul 28th, 2012
User Badges:

Hi team,

I have a Call manager express router to which IP phones can register automatically.

The event (%IPPHONE-6-REGISTER: ephone-2:SEP0022191D02C0 IP: Socket:3 DeviceType:Phone has registered) will be there in syslog. So, based on this syslog message (pattern “IPPHONE-6-REGISTER”), the EEM should be triggered and it should enable video capability and extension mobility on that ephone i.e., excute the following commands:

ephone <the number of e-phone that is registered>


logout-profile 1

My question is, I want to get the number/tag of e-phone that is registered from the initial syslog message itself. The syslog message has the string ephone-2, so I want to extract “2” from the syslog message and use it in the command that I need to execute. Could you please let me know how I can do this?



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Jason Pfeifer Sat, 07/28/2012 - 06:34
User Badges:
  • Cisco Employee,


Here is an applet that pulls out the both the full name of the ephone device, and the related ephone number.

It uses a regular expression to grab information between the first set of : :.  Then extracts that information to grab the number after the hyphen.

event manager applet one

event syslog pattern "IPPHONE-6-REGISTER"

action 1   regexp ".*IPPHONE-6-REGISTER:([^:]*):.*" "$_syslog_msg" match id

action 2   puts "fullname is $id"

action 3   regexp ".*-([0-9]+)" "$id" match idnum

action 4   puts "number is $idnum"

In your message above the applet would create:

*Jul 28 13:46:19.793: %HA_EM-6-LOG: one: fullname is  ephone-2

*Jul 28 13:46:19.793: %HA_EM-6-LOG: one: number is 2



This Discussion

Related Content