Getting started with Chan_sebi
In August 2009 I read a very interesting mail on the asterisk-dev list about using usb broadband modems for voice and sms access. As I always like a challenge I acquired a Huawei E169G and downloaded the chan_sebi development code. This code is for asterisk 1.4 so I modified it to work with asterisk 1.6. The diff is available here.
The majority of the changes relate to the way the cli now works but I had a problem with calling ast_dsp_digitmode as I get a load error when loading the module in asterisk. In the diff I have commented out this line for now. I have also added another modem command to fetch the msisdn from the sim as I couldn't remember the phone number of the sim I was using.
NOTE: I see that the original SVN access is no longer available but this web type access may work. I have not tested to see if the diff still applies.
chan_sebi problems
When I load the module in asterisk I get all the expected responses
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+CGSN
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [3530xxxxxxxxxxx]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+CPIN?
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [+CPIN: READY]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT^CARDLOCK?
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [^CARDLOCK: 2,10,0]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+CLIP=1
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+CREG?
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [+CREG: 0,1]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+COPS=3,0
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+COPS?
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [+COPS: 0,0,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",0]
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+CNUM
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [+CME ERROR: invalid characters in text string+CNUM: "","07xxxxxxxxx",129]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+CLVL=5
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT^DDSETEX=2
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT^CVOICE=?
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [^CVOICE:(0)]
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+CMGF=1;+CPMS="ME","ME","ME";+CNMI=1,1,0,1,0
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [+CPMS: 1,23,1,23,1,23]
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
]Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+CSCA="+447973100973",145
[Aug 27 13:22:27] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
-- Modem Device huawei1 initialised and ready.
The problem is I can't dial out or accept incoming calls.
-- Executing [3000@home:2] Dial("SIP/martin-007ab0c8", "sebi/huawei1/07xxxxxxxxx,20,T") in new stack
[Aug 27 13:25:30] DEBUG[572]: chan_sebi.c:534 modem_call: Calling huawei1/07xxxxxxxxx on Sebi/huawei1-b64c
]Aug 27 13:25:30] DEBUG[572]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT^DDSETEX=2
-- Called huawei1/07xxxxxxxxx
[Aug 27 13:25:30] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
]Aug 27 13:25:31] DEBUG[560]: chan_sebi.c:853 data_write: data_write() (huawei1) [ATD07xxxxxxxxx;
[Aug 27 13:25:31] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [ERROR]
[Aug 27 13:25:36] DEBUG[572]: chan_sebi.c:561 modem_hangup: Hanging up device huawei1.
]Aug 27 13:25:36] DEBUG[572]: chan_sebi.c:853 data_write: data_write() (huawei1) [AT+CHUP
== Spawn extension (home, 3000, 2) exited non-zero on 'SIP/martin-007ab0c8'
[Aug 27 13:25:36] DEBUG[499]: chan_sebi.c:773 modem_devicestate: Checking device state for device huawei1
[Aug 27 13:25:36] DEBUG[560]: chan_sebi.c:1011 do_monitor_phone: data_read() (huawei1) [OK]
