commit a835b9d17d5d788a4e6bb23db33f8cb57aae5dd3 Author: root Date: Wed Apr 18 15:14:48 2018 +0200 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0f5d354 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +local/* diff --git a/base.conf b/base.conf new file mode 100644 index 0000000..634618d --- /dev/null +++ b/base.conf @@ -0,0 +1,6 @@ +[globals](+) +LOCALCOUNTRY=49 +LOCALPREFIX=7051 +LOCALBASE=9291 + +LOCALFULLBASE=${LOCALCOUNTRY}${LOCALPREFIX}${LOCALBASE} diff --git a/dial.conf b/dial.conf new file mode 100644 index 0000000..df73dee --- /dev/null +++ b/dial.conf @@ -0,0 +1,22 @@ +[dial] +; Manual trunk selection ( **212345 dials 12345 on trunk2 ) +exten => _**X., 1,Set(TRUNK=${EXTEN:2:1}) +exten => _**X., 1,Goto(dial-trunk,${EXTEN:3},1) + +; Internal extensions (2 - 4 digits) +exten => _ZX, 1,Goto(intern,${EXTEN},1) +exten => _ZXX, 1,Goto(intern,${EXTEN},1) +exten => _ZXXX, 1,Goto(intern,${EXTEN},1) + +; All other expected to be external +exten => _X., 1,Set(TRUNK=0) +exten => _X., 1,Goto(dial-trunk,${EXTEN},1) + +[dial-trunk] +; Trunk dialing +; needs variable TRUNK set to number of trunk to be used ( e.g. 0 => trunk0 ) +; +exten => _ZX.,1,Goto(0${LOCALPREFIX}${EXTEN},1) +exten => _0ZX.,1,Goto(00${LOCALCOUNTRY}${EXTEN:1},1) +exten => _00ZX.,1,Gosub(fix-cid,${CALLERID(num)},1) +exten => _00ZX.,n,Goto(trunk0,${EXTEN},1) diff --git a/fix-cid.conf b/fix-cid.conf new file mode 100644 index 0000000..f94a61d --- /dev/null +++ b/fix-cid.conf @@ -0,0 +1,24 @@ +; +; These contexts should not be called directly +; instead use Gosub(fix-cid,${CALLERID(num)},1) to extend internal callerids to external ones +; + +[fix-cid] +exten => _.,1,Noop( Fixing CID ${EXTEN} ) +exten => _.,n,Gosub(fix-cid-ctx,${EXTEN},1) +exten => _.,n,Return + +[fix-cid-ctx] +exten => pbx, 1,Noop( pbx callerid = ${CALLERID(all)} ) +exten => pbx, n,Goto(4970519291${CALLERID(name)},1) + +exten => 0, 1,Goto(${LOCALFULLBASE}0,1) +exten => _ZX, 1,Goto(${LOCALFULLBASE}${EXTEN},1) +exten => _ZX., 1,Goto(${LOCALFULLBASE}${EXTEN},1) + +exten => _${LOCALFULLBASE}., 1,Set(CALLERID(num)=${EXTEN}) +;exten => _${LOCALFULLBASE}., n,Set(CALLERID(name)=) +exten => _${LOCALFULLBASE}., n,Return + +exten => h,1,Noop( Failed to fix CID ) +exten => h,n,Return \ No newline at end of file diff --git a/incoming.conf b/incoming.conf new file mode 100644 index 0000000..19af958 --- /dev/null +++ b/incoming.conf @@ -0,0 +1,6 @@ +[incoming-extern] +; Incoming call routed to local pbx +exten => _${LOCALFULLBASE}.,1,Goto(incoming,${EXTEN:${LEN(${LOCALFULLBASE})}},1) + +; Incoming call with foreign DID to be routed by custom context [routes] +exten => _X.,1,Goto(routes,${EXTEN},1) diff --git a/local/README b/local/README new file mode 100644 index 0000000..49e7c40 --- /dev/null +++ b/local/README @@ -0,0 +1,3 @@ +Dieses Verzeichnis ist zur Aufnahme von lokalen Konfigurationsdateien vorgesehen. + +z.b. trunk Kontexte, routes Kontext, etc. diff --git a/route.conf b/route.conf new file mode 100644 index 0000000..e69de29