• Freeswitch API调用方式


    1.API调用方式

    可以复制下面内容成.bat文件直接在windows下运行,修改成对应的ip加端口。

    1. @echo off
    2. SETLOCAL
    3. :_starting
    4. cls
    5. set input=
    6. echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    7. echo @ 1 add agent 21009 @@ 11 uuid_check 21009 @@ 21 list users @@ 31 check modules @@ 41 add agent 21010 @
    8. echo @ 2 register DN1000 @@ 12 show channels as xml@@ 22 make a call @@ 32 sched_transfer @@ 42 register DN1003 @
    9. echo @ 3 login agent 21009 @@ 13 show channels as json@ 23 fifo operation @@ 33 uuid_setvar @@ 43 login agent 21010 @
    10. echo @ 4 queue_support monitor@@ 14 uuid_kill @@ 24 show calls @@ 34 uuid_getvar @@ 44 other @
    11. echo @ 5 ready agent 21009 @@ 15 notReady agent 21009@@ 25 show outbounding @@ 35 answer a dn @@ 45 ready agent 21010 @
    12. echo @ 6 logout agent 21009 @@ 16 global_getvar @@ 26 myprofile @@ 36 21009LogoutFromTier @@ 46 logout agent 21010 @
    13. echo @ 7 tier support @@ 17 extension list @@ 27 gateway list @@ 37 tier list json_api @@ 47 other @
    14. echo @ 8 agent list @@ 18 del agent 1000 @@ 28 lua_helloworld @@ 38 agent list json_api @@ 48 other @
    15. echo @ 9 queue list @@ 19 shutdown FS @@ 29 fs status @@ 39 memberList json_api @@ 49 DN status @
    16. echo @ 0 quit @@ 20 other @@ 30 show Dialplan @@ 40 hold a dn @@ 50 eavesdrop uuid @
    17. echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    18. @echo off
    19. set /p input=Press:
    20. if "%input%" == "0" goto :EOFd
    21. if /I "%input%" == "1" goto _cmd1
    22. if /I "%input%" == "2" goto _cmd2
    23. if /I "%input%" == "3" goto _cmd3
    24. if /I "%input%" == "4" goto _cmd4
    25. if /I "%input%" == "5" goto _cmd5
    26. if /I "%input%" == "6" goto _cmd6
    27. if /I "%input%" == "7" goto _cmd7
    28. if /I "%input%" == "8" goto _cmd8
    29. if /I "%input%" == "9" goto _cmd9
    30. if /I "%input%" == "11" goto _cmd11
    31. if /I "%input%" == "12" goto _cmd12
    32. if /I "%input%" == "13" goto _cmd13
    33. if /I "%input%" == "14" goto _cmd14
    34. if /I "%input%" == "15" goto _cmd15
    35. if /I "%input%" == "16" goto _cmd16
    36. if /I "%input%" == "17" goto _cmd17
    37. if /I "%input%" == "18" goto _cmd18
    38. if /I "%input%" == "19" goto _cmd19
    39. if /I "%input%" == "20" goto _cmd20
    40. if /I "%input%" == "21" goto _cmd21
    41. if /I "%input%" == "22" goto _cmd22
    42. if /I "%input%" == "24" goto _cmd24
    43. if /I "%input%" == "25" goto _cmd25
    44. if /I "%input%" == "26" goto _cmd26
    45. if /I "%input%" == "27" goto _cmd27
    46. if /I "%input%" == "28" goto _cmd28
    47. if /I "%input%" == "29" goto _cmd29
    48. if /I "%input%" == "30" goto _cmd30
    49. if /I "%input%" == "31" goto _cmd31
    50. if /I "%input%" == "32" goto _cmd32
    51. if /I "%input%" == "33" goto _cmd33
    52. if /I "%input%" == "34" goto _cmd34
    53. if /I "%input%" == "35" goto _cmd35
    54. if /I "%input%" == "36" goto _cmd36
    55. if /I "%input%" == "37" goto _cmd37
    56. if /I "%input%" == "38" goto _cmd38
    57. if /I "%input%" == "39" goto _cmd39
    58. if /I "%input%" == "40" goto _cmd40
    59. if /I "%input%" == "41" goto _cmd41
    60. if /I "%input%" == "42" goto _cmd42
    61. if /I "%input%" == "43" goto _cmd43
    62. if /I "%input%" == "45" goto _cmd45
    63. if /I "%input%" == "46" goto _cmd46
    64. if /I "%input%" == "49" goto _cmd49
    65. if /I "%input%" == "50" goto _cmd50
    66. :_cmd1
    67. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20add%%2021009%%40default%%20callback" http://192.168.5.97:8080/webapi/callcenter_config
    68. pause
    69. goto _starting
    70. :_cmd2
    71. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20set%%20contact%%2021009%%40default%%20user%%2F1000" http://192.168.5.97:8080/webapi/callcenter_config
    72. pause
    73. goto _starting
    74. :_cmd3
    75. curl -s -S -G -X GET --user freeswitch:works --data "tier%%20add%%20support%%40default%%2021009%%40default%%201%%201" http://192.168.5.97:8080/webapi/callcenter_config
    76. pause
    77. goto _starting
    78. :_cmd4
    79. curl -s -S -G -X GET --user freeswitch:works --data "queue%%20list%%20members%%20support%%40default" http://192.168.5.97:8080/webapi/callcenter_config
    80. pause
    81. goto _starting
    82. :_cmd5
    83. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20set%%20status%%2021009%%40default%%20'Available'" http://192.168.5.97:8080/webapi/callcenter_config
    84. pause
    85. goto _starting
    86. :_cmd6
    87. curl -s -S -G -X GET -v --user freeswitch:works --data "agent%%20set%%20status%%2021009%%40default%%20%%27Logged%%20Out%%27" http://192.168.5.97:8080/webapi/callcenter_config
    88. pause
    89. goto _starting
    90. :_cmd7
    91. curl -s -S -G -X GET --user freeswitch:works --data "tier%%20list" http://192.168.5.97:8080/webapi/callcenter_config
    92. pause
    93. goto _starting
    94. :_cmd8
    95. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20list" http://192.168.5.97:8080/webapi/callcenter_config
    96. pause
    97. goto _starting
    98. :_cmd9
    99. curl -s -S -G -X GET --user freeswitch:works --data "queue%%20list" http://192.168.5.97:8080/webapi/callcenter_config
    100. pause
    101. goto _starting
    102. :_cmd11
    103. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20get%%20uuid%%2021009%%40default" http://192.168.5.97:8080/webapi/callcenter_config
    104. echo.
    105. pause
    106. goto _starting
    107. :_cmd12
    108. curl -s -S -G -X GET --user freeswitch:works --data "channels" http://192.168.5.97:8080/webapi/show
    109. pause
    110. goto _starting
    111. :_cmd13
    112. curl -s -S -G -X GET --user freeswitch:works --data "channels%%20as%%20json" http://192.168.5.97:8080/webapi/show
    113. pause
    114. goto _starting
    115. :_cmd14
    116. set uuid=
    117. set /p uuid=UUID input here:
    118. curl -s -S -G -X GET --user freeswitch:works --data "%uuid%" http://192.168.5.97:8080/webapi/uuid_kill
    119. pause
    120. goto _starting
    121. :_cmd15
    122. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20set%%20status%%2021009%%40default%%20'On%%20Break'" http://192.168.5.97:8080/webapi/callcenter_config
    123. pause
    124. goto _starting
    125. :_cmd16
    126. curl -s -S -G -X GET --user freeswitch:works http://192.168.5.97:8080/webapi/global_getvar
    127. pause
    128. goto _starting
    129. :_cmd17
    130. curl -s -S -G -X GET --user freeswitch:works --data "status%%20profile%%20internal%%20reg" http://192.168.5.97:8080/webapi/sofia
    131. pause
    132. goto _starting
    133. :_cmd18
    134. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20del%%201000%%40default" http://192.168.5.97:8080/webapi/callcenter_config
    135. pause
    136. goto _starting
    137. :_cmd19
    138. curl -s -S -G -X GET --user freeswitch:works http://192.168.5.97:8080/webapi/shutdown
    139. pause
    140. goto _starting
    141. :_cmd20
    142. curl -s -S -G -X GET --user freeswitch:works http://192.168.5.97:8080/webapi/reloadxml
    143. pause
    144. goto _starting
    145. :_cmd21
    146. curl -s -S -G -X GET --user freeswitch:works http://192.168.5.97:8080/webapi/list_users
    147. pause
    148. goto _starting
    149. :_cmd22
    150. set dnis=
    151. set /p dnis=DNIS input here:
    152. curl -s -S -G -X GET --user freeswitch:works --data "user%%2F1000%%20%dnis%" http://192.168.5.97:8080/webapi/originate
    153. pause
    154. goto _starting
    155. :_cmd23
    156. curl -s -S -G -X GET --user freeswitch:works --data "channels" http://192.168.5.97:8080/webapi/show
    157. pause
    158. goto _starting
    159. :_cmd24
    160. curl -s -S -G -X GET --user freeswitch:works --data "calls" http://192.168.5.97:8080/webapi/show
    161. pause
    162. goto _starting
    163. :_cmd25
    164. curl -s -S -G -X GET --user freeswitch:works --data "channels%%20like%%20external" http://192.168.5.97:8080/webapi/show
    165. pause
    166. goto _starting
    167. :_cmd26
    168. curl -s -S -G -X GET --user freeswitch:works --data "status%%20profile%%20internal" http://192.168.5.97:8080/webapi/sofia
    169. pause
    170. goto _starting
    171. :_cmd27
    172. curl -s -S -G -X GET --user freeswitch:works --data "status" http://192.168.5.97:8080/webapi/sofia
    173. pause
    174. goto _starting
    175. :_cmd28
    176. curl -s -S -G -X GET -v --user freeswitch:works --data "%%2Fusr%%2Flocal%%2Ffreeswitch%%2Fscripts%%2Flua_list_active_calls.lua" http://192.168.5.97:8080/webapi/lua
    177. pause
    178. goto _starting
    179. :_cmd29
    180. curl -s -S -G -X GET --user freeswitch:works http://192.168.5.97:8080/webapi/status
    181. pause
    182. goto _starting
    183. :_cmd30
    184. curl -s -S -G -X GET --user freeswitch:works --data "dialplan" http://192.168.5.97:8080/webapi/show
    185. pause
    186. goto _starting
    187. :_cmd31
    188. set mod=
    189. set /p mod=MOD input here:
    190. curl -s -S -G -X GET --user freeswitch:works --data "modules" http://192.168.5.97:8080/webapi/show |findstr %mod%
    191. pause
    192. goto _starting
    193. :_cmd32
    194. set uuid=
    195. set /p uuid=UUID input here:
    196. curl -s -S -G -X GET --user freeswitch:works --data "%%2B10%%20%uuid%%%20900699%%20XML%%20doosan_inbound_target" http://192.168.5.97:8080/webapi/sched_transfer
    197. pause
    198. goto _starting
    199. :_cmd33
    200. set uuid=
    201. set var_val1=
    202. set /p uuid=UUID input here:
    203. set /p var_val1=userdata1 is about to set:
    204. curl -s -S -G -X GET --user freeswitch:works --data "%uuid%%%20%userdata1%%var_val1%" http://192.168.5.97:8080/webapi/uuid_setvar
    205. pause
    206. goto _starting
    207. :_cmd34
    208. set uuid=
    209. set var_name=
    210. set /p uuid=UUID input here:
    211. set /p var_name=VAR_NAME input here:
    212. curl -s -S -G -X GET --user freeswitch:works --data "%uuid%%%20%var_name%" http://192.168.5.97:8080/webapi/uuid_getvar
    213. echo.
    214. pause
    215. goto _starting
    216. :_cmd35
    217. set uuid=
    218. set /p uuid=UUID input here:
    219. curl -s -S -G -X GET --user freeswitch:works --data "%uuid%%%20talk" http://192.168.5.97:8080/webapi/uuid_phone_event
    220. pause
    221. goto _starting
    222. :_cmd36
    223. curl -s -S -G -X GET --user freeswitch:works --data "tier%%20del%%20support%%40default%%2021009%%40default" http://192.168.5.97:8080/webapi/callcenter_config
    224. pause
    225. goto _starting
    226. :_cmd37
    227. curl -s -S -G -X GET --user freeswitch:works --data "%%7B%%22command%%22%%3A%%20%%22callcenter_config%%22%%2C%%22data%%22%%3A%%20%%7B%%22arguments%%22%%3A%%22tier%%20list%%22%%7D%%7D" http://192.168.5.97:8080/webapi/json
    228. pause
    229. goto _starting
    230. :_cmd38
    231. curl -s -S -G -X GET --user freeswitch:works --data "%%7B%%22command%%22%%3A%%20%%22callcenter_config%%22%%2C%%20%%22format%%22%%3A%%20%%22pretty%%22%%2C%%20%%22data%%22%%3A%%20%%7B%%22arguments%%22%%3A%%22agent%%20list%%22%%7D%%7D" http://192.168.5.97:8080/webapi/json
    232. pause
    233. goto _starting
    234. :_cmd39
    235. curl -s -S -G -X GET --user freeswitch:works --data "%%7B%%22command%%22%%3A%%20%%22callcenter_config%%22%%2C%%22data%%22%%3A%%20%%7B%%22arguments%%22%%3A%%22member%%20list%%22%%7D%%7D" http://192.168.5.97:8080/webapi/json
    236. pause
    237. goto _starting
    238. :_cmd40
    239. set uuid=
    240. set /p uuid=UUID input here:
    241. curl -s -S -G -X GET --user freeswitch:works --data "toggle%%20%uuid%" http://192.168.5.97:8080/webapi/uuid_hold
    242. pause
    243. goto _starting
    244. :_cmd41
    245. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20add%%2021010%%40default%%20callback" http://192.168.5.97:8080/webapi/callcenter_config
    246. pause
    247. goto _starting
    248. :_cmd42
    249. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20set%%20contact%%2021010%%40default%%20user%%2F1003" http://192.168.5.97:8080/webapi/callcenter_config
    250. pause
    251. goto _starting
    252. :_cmd43
    253. curl -s -S -G -X GET --user freeswitch:works --data "tier%%20add%%20zhuangzaiji%%40default%%2021010%%40default%%201%%201" http://192.168.5.97:8080/webapi/callcenter_config
    254. pause
    255. goto _starting
    256. :_cmd45
    257. curl -s -S -G -X GET --user freeswitch:works --data "agent%%20set%%20status%%2021010%%40default%%20'Available'" http://192.168.5.97:8080/webapi/callcenter_config
    258. pause
    259. goto _starting
    260. :_cmd46
    261. curl -s -S -G -X GET --user freeswitch:works --data "tier%%20del%%20zhuangzaiji%%40default%%2021010%%40default" http://192.168.5.97:8080/webapi/callcenter_config
    262. pause
    263. goto _starting
    264. :_cmd49
    265. set userid=
    266. set /p userid=USERID input here:
    267. curl -s -S -G -X GET --user freeswitch:works --data "group%%20default%%20user%%20%userid%" http://192.168.5.97:8080/webapi/list_users
    268. pause
    269. goto _starting
    270. :_cmd50
    271. set uuid=
    272. set /p uuid=UUID input here:
    273. curl -s -S -G -X GET --user freeswitch:works --data "user%%2F1001%%40192.168.5.97%%20%%26eavesdrop(%uuid%)" http://192.168.5.97:8080/webapi/originate
    274. pause
    275. goto _starting
    276. goto :EOF

    2.执行命令 

  • 相关阅读:
    CVE-2020-14882、CVE-2020-14883 Weblogic 管理控制台未授权远程命令执行漏洞
    【C++ Primer Plus】第11章 使用类
    前端开发需要会什么?先掌握这三大核心关键技术
    浅析产品经理
    程序员养生-人体白发的机制及调养恢复
    AM@无穷小和无穷大
    leetcode笔记
    前端 按钮 loading效果阻断不了快速点击,执行防抖操作进行阻断接口连续调用
    AB试验(六)A/B实验常见知识点的Python计算
    C++学习笔记(十二)
  • 原文地址:https://blog.csdn.net/zy08403/article/details/134274567