call.go 17 KB

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