Chan_datacard is an Asterisk channel driver for Huawei UMTS / 3G datacards.

Supported features:
* Place voice calls and terminate voice calls
* Send SMS and receive SMS
* Send and receive USSD commands / messages

Example dialplan:

exten => sms,1,Verbose(Incoming SMS from ${CALLERID(num)} ${SMS})
exten => sms,n,System(echo ‘${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} – ${DATACARD} – ${CALLERID(num)}: ${SMS}’ >> /var/log/asterisk/sms.txt)
exten => sms,n,Hangup()

exten => ussd,1,Verbose(Incoming USSD: ${USSD})
exten => ussd,n,System(echo ‘${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} – ${DATACARD}: ${USSD}’ >> /var/log/asterisk/ussd.txt)
exten => ussd,n,Hangup()

exten => s,1,Dial(SIP/2001@othersipserver)
exten => s,n,Hangup()


exten => _X.,1,Dial(Datacard/r1/${EXTEN})
exten => _X.,n,Hangup

you can also use this:

Call using a specific group:
exten => _X.,1,Dial(Datacard/g1/${EXTEN})

Call using a specific datacard:
exten => _X.,1,Dial(Datacard/datacard0/${EXTEN})

Call using a specific provider name:
exten => _X.,1,Dial(Datacard/p:PROVIDER NAME/${EXTEN})

Call using a specific IMEI:
exten => _X.,1,Dial(Datacard/i:123456789012345/${EXTEN})

Call using a IMSI prefix:
exten => _X.,1,Dial(Datacard/s:25099/${EXTEN})

Predefined Variables:

${DATACARD}: Current datacard used.
${IMSI}: IMSI of current datacard in use.
${IMEI}: IMEI of current datacard in use.
${PROVIDER}): PROVIDER of current datacard in use.
${SMS}: Incoming SMS message.
${USSD}: Incoming USSD message.

, , , , , , , , , ,

No comments yet.

Leave a Reply


Powered by recycled bites and bytes.