zabbix-agent2/src/zabbix_server/alerter/alert_manager.c
/******************************************************************************
 *                                                                            *
 * Function: am_update_mediatypes                                             *
 *                                                                            *
 * Purpose: update cached media types                                         *
 *                                                                            *
 ******************************************************************************/
am_update_mediatypes

Purpose: update cached media types
am_update_mediatypes Purpose : update cached media types
static void	am_update_mediatypes(zbx_am_t *manager, zbx_ipc_message_t *message)
{
	zbx_am_db_mediatype_t	**mediatypes;
	int			mediatypes_num, i;
	zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __func__);
	zbx_alerter_deserialize_mediatypes(message->data, &mediatypes, &mediatypes_num);
	zabbix_log(LOG_LEVEL_DEBUG, "update %d media types", mediatypes_num);
	for (i = 0; i < mediatypes_num; i++)
	{
		zbx_am_db_mediatype_t	*mt = mediatypes[i];
		am_update_mediatype(manager, mt->mediatypeid, mt->type, mt->smtp_server, mt->smtp_helo, mt->smtp_email,
				mt->exec_path, mt->gsm_modem, mt->username, mt->passwd, mt->smtp_port, mt->smtp_security,
				mt->smtp_verify_peer, mt->smtp_verify_host, mt->smtp_authentication, mt->exec_params,
				mt->maxsessions, mt->maxattempts, mt->attempt_interval, mt->content_type,
				mt->script, mt->timeout, ZBX_AM_MEDIATYPE_FLAG_NONE);
		zbx_am_db_mediatype_clear(mt);
		zbx_free(mt);
	}
	zbx_free(mediatypes);
	zabbix_log(LOG_LEVEL_DEBUG, "End of %s()", __func__);
}
static void am_update_mediatypes ( zbx_am_t * manager , zbx_ipc_message_t * message ) { zbx_am_db_mediatype_t * * mediatypes ; int mediatypes_num , i ; zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ ) ; zbx_alerter_deserialize_mediatypes ( message -> data , & mediatypes , & mediatypes_num ) ; zabbix_log ( LOG_LEVEL_DEBUG , " " , mediatypes_num ) ; for ( i = 0 ; i < mediatypes_num ; i ++ ) { zbx_am_db_mediatype_t * mt = mediatypes [ i ] ; am_update_mediatype ( manager , mt -> mediatypeid , mt -> type , mt -> smtp_server , mt -> smtp_helo , mt -> smtp_email , mt -> exec_path , mt -> gsm_modem , mt -> username , mt -> passwd , mt -> smtp_port , mt -> smtp_security , mt -> smtp_verify_peer , mt -> smtp_verify_host , mt -> smtp_authentication , mt -> exec_params , mt -> maxsessions , mt -> maxattempts , mt -> attempt_interval , mt -> content_type , mt -> script , mt -> timeout , ZBX_AM_MEDIATYPE_FLAG_NONE ) ; zbx_am_db_mediatype_clear ( mt ) ; zbx_free ( mt ) ; } zbx_free ( mediatypes ) ; zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ ) ; }
Function: am_update_mediatypes                                             
                                                                            
 Purpose: update cached media types
Function : am_update_mediatypes Purpose : update cached media types