Tag: ISDN
Fun with Asterisk and ISDN
by mensi on Sep.08, 2007, under Asterisk, ISDN, Networking, Projects, gentoo
I recently got the idea to play around a bit with our spare ISDN line (we got ISDN back in the days when it was the only means of getting internet access and phones working simultanously) so I installed an AVM Fritz! Card PCI into “cheff” the Mini-ITX homeserver. The installation of CAPI drivers and Asterisk on gentoo is pretty straight forward, so I got a SIP phone with dialout and dialin working without problems. Now as Asterisk is quite flexible and I wanted some kind of notification of incoming calls, I built a little python script to broadcast incoming calls to the LAN. A quick and dirty C# app could then listen on a specific port and display a baloon tip whenever an incoming call occurs.
extensions.conf entry
exten => 7114988,1,System(/usr/local/bin/logcall ${CALLERIDNUM} “7114988″)
logcall
#!/bin/sh
PNUM=$1
TONUM=$2
echo “[`date`] $PNUM -> $TONUM” >> /var/log/call.log
/usr/local/bin/udp_broadcast $PNUM $TONUM
udp_broadcast
#!/usr/bin/python
from socket import *
import syss = socket(AF_INET, SOCK_DGRAM)
s.bind((”,0))s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
s.sendto(‘call from: ‘+sys.argv[1]+”\nto: “+sys.argv[2], (‘<broadcast>’, 50000))