From 99eee5f5285710d77a3cd67bd9b199fb74a2566e Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 10 Sep 2012 18:25:02 -0500 Subject: [PATCH] Support rebooting some more ciscos --- src/mod/endpoints/mod_sofia/sofia_reg.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index ccc8a4c901..d710602107 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -580,7 +580,7 @@ void sofia_reg_send_reboot(sofia_profile_t *profile, const char *callid, const c { const char *event = "check-sync"; const char *contenttype = "application/simple-message-summary"; - const char *body = ""; + char *body = NULL; if (switch_stristr("snom", user_agent) || switch_stristr("yealink", user_agent)) { event = "check-sync;reboot=true"; @@ -588,9 +588,19 @@ void sofia_reg_send_reboot(sofia_profile_t *profile, const char *callid, const c event = "reboot_now"; } else if (switch_stristr("spa", user_agent)) { event = "reboot"; + } else if (switch_stristr("cisco", user_agent)) { + event = "service-control"; + contenttype = "text/plain"; + body = switch_mprintf("action=restart\n" + "RegisterCallId={%s}\n" + "ConfigVersionStamp={0000000000000000}\n" + "DialplanVersionStamp={0000000000000000}\n" + "SoftkeyVersionStamp={0000000000000000}", callid); } - sofia_glue_send_notify(profile, user, host, event, contenttype, body, contact, network_ip, callid); + sofia_glue_send_notify(profile, user, host, event, contenttype, body ? body : "", contact, network_ip, callid); + + switch_safe_free(body); } int sofia_sla_dialog_del_callback(void *pArg, int argc, char **argv, char **columnNames)