first commit

This commit is contained in:
2026-07-18 01:25:01 +03:30
parent dee06ba093
commit c18a1c2298
22 changed files with 981 additions and 0 deletions

0
asterisk/config/.gitkeep Normal file
View File

3
asterisk/config/agi.conf Normal file
View File

@@ -0,0 +1,3 @@
[general]
enabled = yes
agidir => /var/lib/asterisk/agi-bin

View File

@@ -0,0 +1,41 @@
[general]
static=yes
writeprotect=no
; ==========================================================
; Incoming calls from SIP Trunk
; ==========================================================
[from-trunk]
; Incoming call without DID
exten => s,1,NoOp(Incoming call from trunk - CallerID: ${CALLERID(num)})
same => n,Answer()
same => n,Wait(1)
same => n,AGI(voicebot.py)
same => n,Hangup()
; Incoming call with DID
exten => _X.,1,NoOp(Incoming DID call: ${EXTEN} - CallerID: ${CALLERID(num)})
same => n,Answer()
same => n,Wait(1)
same => n,AGI(voicebot.py)
same => n,Hangup()
; ==========================================================
; Internal test extension
; Used with Zoiper / Linphone for testing
; ==========================================================
[from-internal]
; Match any dialed extension
exten => _X.,1,NoOp(Test call from internal extension ${EXTEN})
same => n,Answer()
same => n,Wait(1)
same => n,AGI(voicebot.py)
same => n,Hangup()

View File

@@ -0,0 +1,5 @@
[modules]
autoload=yes
; در صورتی که نمی‌خوای chan_sip قدیمی لود بشه (توصیه می‌شه فقط pjsip استفاده کنی)
noload => chan_sip.so

View File

@@ -0,0 +1,64 @@
[global]
type=global
user_agent=Pline-AI
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
; ======================
; Test Extension
; ======================
[1000]
type=endpoint
context=from-internal
disallow=all
allow=ulaw,alaw
auth=1000-auth
aors=1000
[1000-auth]
type=auth
auth_type=userpass
username=1000
password=1000
[1000]
type=aor
max_contacts=5
[121-reg]
type=registration
transport=transport-udp
outbound_auth=121-auth
server_uri=sip:192.168.102.253
client_uri=sip:121@192.168.102.253
retry_interval=60
expiration=3600
[121-auth]
type=auth
auth_type=userpass
username=121
password=121
[121]
type=aor
contact=sip:192.168.102.253
qualify_frequency=60
[121]
type=endpoint
context=from-trunk
transport=transport-udp
disallow=all
allow=ulaw,alaw
outbound_auth=121-auth
aors=121
; --- اضافه کردن این بخش ---
[121-identify]
type=identify
endpoint=121
match=192.168.102.253