Muhammad Waqas
Muhammad Waqas

Reputation: 39

Simulate PSTN or GSM on Linux without hardware modems

I am developing a product which involves VoIP integeration with PSTN and GSM. I have a hardware component which will run Linux and will have GSM and PSTN modules.

I will be using Asterisk to code out the hardware and to communicate with GSM/PSTN module.

For testing purposes I want to simulate GSM and PSTN modems in Linux without actual hardware and play around with Asterisk to see how it communicates with these modules and how much granulairty it will provide me before ordering my hardware device in number as it will come with prefigured Linux and Asterisk.

Is there anyway of doing it without any additonal hardware? If no, then whats the best possible USB modules I can use. I have seen link suggesting to use Cisco routers to emulate PSTN connection but I am not trying to establish a home exchange.

Regards Waqas

Upvotes: 3

Views: 986

Answers (2)

arheops
arheops

Reputation: 15259

You also can simulate modem-like bahvour using IAXmodem code.

But huiway 1550 usb dongles cost $10 and also can be used to similute REAL gsm device(it have AT commands via usb-serial and you can handle audio)

Upvotes: 0

sruffell
sruffell

Reputation: 306

Yes, it is possible to simulate PSTN connections using DAHDI dynamic spans.

I'm not sure if the granularity provided by the dynamic spans will match your needs. For example, I know that it is currently impossible to simulate battery drops and polarity reversals on virtual analog interfaces.

That being said, dynamic spans allow "virtual" DAHDI spans to be setup and connected to other virtual spans either on the same box or on a different box on the same Ethernet segment.

For example, the following configuration file can be used to setup 4 local spans. Spans 1 and 2 are cross connected PRIs. Span 3 has 2 FXS modules on it, and span 4 2 FXOs that are virtually connected to the FXS modules on span 3.

dynamic=loc,1:0,24,0
bchan=1-23
dchan=24
echocanceller=mg2,1-23
dynamic=loc,1:1,24,0
bchan=25-47
dchan=48
echocanceller=mg2,1-23
dynamic=loc,2:2,2,0
fxoks=49-50
echocanceller=mg2,49-50
dynamic=loc,2:3,2,0
fxsks=51-52
echocanceller=mg2,51-52

If you install DAHDI on your system, and save the above file as dahdi.conf, you can see below how to process it such that your spans show up. All you have to do is configure asterisk to run any tests you wanted.

# modprobe dahdi
# dahdi_scan
# dahdi_cfg -c dahdi.conf
# dahdi_scan
[1]
active=yes
alarms=OK
description=Dynamic 'loc' span at '1:0'
name=DYN/loc/1:0
manufacturer=
devicetype=DYN/loc/1:0
location=
basechan=1
totchans=24
irq=0
type=digital-DYNAM
syncsrc=0
lbo=0 db (CSU)/0-133 feet (DSX-1)
coding_opts=B8ZS,AMI,HDB3
framing_opts=ESF,D4,CCS,CRC4
coding=
framing=CAS
[2]
active=yes
alarms=OK
description=Dynamic 'loc' span at '1:1'
name=DYN/loc/1:1
manufacturer=
devicetype=DYN/loc/1:1
location=
basechan=25
totchans=24
irq=0
type=digital-DYNAM
syncsrc=0
lbo=0 db (CSU)/0-133 feet (DSX-1)
coding_opts=B8ZS,AMI,HDB3
framing_opts=ESF,D4,CCS,CRC4
coding=
framing=CAS
[3]
active=yes
alarms=OK
description=Dynamic 'loc' span at '2:2'
name=DYN/loc/2:2
manufacturer=
devicetype=DYN/loc/2:2
location=
basechan=49
totchans=2
irq=0
type=digital-DYNAM
syncsrc=0
lbo=0 db (CSU)/0-133 feet (DSX-1)
coding_opts=B8ZS,AMI,HDB3
framing_opts=ESF,D4,CCS,CRC4
coding=
framing=CAS
[4]
active=yes
alarms=OK
description=Dynamic 'loc' span at '2:3'
name=DYN/loc/2:3
manufacturer=
devicetype=DYN/loc/2:3
location=
basechan=51
totchans=2
irq=0
type=digital-DYNAM
syncsrc=0
lbo=0 db (CSU)/0-133 feet (DSX-1)
coding_opts=B8ZS,AMI,HDB3
framing_opts=ESF,D4,CCS,CRC4
coding=
framing=CAS

Upvotes: 2

Related Questions