call.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. package action
  2. import (
  3. "errors"
  4. "fmt"
  5. "pbx-api-gin/internal/app/stc/active"
  6. "pbx-api-gin/internal/app/stc/priority"
  7. alstatus "pbx-api-gin/internal/app/stc/sendstatus"
  8. "pbx-api-gin/pkg/lfshook"
  9. "pbx-api-gin/pkg/utils"
  10. "sort"
  11. "strings"
  12. "time"
  13. )
  14. var Pads = []string{"2413", "2414", "2415", "2421", "2422", "2423", "2424", "2425", "2431", "2432", "2433", "2434", "2435", "2441", "2442", "2443", "2444",
  15. "2445", "2451", "2452", "2453", "2454", "2455", "2461", "2462", "2463", "2464", "2465", "2471", "2472", "2473", "2474", "2475", "2481", "2482", "2483",
  16. "2484", "2485", "2411", "2412"}
  17. var Pacus = []string{"2111", "2121", "2131", "2141", "2151", "2161", "2171", "2181"}
  18. var Speakers = []string{"2111", "2121", "2131", "2141", "2151", "2161", "2171", "2181", "2311", "2381"}
  19. // Function triggered before no cab occupied signal interrupt
  20. func InActiveHangup() {
  21. if active.ActivedCab == "" {
  22. HangupTask("PA")
  23. HangupTask("CPA")
  24. HangupTask("VOL")
  25. HangupTask("PAD-OCC")
  26. }
  27. }
  28. // Hangup 挂断指定分机或通道
  29. func Hangup(channel string) {
  30. lfshook.NewLogger().Infof("hangup extensions/channel %s", channel)
  31. if !utils.IsChannel(channel) {
  32. channel = fmt.Sprintf(`/^(PJ)?SIP\/%s-.*$/`, channel)
  33. }
  34. action := map[string]string{
  35. "Action": "hangup",
  36. "Channel": channel,
  37. }
  38. lfshook.NewLogger().Infof("hangup action %+v", action)
  39. if _, _, err := AminInstance.Send(action); err != nil {
  40. lfshook.NewLogger().Errorf("Hangup %+v", err)
  41. }
  42. }
  43. // Hangup 挂断所有分机,除指定分机和PAD
  44. func HangupAllExcept(caller string) {
  45. //all PACU
  46. for _, ret := range Pacus {
  47. Hangup(ret)
  48. }
  49. switch caller {
  50. case "2311":
  51. Hangup("1411") //IO1
  52. Hangup("1481") //IO8
  53. //Hangup("2311") //ICP1
  54. Hangup("2381") //ICP8
  55. case "2381":
  56. Hangup("1411") //IO1
  57. Hangup("1481") //IO8
  58. Hangup("2311") //ICP1
  59. //Hangup("2381") //ICP8
  60. case "1411":
  61. //Hangup("1411") //IO1
  62. Hangup("1481") //IO8
  63. Hangup("2311") //ICP1
  64. Hangup("2381") //ICP8
  65. case "1481":
  66. Hangup("1411") //IO1
  67. //Hangup("1481") //IO8
  68. Hangup("2311") //ICP1
  69. Hangup("2381") //ICP8
  70. case "":
  71. Hangup("1411") //IO1
  72. Hangup("1481") //IO8
  73. Hangup("2311") //ICP1
  74. Hangup("2381") //ICP8
  75. }
  76. }
  77. // Hangup task
  78. func HangupTask(TaskName string) {
  79. taskInfo, ok := priority.RegistryTask.Get(TaskName)
  80. if ok {
  81. HangupAllLocalChan()
  82. ConfbridgeKick(taskInfo.ConfbridgeID, "all")
  83. Hangup(taskInfo.RunChannel)
  84. }
  85. }
  86. // interrupt the running task
  87. func InterruptRunningTask(toRunTask string) {
  88. var task priority.TaskInfo
  89. var taskName string
  90. var ok bool
  91. if toRunTask != "PA" && toRunTask != "PAD-ICP" && toRunTask != "PAD-TMS" { // ignore C2C
  92. taskName, task, ok = priority.RegistryTask.HighestPriorityRunningTask1()
  93. if !ok {
  94. return
  95. }
  96. } else { // have to check C2C
  97. taskName, task, ok = priority.RegistryTask.HighestPriorityRunningTask()
  98. if !ok {
  99. return
  100. }
  101. }
  102. lfshook.NewLogger().Infof("===InterruptRunningTask=toRuntask=%s==RunningTask:%s===chan:%s", toRunTask, taskName, task.RunChannel)
  103. //same type return
  104. if toRunTask == taskName {
  105. if toRunTask == "PAD-ICP" || toRunTask == "PAD-TMS" || toRunTask == "PAD-OCC" {
  106. if toRunTask == "PAD-OCC" {
  107. Hangup(task.RunChannel) //pad
  108. ConfbridgeKick(task.ConfbridgeID, "all")
  109. HangupIO() //io
  110. lfshook.NewLogger().Infof("===InterruptRunningTask=ret==== ")
  111. }
  112. return
  113. }
  114. }
  115. //pad all reset
  116. if toRunTask == "AlarmHoldResetAll" {
  117. HangupAllLocalChan()
  118. return
  119. }
  120. switch task.RunType {
  121. case "CPA":
  122. //kick CPA members
  123. CPAConfbridgeKick(task.ConfbridgeID)
  124. case "EMG":
  125. //kick EMG members
  126. EMGConfbridgeKick(task.ConfbridgeID)
  127. case "C2C": // Interrupt C2C task running,
  128. if toRunTask == "PA" || toRunTask == "PAD-ICP" || toRunTask == "PAD-TMS" {
  129. HangupICP()
  130. return
  131. }
  132. case "PAD-ICP", "PAD-TMS": // Interrupt PAD task running,
  133. priority.InterruptedPad = "PAD-ICP"
  134. lfshook.NewLogger().Infof("===InterruptRunningTask==hangup===PAD-ICP==%s==== ", task.RunType)
  135. chans, err := CoreShowChannels()
  136. if err != nil {
  137. lfshook.NewLogger().Errorf("CoreShowChannels %+v", err)
  138. }
  139. //1. Redirect the connected PAD to 0300,hangup the other pad channel
  140. for _, ret := range chans {
  141. // Redirect the connected PAD to 0300
  142. if utils.IsPAIU(ret.CallerIDNum) {
  143. if ret.ConnectedLineNum == "<unknown>" { //redirect pad chanspy channel
  144. err := Redirect(ret.Channel, "0300", "queues-icp-redirect", "", "PAD")
  145. if err != nil {
  146. lfshook.NewLogger().Errorf("Redirect %+v", err)
  147. }
  148. number := strings.Split(strings.Split(ret.Channel, "-")[0], "/")[1]
  149. active.NotifyPaiu(number, "hold")
  150. //HangupAllLocalChan()
  151. }
  152. }
  153. }
  154. for _, ret := range chans {
  155. //hangup pad call ICP channel
  156. if utils.IsPAIU(ret.CallerIDNum) {
  157. if utils.IsPAIU(ret.CallerIDNum) && ret.ChannelStateDesc == "Up" && utils.IsICP(ret.ConnectedLineNum) {
  158. lfshook.NewLogger().Infof("===Hangup=Chan===%+v==== ", ret.Channel)
  159. Hangup(ret.Channel)
  160. }
  161. }
  162. }
  163. priority.RegistryTask.StopAndUnregister("PAD-ICP")
  164. priority.RegistryTask.StopAndUnregister("PAD-TMS")
  165. //2. hangup task channel (ICP + PACU)
  166. lfshook.NewLogger().Infof("===InterruptRunningTask=2. hangup task channel === ")
  167. HangupAllLocalChan()
  168. HangupICP()
  169. //pad end
  170. if priority.PADStart == 1 {
  171. alstatus.PaStatus("", "PAD", "end")
  172. priority.PADStart = 0
  173. }
  174. case "PAD-OCC": // Interrupt PAD-OCC task running,
  175. if toRunTask == "C2C" {
  176. HangupICP()
  177. break
  178. } else {
  179. priority.InterruptedPad = "PAD-OCC"
  180. priority.OCCAnswer = 0
  181. resCaller, err := QueueStatus("0301", "") // check OCC queue, get entries
  182. if err != nil {
  183. lfshook.NewLogger().Infof("===QueueStatus==%+v", err)
  184. }
  185. for _, caller := range resCaller.Entrys {
  186. lfshook.NewLogger().Infof("===QueueStatus=entry=%+v", caller)
  187. time.Sleep(time.Millisecond * 50)
  188. RedirectInQueue(caller.CallerIDNum, "0300", "queues-icp-redirect", caller.CallerIDNum) // redirect All PAD redirect to ICP queue
  189. }
  190. priority.RegistryTask.StopAndUnregister("PAD-OCC")
  191. //2. Hangup connected PAD
  192. lfshook.NewLogger().Infof("===InterruptRunningTask=Hangup connected PAD=== ")
  193. Hangup(task.RunChannel)
  194. //3. Hangup OI & ICP
  195. HangupIO()
  196. HangupAllLocalChan()
  197. ConfbridgeKick(task.ConfbridgeID, "all")
  198. //occ pad end
  199. if priority.PADOccStart == 1 {
  200. alstatus.OccPad("end")
  201. priority.PADOccStart = 0
  202. }
  203. }
  204. default:
  205. lfshook.NewLogger().Infof("===InterruptRunningTask=default=== ")
  206. //if !strings.Contains(priority.RunningPATaskChan, "0502@default") {
  207. // Hangup(priority.RunningPATaskChan)
  208. //}
  209. Hangup(task.RunChannel)
  210. ConfbridgeKick(task.ConfbridgeID, "all")
  211. }
  212. }
  213. // Hangup all ICP
  214. func HangupICP() {
  215. Hangup("2311") //ICP1
  216. Hangup("2381") //ICP8
  217. }
  218. // Hangup all IO
  219. func HangupIO() {
  220. Hangup("1411") //IO1
  221. Hangup("1481") //IO8
  222. }
  223. // Hangup all PACU
  224. func HangupAllPACU() {
  225. //all PACU
  226. for _, ret := range Pacus {
  227. Hangup(ret)
  228. }
  229. }
  230. func HangupAllLocalChan() {
  231. chans, err := CoreShowChannels()
  232. if err != nil {
  233. lfshook.NewLogger().Errorf("CoreShowChannels %+v", err)
  234. }
  235. for _, ret := range chans {
  236. if strings.Contains(ret.Channel, "Local") && !strings.Contains(ret.Channel, "0502@default") {
  237. lfshook.NewLogger().Infof("HangupAllLocalChan=====hangup========= %+v", ret)
  238. Hangup(ret.Channel)
  239. }
  240. }
  241. }
  242. // Hangup all PACU
  243. func HangupAllPAD() {
  244. //all PAD
  245. for _, ret := range Pads {
  246. Hangup(ret)
  247. }
  248. }
  249. // Hangup all calls
  250. func HangupAll() {
  251. utils.ExecCmdAsync("/usr/sbin/asterisk", "-rx", "hangup request all")
  252. }
  253. // Dial 拨打号码
  254. func Dial(src, dst, dialrule, callerID, callerName string, callType string) {
  255. chanel := fmt.Sprintf("%s/%s@default", "Local", src)
  256. action := map[string]string{
  257. "Action": "Originate",
  258. "Channel": chanel,
  259. "Exten": dst,
  260. "Context": dialrule,
  261. "CallerID": fmt.Sprintf("%s<%s>", callerName, callerID),
  262. "Priority": "1",
  263. "Variable": fmt.Sprintf("CAB=%s", callType),
  264. "async": "true",
  265. }
  266. lfshook.NewLogger().Infof("dial action %+v", action)
  267. res, _, err := AminInstance.Send(action)
  268. if err != nil {
  269. lfshook.NewLogger().Errorf("%+v", err)
  270. }
  271. lfshook.NewLogger().Info(res)
  272. }
  273. // Dial 拨打号码
  274. func DialICP(src, dst, dialrule, callerID, callerName string) {
  275. chanel := fmt.Sprintf("%s/%s@call-icp", "Local", src)
  276. action := map[string]string{
  277. "Action": "Originate",
  278. "Channel": chanel,
  279. "Exten": dst,
  280. "Context": dialrule,
  281. "CallerID": fmt.Sprintf("%s<%s>", callerName, callerID),
  282. "Priority": "1",
  283. "Variable": fmt.Sprintf("CBID=%s", callerID),
  284. "async": "true",
  285. }
  286. lfshook.NewLogger().Infof("dial action %+v", action)
  287. res, _, err := AminInstance.Send(action)
  288. if err != nil {
  289. lfshook.NewLogger().Errorf("%+v", err)
  290. }
  291. lfshook.NewLogger().Info(res)
  292. }
  293. // 获取分机状态
  294. func ExtenStatus(exten string) (Status string) {
  295. action := map[string]string{
  296. "Action": "ExtensionState",
  297. "Exten": exten,
  298. "Context": "default",
  299. }
  300. res, _, err := AminInstance.Send(action)
  301. if err != nil {
  302. lfshook.NewLogger().Errorf("%+v", err)
  303. return ""
  304. }
  305. //lfshook.NewLogger().Infof("================ExtensionState:res %+v", res)
  306. return res["StatusText"]
  307. }
  308. // PACU ChanSpy
  309. func ChanSpy(src, dst string, whisper, bargein bool) {
  310. lfshook.NewLogger().Infof("chan spy src:%s dst:%s", src, dst)
  311. //channel := fmt.Sprintf("%s/%s", utils.DialPrefix, dst)
  312. channel := fmt.Sprintf("Local/%s@aio-rule", dst)
  313. data := fmt.Sprintf("%s/%s,qBE", utils.DialPrefix, src)
  314. /*
  315. if whisper {
  316. data = fmt.Sprintf("%s,w", data)
  317. }
  318. if bargein {
  319. data = fmt.Sprintf("%s,B", data)
  320. }
  321. */
  322. action := map[string]string{
  323. "Action": "Originate",
  324. "Channel": channel, // 不存在的通话
  325. "Application": "ChanSpy",
  326. "Data": data, // 存在的通话
  327. "CallerID": dst,
  328. "Async": "true",
  329. }
  330. lfshook.NewLogger().Infof("PACU ChanSpy action %+v", action)
  331. _, _, err := AminInstance.Send(action)
  332. if err != nil {
  333. lfshook.NewLogger().Errorf("%+v", err)
  334. }
  335. }
  336. // Redirect 转接
  337. func RedirectInQueue(channel, dst, dialrule, callerID string) (err error) {
  338. //callerID := "redirect"
  339. lfshook.NewLogger().Infof("redirect src %s to dst %s", channel, dst)
  340. if !utils.IsChannel(channel) {
  341. //callerID = channel
  342. if channel, err = GetChannelByExtenNotBridged(channel); err != nil {
  343. return err
  344. }
  345. }
  346. action := map[string]string{
  347. "Action": "Redirect",
  348. "Channel": channel,
  349. "Exten": dst,
  350. "Context": dialrule,
  351. "CallerID": callerID,
  352. "Priority": "1",
  353. "async": "true",
  354. }
  355. lfshook.NewLogger().Infof("redirect %+v", action)
  356. res, _, err := AminInstance.Send(action)
  357. if err != nil {
  358. lfshook.NewLogger().Error(err)
  359. }
  360. lfshook.NewLogger().Info(res)
  361. return err
  362. }
  363. // Redirect 转接
  364. func Redirect(channel, dst, dialrule, callerID, callerName string) (err error) {
  365. //callerID := "redirect"
  366. lfshook.NewLogger().Infof("redirect src %s to dst %s", channel, dst)
  367. if !utils.IsChannel(channel) {
  368. callerID = channel
  369. if channel, err = GetChannelByExten(channel); err != nil {
  370. return err
  371. }
  372. }
  373. action := map[string]string{
  374. "Action": "Redirect",
  375. "Channel": channel,
  376. "Exten": dst,
  377. "Context": dialrule,
  378. "CallerID": fmt.Sprintf("%s<%s>", callerName, callerID),
  379. "Priority": "1",
  380. "async": "true",
  381. }
  382. lfshook.NewLogger().Infof("redirect %+v", action)
  383. res, _, err := AminInstance.Send(action)
  384. if err != nil {
  385. lfshook.NewLogger().Error(err)
  386. }
  387. lfshook.NewLogger().Info(res)
  388. return err
  389. }
  390. func SetPadTimer() {
  391. toRunPadpriority := priority.GetPriorityByKey(priority.InterruptedPad) // 获取之前打断的报警优先级
  392. //toRunpriority := priority.GetPriorityByKey("PAD-ICP")
  393. _, taskTmp, ok := priority.RegistryTask.HighestPriorityRunningTask()
  394. if ok {
  395. lfshook.NewLogger().Infof("==SetPadTimer====runing:%d==toRun:%d=", taskTmp.Priority, toRunPadpriority)
  396. if taskTmp.Priority < toRunPadpriority { //higher priority task running ,do not set timer
  397. return
  398. }
  399. }
  400. res, err := QueueStatus("0300", "") // check OCC queue , if empty OCC-PAD start
  401. if err != nil {
  402. lfshook.NewLogger().Infof("===OCC-QueueStatus==%+v", err)
  403. return
  404. }
  405. if res.Calls != "0" {
  406. lfshook.NewLogger().Infof("==SetPadTimer==QueueTimer===1====")
  407. active.SetTimer = true
  408. active.QueueTimer = time.AfterFunc(30*time.Second, func() { // check the PAD 30s timeout
  409. res, err := QueueStatus("0301", "") // check OCC queue , if empty OCC-PAD start
  410. if err != nil {
  411. lfshook.NewLogger().Infof("===OCC-QueueStatus==%+v", err)
  412. return
  413. }
  414. if res.Calls == "0" { // OCC queue empty
  415. resCaller, err := QueueStatus("0300", "") // check ICP queue, get entries
  416. if err != nil {
  417. lfshook.NewLogger().Infof("==ICP=QueueStatus==%+v", err)
  418. return
  419. }
  420. sort.Slice(resCaller.Entrys, func(i, j int) bool {
  421. return resCaller.Entrys[i].Position < resCaller.Entrys[j].Position
  422. })
  423. for _, caller := range resCaller.Entrys {
  424. priority.ICPAnswer = 0
  425. //lfshook.NewLogger().Infof("====SetPadTimer==QueueTimer==2=")
  426. lfshook.NewLogger().Infof("==SetPadTimer==Redirect to 0301 entry:%s=Pos:%s==", caller.CallerIDNum, caller.Position)
  427. //order by pos
  428. RedirectInQueue(caller.CallerIDNum, "0301", "queues-occ", caller.CallerIDNum) // redirect All ICP-PAD redirect to OCC queue
  429. time.Sleep(time.Millisecond * 100) //200 ms delay
  430. }
  431. }
  432. })
  433. }
  434. }
  435. func ConfbridgeKick(confnum, channel string) (res map[string]string, err error) {
  436. action := map[string]string{
  437. "Action": "ConfbridgeKick",
  438. "Conference": confnum,
  439. "Channel": channel,
  440. }
  441. res, _, err = AminInstance.Send(action)
  442. if err != nil {
  443. return nil, err
  444. }
  445. lfshook.NewLogger().Infof("=======ConfbridgeKick==%+v", res)
  446. if res["Response"] != "Success" {
  447. return nil, errors.New(res["Message"])
  448. }
  449. return res, nil
  450. }
  451. func CPAConfbridgeKick(confnum string) (res map[string]string, err error) {
  452. lfshook.NewLogger().Infof("=======CPAConfbridgeKick==%s", confnum)
  453. chans, err := ConfbridgeList(confnum)
  454. if err != nil {
  455. return nil, errors.New(res["Message"])
  456. }
  457. for _, confChan := range chans {
  458. lfshook.NewLogger().Infof("======CPAConfbridgeKick==1=%+v", confChan)
  459. if !strings.Contains(confChan, "PJSIP/1481") {
  460. ConfbridgeKick(confnum, confChan)
  461. }
  462. }
  463. return res, nil
  464. }
  465. func CPAConfbridgeReinvite(confID string) {
  466. lfshook.NewLogger().Infof("=====CPAConfbridgeReinvite==")
  467. time.Sleep(time.Millisecond * 500)
  468. for _, ext := range Speakers {
  469. ConfbridgeReinvite(ext, "call-speakers-cpa", confID)
  470. }
  471. }
  472. func EMGConfbridgeKick(confnum string) (res map[string]string, err error) {
  473. lfshook.NewLogger().Infof("=====EMGConfbridgeKick==%s", confnum)
  474. chans, err := ConfbridgeList(confnum)
  475. if err != nil {
  476. return nil, errors.New(res["Message"])
  477. }
  478. for _, confChan := range chans {
  479. lfshook.NewLogger().Infof("====EMGConfbridgeKick==1=%+v", confChan)
  480. if !strings.Contains(confChan, "0502@default") {
  481. ConfbridgeKick(confnum, confChan)
  482. }
  483. }
  484. return res, nil
  485. }
  486. func EMGConfbridgeReinvite(confID string) {
  487. lfshook.NewLogger().Infof("=======EMGConfbridgeReinvite==")
  488. time.Sleep(time.Millisecond * 500)
  489. for _, ext := range Speakers {
  490. lfshook.NewLogger().Infof("====1===EMGConfbridgeReinvite==")
  491. ConfbridgeReinvite(ext, "call-speakers-emg", confID)
  492. }
  493. }
  494. func ConfbridgeList(confnum string) (chans []string, err error) {
  495. action := map[string]string{
  496. "Action": "ConfbridgeList",
  497. "Conference": confnum,
  498. }
  499. res, events, err := AminInstance.Send(action)
  500. if err != nil {
  501. return nil, err
  502. }
  503. lfshook.NewLogger().Infof("===ConfbridgeList=res=%+v", res)
  504. if res["Response"] == "Success" {
  505. for _, event := range events {
  506. if event.Data["Event"] == "ConfbridgeList" {
  507. //lfshook.NewLogger().Infof("=======ConfbridgeList==%+v", event)
  508. chans = append(chans, event.Data["Channel"])
  509. }
  510. }
  511. return chans, nil
  512. } else {
  513. return nil, errors.New(res["Message"])
  514. }
  515. }
  516. func ConfbridgeReinvite(src, context, confID string) {
  517. lfshook.NewLogger().Infof("========ConfbridgeReinvite=======ext:%s==conf:%s===========", src, confID)
  518. if ExtenStatus(src) != "Idle" {
  519. //lfshook.NewLogger().Infof("===============ext:%s==!Idle===========", src)
  520. return
  521. }
  522. chanel := fmt.Sprintf("Local/%s@%s", src, context)
  523. action := map[string]string{
  524. "Action": "Originate",
  525. "Channel": chanel,
  526. "Exten": "000",
  527. "Context": "confbridge-join",
  528. "CallerID": fmt.Sprintf("%s<%s>", "", ""),
  529. "Priority": "1",
  530. "Variable": fmt.Sprintf("CBID=%s", confID),
  531. "async": "true",
  532. }
  533. lfshook.NewLogger().Infof("dial action %+v", action)
  534. res, _, err := AminInstance.Send(action)
  535. if err != nil {
  536. lfshook.NewLogger().Errorf("%+v", err)
  537. }
  538. lfshook.NewLogger().Info(res)
  539. }
  540. func ICPConfbridgeReinvite(confID, paType string) {
  541. switch paType {
  542. case "PAD-OCC":
  543. go DialICP("8", "2311", "confbridge-join", confID, "1") //ICP1---call
  544. go DialICP("8", "2381", "confbridge-join", confID, "8") //ICP8---call
  545. case "CPA":
  546. go DialICP("2", "2311", "confbridge-join", confID, "1") //ICP1---call
  547. go DialICP("2", "2381", "confbridge-join", confID, "8") //ICP8---call
  548. case "EMG":
  549. go DialICP("3", "2311", "confbridge-join", confID, "1") //ICP1---call
  550. go DialICP("3", "2381", "confbridge-join", confID, "8") //ICP8---call
  551. case "SPC":
  552. go DialICP("6", "2311", "confbridge-join", confID, "1") //ICP1---call
  553. go DialICP("6", "2381", "confbridge-join", confID, "8") //ICP8---call
  554. case "STN":
  555. go DialICP("4", "2311", "confbridge-join", confID, "1") //ICP1---call
  556. go DialICP("4", "2381", "confbridge-join", confID, "8") //ICP8---call
  557. case "DCS":
  558. go DialICP("5", "2311", "confbridge-join", confID, "1") //ICP1---call
  559. go DialICP("5", "2381", "confbridge-join", confID, "8") //ICP8---call
  560. case "CHK":
  561. go DialICP("10", "2311", "confbridge-join", confID, "1") //ICP1---call
  562. go DialICP("10", "2381", "confbridge-join", confID, "8") //ICP8---call
  563. case "VOL":
  564. go DialICP("11", "2311", "confbridge-join", confID, "1") //ICP1---call
  565. go DialICP("11", "2381", "confbridge-join", confID, "8") //ICP8---call
  566. }
  567. }