Advertisement
load-net

pjsiptrunk

Mar 6th, 2024 (edited)
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;; SERVER1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.  
  5. mcedit /etc/asterisk/pjsip.conf
  6. [system]
  7.  
  8. [global]
  9. ttype = global
  10. disable_multi_domain = yes
  11. debug = yes
  12. taskprocessor_overload_trigger = global
  13. unidentified_request_count=5
  14. unidentified_request_period=5
  15. unidentified_request_prune_interval=30
  16. endpoint_identifier_order=username,ip,anonymous
  17. canreinvite=yes
  18. insecure=port,invite
  19.  
  20. [transport-udp-nat]
  21. type=transport
  22. protocol=udp
  23. bind=0.0.0.0
  24. local_net=10.20.7.0/24
  25. local_net=192.168.20.0/24
  26. symmetric_transport=yes
  27. tos=cs3
  28. cos=3
  29. ;external_media_address=109.194.133.44
  30. ;external_signaling_address=109.194.133.44
  31.  
  32. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  33. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  34.  
  35. [acl]
  36. type=acl
  37. deny=0.0.0.0/0.0.0.0
  38. permit=10.0.0.0/8
  39. permit=91.245.210.0/24
  40.  
  41. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  42. это транк без регистрации с другой стороны поменять ip на этот сервер
  43. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  44.  
  45. [ha-206]
  46. type=aor
  47. max_contacts=3
  48. qualify_frequency=60
  49. qualify_timeout=5.0
  50. authenticate_qualify=60
  51. contact=sip:10.1.1.149
  52.  
  53. [ha-206]
  54. type=endpoint
  55. transport=transport-udp-nat
  56. context=from-internal
  57. disallow=all
  58. allow=alaw
  59. aors=ha-206
  60. direct_media=yes
  61.  
  62. [ha-206]
  63. type=identify
  64. endpoint=ha-206
  65. match=10.1.1.149
  66.  
  67.  
  68. ;;;;;;;;;;;;ШАБЛОН;;;;;;;;;;;;;;;;;;;;;
  69.  
  70. [endpoint-template](!)
  71. type = endpoint
  72. transport = transport-udp-nat
  73. context = from-internal
  74. dtmf_mode = rfc4733
  75. disallow = all
  76. allow = ulaw
  77. allow = alaw
  78.  
  79. [auth-template-userpass](!)
  80. type = auth
  81. auth_type = userpass;
  82.  
  83. [aor-template-single-reg](!)
  84. type = aor
  85. max_contacts = 1
  86.  
  87. ;;;;;;;;;;;users;;;;;;;;;;;;;;;;;;;;;
  88.  
  89. ;;;;;;;;;;;100;;;;;;;;;;;;;;;;;
  90. [100](endpoint-template)
  91. auth = auth100
  92. aors = 100
  93. callerid = 100;
  94.  
  95. [auth100](auth-template-userpass)
  96. username = 100
  97. password = svHGuill
  98.  
  99. [100](aor-template-single-reg)
  100.  
  101. ;;;;;;;;;;;101;;;;;;;;;;;;;;;;;
  102.  
  103. [101](endpoint-template)
  104. auth = auth101
  105. aors = 101
  106. callerid = 101;
  107.  
  108. [auth101](auth-template-userpass)
  109. username = 101
  110. password = svHGuill
  111.  
  112. [101](aor-template-single-reg)
  113. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  114.  
  115.  
  116.  
  117.  
  118.  
  119. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  120.  
  121. mcedit /etc/asterisk/extensions.conf
  122. [general]
  123. static=yes
  124. writeprotect=no
  125. clearglobalvars=no
  126.  
  127. [globals]
  128. CONSOLE=Console/dsp ; Console interface for demo
  129. TRUNK=DAHDI/G2 ; Trunk interface
  130. TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
  131.  
  132.  
  133. [from-internal]
  134. ;Звоним на соседний сервер через транк
  135. exten => _2XX,1,Dial(PJSIP/${EXTEN}@ha-206)
  136.  
  137.  
  138. exten => _1XX,1,Dial(PJSIP/${EXTEN})
  139. exten => _XXXXX,n,Hangup()
  140.  
  141. exten => 777,1,Answer
  142. same => n,BackGround(2)
  143. same => n,Hangup
  144.  
  145. [from-sip]
  146.  
  147. include => local-peers
  148.  
  149. ;exten => _XXX,1,Set(CALLERID(num)=8${CALLERID(num):1})
  150. exten => _XXX,1,NoOp(zashli v contekst inkoming)
  151. same => n,Goto(local-peers,${EXTEN},1)
  152.  
  153.  
  154.  
  155. [vremenno]
  156. exten => _915,1,Answer
  157. same => n,Wait(2)
  158. same => n,Set(temp_exten=${EXTEN})
  159. ; same => n,MixMonitor(/home/load/n_.${UNIQUEID}.wav,b)
  160. same => n,GotoIfTime(08:00-20:00,*,*,*?:time_out)
  161.  
  162. same => n(start),Playback(hello-world)
  163. same => n,BackGround(2)
  164. same => n,WaitExten(5)
  165.  
  166.  
  167. same => n(time_out),Goto(notwork,915,1)
  168. same => n,Hangup
  169.  
  170.  
  171. exten => _[1-5],1,Set(CDR(description)=${CDR(description)},IVR:${EXTEN})
  172. ;exten => #,1,Set(CDR(description)=${CDR(description)},IVR:${EXTEN})
  173.  
  174.  
  175. exten => 1,1,GotoIfTime(*,*,1-9,jan?after13:)
  176. same => n,BackGround(tokb/1)
  177. same => n,WaitExten(5)
  178. same => n,Hangup
  179.  
  180. exten => 2,1,NoOp(222222222222222)
  181. same => n,BackGround(tokb/1)
  182. same => n,WaitExten(5)
  183. same => n,Hangup
  184.  
  185. exten => 3,1,NoOp(3333333333333333)
  186. same => n,BackGround(tokb/2)
  187. same => n,WaitExten(5)
  188. same => n,Hangup
  189.  
  190. exten => 4,1,NoOp(4444444444444)
  191. same => n,BackGround(tokb/3)
  192. same => n,WaitExten(5)
  193. same => n,Hangup
  194.  
  195. exten => 5,1,Goto(from-sip,915,go)
  196.  
  197. exten => #,2,Goto(from-sip,915,start)
  198.  
  199. exten => i,1,Goto(from-sip,915,start)
  200.  
  201.  
  202.  
  203.  
  204.  
  205. [local-peers]
  206.  
  207. ;include => invalidnumber
  208. exten => _X.,1,Set(fromexten=${EXTEN})
  209. exten => _X.,2,Set(CDR(userfield)=${CDR(userfield)}.fre=${fromexten})
  210. exten => _9[2-9]X,5,Busy
  211.  
  212. exten => 915,3,NoOp(-------local peers---------)
  213. same => n,Goto(vremenno,915,1)
  214. same => n,Hangup
  215.  
  216.  
  217. [notwork]
  218.  
  219. exten => 915,1,NoOp(-----NOTWORK-----)
  220. same => n,Answer
  221. same => n,BackGround(7)
  222. same => n,WaitExten(5)
  223. same => n,Hangup
  224.  
  225.  
  226.  
  227.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement