//Send
the
configuration
if
(switch_event_create(&event, SWITCH_EVENT_SEND_MESSAGE)
== SWITCH_STATUS_SUCCESS)
{
switch_event_add_header_string(event,
SWITCH_STACK_BOTTOM,
"user",user);
switch_event_add_header_string(event,
SWITCH_STACK_BOTTOM,
"host","10.0.0.23");
switch_event_add_header_string(event,
SWITCH_STACK_BOTTOM,
"profile","internal");
switch_event_add_header_string(event,
SWITCH_STACK_BOTTOM,
"Subject","buttons");
returnValue
= switch_event_add_header_string(event,
SWITCH_STACK_BOTTOM,
"Event","snom-settings");
switch_event_add_header_string(event,
SWITCH_STACK_BOTTOM,
"Content-Type",
"application/xml");
switch_event_add_body(event,
"<settings>"
"<phone-settings>"
.
.
<snip>
.
.
"</settings>");
switch_event_fire(&event);
if(
returnValue != SWITCH_STATUS_SUCCESS
)
switch_log_printf(
SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
"(%s)
Failed to set Event header for user %s.\n",
__FUNCTION__, user );
else
switch_log_printf(
SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
"(%s)
Succeeded to set Event header for user %s.\n",
__FUNCTION__, user );