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

Unanswered Question
Jul 28th, 2012

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:149.77.175.201 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>

video

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?

Regards,

Swati

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Average Rating: 5 (1 ratings)
jpfeifer Sat, 07/28/2012 - 06:34

Hello,

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

Thanks

Actions

Login or Register to take actions

This Discussion

Posted July 28, 2012 at 5:31 AM
Stats:
Replies:1 Avg. Rating:5
Views:1104 Votes:0
Shares:0

Related Content

Discussions Leaderboard