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

EEM Script Activated by a Button on an IP Phone?

Scott_Barns_2
Level 1
Level 1

I'm trying to provide one of our customers a single button for the front office staff to manually send all calls to the auto attendant. I already wrote a script that would do this automatically based on a cron timer. Subsequently, the customer had a requirement to manually toggle this setting as well.

I thought maybe I could trigger a script to run based on a certain dial peer going active or something of that nature. Then I could just program a speed dial to hit that dial peer. Actually, I would need to run two scripts; one that forwards all calls to the auto attendant and another that routes calls to the phones in the front office. I don't think this could be done on a single button unless there is a way to alternate between the two scripts based on the same event.

Anyone have any ideas to make this happen? I am not opposed to using the native features of the CUCME/CUE to accomplish this task, but I haven't figured out how to do that at this point. I'm sure it could be scripted in CUE to do what I want, but I wanted to look into using an EEM script in parallel with learning to write more advanced scripts in CUE.

Here are my original scripts:

event manager applet NIGHT-MODE-ON

event timer cron name NIGHT-MODE-ON cron-entry "0 16 * * 1-5"

action 1.0 cli command "en"

action 1.1 cli command "conf t"

action 1.2 cli command "ephone-dn 100 octo-line"

action 1.3 cli command "call-forward all 7001"

action 1.4 cli command "ephone-dn 101 octo-line"

action 1.5 cli command "call-forward all 7001"

action 1.6 cli command "ephone-dn 102 octo-line"

action 1.7 cli command "call-forward all 7001"

action 1.8 cli command "ephone-dn 103 octo-line"

action 1.9 cli command "call-forward all 7001"

action 2.0 cli command "ephone-dn 104 octo-line"

action 2.1 cli command "call-forward all 7001"

action 2.2 cli command "telephony-service"

action 2.3 cli command "system message NIGHT MODE ACTIVE"

action 2.4 cli command "end"

action 2.5 cli command "wr"

event manager applet NIGHT-MODE-OFF

event timer cron name NIGHT-MODE-OFF cron-entry "30 7 * * 1-5"

action 1.0 cli command "enable"

action 1.1 cli command "config t"

action 1.2 cli command "ephone-dn 100 octo-line"

action 1.3 cli command "no call-forward all 7001"

action 1.4 cli command "ephone-dn 101 octo-line"

action 1.5 cli command "no call-forward all 7001"

action 1.6 cli command "ephone-dn 102 octo-line"

action 1.7 cli command "no call-forward all 7001"

action 1.8 cli command "ephone-dn 103 octo-line"

action 1.9 cli command "no call-forward all 7001"

action 2.0 cli command "ephone-dn 104 octo-line"

action 2.1 cli command "no call-forward all 7001"

action 2.2 cli command "telephony-service"

action 2.3 cli command "system message CUCME"

action 2.4 cli command "end"

action 2.5 cli command "wr"

event manager applet WEEKEND-MODE-ON

event timer cron name WEEKEND-MODE-ON cron-entry "0 16 * * 5"

action 1.0 cli command "enable"

action 1.1 cli command "config t"

action 1.2 cli command "telephony-service"

action 1.3 cli command "system message WEEKEND MODE ACTIVE"

action 1.4 cli command "end"

action 1.5 cli command "wr"

Thanks in advance for any help you can provide.

Scott

2 Accepted Solutions

Accepted Solutions

agensler
Cisco Employee
Cisco Employee

Hi Scott,

This is a clever idea but I don't think you need to go this route to accomplish what you want. CME has built-in night-service functionality that I believe should accomplish what you're looking to do. Information on the feature is located here:

Night-service:

http://www.cisco.com/en/US/customer/docs/voice_ip_comm/cucme/admin/configuration/guide/cmecover.html#wp1097582

Configuring Night-Service:

http://www.cisco.com/en/US/customer/docs/voice_ip_comm/cucme/admin/configuration/guide/cmecover.html#wp1196286

Basically, this will define two things:

1. The hours during which the system will automatically go into night-service mode. This should accomplish the same thing you are doing with your cron scripts right now.

2. You can configure a "night-service code" under telephony-service which can manually dialed from a phone to toggle night-service on and off. It's not a single button, but its pretty close.

Lastly, on the DNs you are forwarding, you will want to configure "call-forward night-service" so they redirect to the number you're current changing it to with the cron script above.

Hope that helps.

Best regards,

Adam

View solution in original post

Scott,

You're welcome. To answer your questions:

1. night-service is a global configuration. Toggling it on one phone should toggle it for the entire system.

2. The behavior should apply to all phones that share the DN.

3. The burst ring was the original implementation of night-service, where the calls rang on a different phone. Call-forward night service was added in a subsequent release. I do not believe that phones with Call-forward night service will do a burst ring. However, I don't have phones nearby that I can with at the moment. I'd recommend trying it to confirm.

Best regards,

Adam

View solution in original post

5 Replies 5

agensler
Cisco Employee
Cisco Employee

Hi Scott,

This is a clever idea but I don't think you need to go this route to accomplish what you want. CME has built-in night-service functionality that I believe should accomplish what you're looking to do. Information on the feature is located here:

Night-service:

http://www.cisco.com/en/US/customer/docs/voice_ip_comm/cucme/admin/configuration/guide/cmecover.html#wp1097582

Configuring Night-Service:

http://www.cisco.com/en/US/customer/docs/voice_ip_comm/cucme/admin/configuration/guide/cmecover.html#wp1196286

Basically, this will define two things:

1. The hours during which the system will automatically go into night-service mode. This should accomplish the same thing you are doing with your cron scripts right now.

2. You can configure a "night-service code" under telephony-service which can manually dialed from a phone to toggle night-service on and off. It's not a single button, but its pretty close.

Lastly, on the DNs you are forwarding, you will want to configure "call-forward night-service" so they redirect to the number you're current changing it to with the cron script above.

Hope that helps.

Best regards,

Adam

Hi Adam,

Thanks for your detailed response. I toyed with the night service configuration and have done some research on it, but never used it. So I have a few questions regarding its use:

1 - If I toggle night service on from any night service enabled phone, will all DN's on that device that are configured      with the call-forward night service DN number then forward immediately, only providing the burst tone when a      call comes in?

2 - Also, if these same DN's are shared on multiple phones, will the same behavior apply across all phones?

3 - Is there a way to disable the burst tone on any or all of the phones?

I haven't had a chance to try any of this in my lab.

Thanks again for your help.

Scott

Scott,

You're welcome. To answer your questions:

1. night-service is a global configuration. Toggling it on one phone should toggle it for the entire system.

2. The behavior should apply to all phones that share the DN.

3. The burst ring was the original implementation of night-service, where the calls rang on a different phone. Call-forward night service was added in a subsequent release. I do not believe that phones with Call-forward night service will do a burst ring. However, I don't have phones nearby that I can with at the moment. I'd recommend trying it to confirm.

Best regards,

Adam

I had the opportunity to try this in my lab yesterday and although Cisco's configuration guide didn't provide the proper information to make it work, I was able to make it work with your help. As it turns out, it was exactly what I was looking for in this implementation.

Thanks again for your help Adam.

Scott

Scott,

I'm glad to hear it worked for you. Thanks for replying.

Best regards,

Adam

Review Cisco Networking for a $25 gift card