AstroCom-API/acSipBridge/astrocom.md

52 lines
1.8 KiB
Markdown

AstroCom integration for freePBX (Originally made for TandmX by @lachesis_._ @lachesis_._)
1. (caveats: assumes full exchange, assumes 4 digit extensions, assumes you're okay with AstroCom users dialing anything 4-digit on your switch)
2. Put the following in your `globals_custom.conf`:
```
astrocomkey=(long-key-you-got-from-admins)
```
3. Put the following in your `iax_custom.conf`:
```
[from-astrocom]
type=user
username=from-astrocom
secret=(short-secret-you-sent-to-astrocom)
auth=md5
encryption=yes
context=from-astrocom
```
4. Put the following in `extensions_custom.conf`, *change 777 to your AstroCom exchange prefix*, and uncomment one or both blocks directly below
```
[from-internal-additional-custom]
; Change 777 to your exchange prefix
; Uncomment for 7 digit dialing to AstroCom
;exten => _XXXXXXX,1,NoOp
; same => n,Set(CALLERID(num)=777${CALLERID(num)})
; same => n,Goto(astrocom-dial,${EXTEN},1)
; same => n,Hangup
; Uncomment for 1-300-XXX-XXXX to AstroCom
;exten => _1300XXXXXXX,1,NoOp
; same => n,Set(CALLERID(num)=777${CALLERID(num)})
; same => n,Goto(astrocom-dial,${EXTEN:4},1)
; same => n,Hangup
[astrocom-dial]
exten => _X!,1,Set(number=${EXTEN})
same => n,Set(lookup=${CURL(https://api.astrocom.tel/api/v1/route/${astrocomkey}/${FILTER(0-9,${CALLERID(num)})}/${FILTER(0-9,${number})})})
same => n,GotoIf($["${lookup}"=="local"]?local:long)
same => n(local),Goto(astrocom-exchange,${number},1)
same => n(long),Dial(${lookup})
same => n,Hangup
[from-astrocom]
exten => _X!,1,NoOp()
same => n,Goto(astrocom-exchange,${EXTEN},1)
same => n,Hangup
; Change 777 to your exchange prefix
[astrocom-exchange]
exten => _777XXXX,1,Goto(from-internal,${EXTEN:3},1)
same => n,Hangup
```
Literally picked straight from tandmx (will make our own docs eventually, but this'll get us going)