cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2804
Views
5
Helpful
1
Replies

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

swati-singh
Level 1
Level 1

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

1 Reply 1

Jason Pfeifer
Cisco Employee
Cisco Employee

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

Review Cisco Networking for a $25 gift card