Skip to content

Commit 9d61a14

Browse files
authored
res_smdr_whozz: Add SMDR server for WHOZZ Calling? devices. (#45)
Adds a module that acts as an SMDR server for WHOZZ Calling? call accounting devices, receiving events from the device via serial connection and dispatching corresponding CDRs using the Asterisk CDR engine.
1 parent 2571432 commit 9d61a14

File tree

4 files changed

+880
-0
lines changed

4 files changed

+880
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ PhreakScript installs:
1919
- Broadworks compatible Shared Call Appearances (PJSIP)
2020
- Presence publishing (PJSIP)
2121
- Message Send Protocol send support
22+
- SMDR support for "WHOZZ Calling?" call accounting devices
2223
- AGI `RECORD FILE` option to require noise before silence detection
2324
- Optional build enhancements
2425
- `chan_sccp` (improved community Skinny/SCCP channel driver), with compilation fixes
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
; res_smdr_whozz.conf - SMDR for "WHOZZ Calling?" call accounting devices
2+
3+
; TIPS: Both serial and parallel wiring of the phone line to your WHOZZ Calling? device are supported.
4+
; It is recommended that you wire in parallel if possible to avoid putting the unit in the voice path.
5+
; Additionally, please note that the WHOZZ Calling? units do NOT support pulse dialing,
6+
; and pulse-to-tone converters may degrade the quality of the voice path. You may wish
7+
; to drive a slave / follower line to follow hook state changes and receive dialed digits (but not audio)
8+
; and connect that to the unit instead.
9+
; As always, USE AT YOUR OWN RISK.
10+
11+
;[general]
12+
;device=/dev/ttyS0 ; Device name of serial port to which WHOZZ Calling? unit is connected (9600/N/1)
13+
14+
;[line-1]
15+
;line = 1 ; Line number as configured on WHOZZ Calling? unit.
16+
;device=DAHDI/1 ; Optional. Device name of associated FXO port connected to this same line.
17+
; If configured, if calls are made using this device, they will be ignored by this module.
18+
; This allows this module to create CDRs for calls made directly on a phone line connected
19+
; to an Asterisk FXO port, when the call was NOT made through Asterisk,
20+
; but allows Asterisk to create the CDR record if the call was made through Asterisk.
21+
; This avoids duplicate CDR records for the same call.
22+
; Optional variables to set, for example, for outgoing calls, you could do a lookup to determine if a call is local, long distance, etc. based on dialed number.
23+
;setvar=CDR(trunkgrp)=pots-1
24+
;setvar=CDR(direction)=${WHOZZ_DIRECTION}
25+
;setvar=CDR(line)=${WHOZZ_LINE}
26+
;setvar=CHANNEL(amaflags)=BILLING
27+
28+
;[line-2]
29+
;line = 2

phreaknet.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,6 +1952,16 @@ phreak_tree_module() { # $1 = file to patch, $2 = whether failure is acceptable
19521952
fi
19531953
}
19541954

1955+
phreak_tree_module_branch() { # $1 = file to patch, $2 = whether failure is acceptable, $3 = branch name
1956+
printf "Adding new module: %s\n" "$1"
1957+
wget -q "https://raw.githubusercontent.com/InterLinked1/phreakscript/$3/$1" -O "$AST_SOURCE_PARENT_DIR/$AST_SRC_DIR/$1" --no-cache
1958+
if [ $? -ne 0 ]; then
1959+
echoerr "Failed to download module from branch $3, retrying with master..."
1960+
# Fall back to master in case the branch name is stale. If that fails, abort.
1961+
phreak_tree_module "$1" "$2"
1962+
fi
1963+
}
1964+
19551965
custom_module() { # $1 = filename, $2 = URL to download
19561966
printf "Adding new module: %s\n" "$1"
19571967
wget -q "$2" -O "$AST_SOURCE_PARENT_DIR/$AST_SRC_DIR/$1" --no-cache
@@ -2133,6 +2143,7 @@ phreak_patches() { # $1 = $PATCH_DIR, $2 = $AST_SRC_DIR
21332143
phreak_tree_module "res/res_msp.c"
21342144
phreak_tree_module "res/res_phreaknet.c"
21352145
phreak_tree_module "res/res_pjsip_presence.c"
2146+
phreak_tree_module "res/res_smdr_whozz.c"
21362147

21372148
if [ -d /etc/dahdi ]; then
21382149
phreak_tree_module "apps/app_loopdisconnect.c"

0 commit comments

Comments
 (0)