/*
 * MG_SIGNOFF.pgc - mg 모듈 서비스 MG_SIGNOFF (one service = one file).
 * Split out of the former inline mg_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by mg_svr at tpsvrinit.
 */
#include "MG_SIGNOFF.h"

/* 18. MG_SIGNOFF - 채널 사인오프 (status=DOWN). */
void MG_SIGNOFF(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char chan[16];
    gets_(b, T_CHANNEL, chan, sizeof(chan)); if (chan[0] == 0) strcpy(chan, "CH01");
    if (mgdb_set_channel_status(chan, "DOWN") < 0) FAIL(b);
    sets_(b, T_STATUS, "DOWN");
    OK(b);
}
