09-06-2016 12:43 AM
Hi team! Need your help in fine tuning EEM.
025951 is registered to registrar1 and 036751 to registrar2
everything works fine...exept SIP registration 025951 could be dropped ... suddenly, without any reason
ssip - alias to "sh sip-ua register status"
ssip runs every 300 seconds to verify that 025951 is registered to Registrar-Index 1
i do not know which way is better and do not know HOW TO configure:
scenario1: If 025951 is dropped in Registrar-Index 1, then reload router.
scenario2: If 025951 is dropped in Registrar-Index 1,remove all SIP-UA config and configure againg.
I am appreciate for any help!
R2c2801#ssip
--------------------- Registrar-Index 1 ---------------------
Line peer expires(sec) registered P-Associ-URI
================================ ========== ============ ========== ============
025951 -1 40 yes
036751 -1 64 no
--------------------- Registrar-Index 2 ---------------------
Line peer expires(sec) registered P-Associ-URI
================================ ========== ============ ========== ============
025951 -1 94 no
036751 -1 35 yes
event manager environment i 1
event manager applet Check_SIP_registration
description applet to do a show run command to check SIP registration. If not registered, run "reload" router. Runs every 300 seconds.
event timer watchdog 300
action 100 cli command "en"
action 200 cli command "ssip"
action 250 foreach line "$_cli_result" "\n"
action 300 regexp "025951(.*) no " "$line"
action 400 if $_regexp_result eq "1"
action 450 if $i eq "1"
action 455 syslog priority critical msg "SIP account is not registered. Please check service."
action 500 mail server "10.10.10.10" to "tech@mycompany.com" from "cisco@mycompany.com" subject
"R2c2801: SIP registration is DOWN" body "SIP registration is DOWN on R2c2801. SIP account is not registered. Please check service."
action 600 cli command "conf t"
action 601 cli command "event manager environment i 0"
action 602 cli command "exit"
action 603 end
action 604 end
action 605 else
action 650 if $i eq "0"
action 651 mail server "10.10.10.10" to "tech@mycompany.com" from "cisco@mycompany.com" subject
"R2-c2801: SIP registration is back UP" body "SIP registration is back UP on R2c2801. Voice services are back online."
action 652 cli command "conf t"
action 653 cli command "event manager environment i 1"
action 654 cli command "exit"
action 700 end
action 800 end
action 900 end
09-06-2016 01:04 AM
sip-ua config
R2c2801#sh run | s sip-ua
sip-ua
credentials username 025951 password 7 xxxxxxx realm voip.voiceisp.com
credentials username 036751 password 7 xxxxxxx realm asterisk
authentication username 025951 password 7 xxxxxxx realm REGISTRAR
authentication username 036751 password 7 xxxxxxx realm asterisk
nat symmetric role passive
nat symmetric check-media-src
no remote-party-id
max-forwards 10
retry invite 3
retry response 3
retry bye 3
retry cancel 3
retry register 5
timers trying 1000
timers invite-wait-100 1000
registrar 1 dns:voip.voiceisp.com:9060 expires 3600
registrar 2 ipv4:10.10.10.1:9060 expires 3600
sip-server ipv4:10.10.10.2:9060
no suspend-resume
host-registrar
permit hostname dns:voip.voiceisp.com
09-09-2016 09:53 AM
I thought I replied to this already, but I guess CSC didn't take it. You don't need a lot of the complexity you have here. This applet should work for you to reload the device. If you'd rather reconfigure sip-ua, you can add the cli actions instead of the reload action.
event manager applet check-sip
event timer watchdog time 300
action 001 cli command "enable"
action 002 cli command "show sip-ua register status | begin Registrar-Index 1"
action 003 foreach line $_cli_result "\n"
action 004 regexp "^025951" $line
action 005 if $_regexp_result eq 1
action 006 regexp "025951.*no" $line
action 007 if $_regexp_result eq 1
action 008 reload
action 009 end
action 010 break
action 011 end
action 012 end
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide