123456789101112131415161718192021222324252627282930313233343536373839 |
- package asterisk
- import (
- "net/http"
- "pbx-api-gin/api/model"
- "pbx-api-gin/internal/app/ami"
- "pbx-api-gin/internal/app/ami/action"
- "github.com/gin-gonic/gin"
- )
- // @tags Asterisk-Channel
- // @Summary 当前通话通道
- // @Description 当前通话通道
- // @Security ApiKeyAuth
- // @Accept json
- // @Produce json
- // @Success 200 {object} model.APIOK "请求成功"
- // @Router /ginapi/plugin-asterisk/channel/show-channels [get]
- func showChannels(ctx *gin.Context) {
- data, err := action.CoreShowChannels()
- if err != nil {
- ctx.JSON(http.StatusBadRequest, model.APIError{ErrorMessage: err.Error()})
- return
- }
- ctx.JSON(http.StatusOK, model.APIOK{Message: "ok", Data: data})
- }
- // @tags Asterisk-Channel
- // @Summary 当前 Bridge 通道
- // @Description 当前 Bridge 通道
- // @Security ApiKeyAuth
- // @Accept json
- // @Produce json
- // @Success 200 {object} model.APIOK "请求成功"
- // @Router /ginapi/plugin-asterisk/channel/show-bridge-channels [get]
- func showBridgeChannels(ctx *gin.Context) {
- ctx.JSON(http.StatusOK, model.APIOK{Message: "ok", Data: ami.GetBridgeMapValue()})
- }
|