Dinstar DWG2000 SMS API stable release

I’ve finished the first stable release of the DWG2000 messaging API. I tested it dozens of times and appears stable after 24 hours of constant running. I’m aware of the memory leaks but I’ll fix this issue as soon as I can.

The code is pretty straightforward and self explanatory. By now this is just for personal use but if any of you are working with the same family of products, I can definitely help you. It is not ready for production, but it works.

[c]
/*
* main.c
*
* Created on: Mar 28, 2012
* Author: caruizdiaz
*/

#include “util.h”
#include “dwg/dwg.h”
#include “networking/ip_socket.h”

void new_sms_handler(dwg_sms_received_t *sms)
{
LOG(L_DEBUG, “new sms from %s. Len: %d, Text: %sn”, sms->number, sms->message.len, sms->message.s);
}

void status_handler(dwg_ports_status_t *status)
{
int index = 0;

LOG(L_DEBUG, “tNumber of ports: %dn”, status->size);

for (index = 0; index < status->size; index++)
{
LOG(L_DEBUG, “tPort%d: %dn”, index, status->status_array[index].status);
}
}

void msg_response_handler(dwg_sms_response_t *response)
{
LOG(L_DEBUG, “tResponse from %sn”, response->number);
}

int main(int argc, char** argv)
{

dwg_message_callback_t callbacks = {
.status_callback = status_handler,
.msg_response_callback = msg_response_handler,
.msg_sms_recv_callback = new_sms_handler
};

dwg_start_server(7008, &callbacks);

str_t des = { “0981146623”, 10 };
str_t msg = { “hola”, 4 };

for(;;)
{
getchar();
dwg_send_sms(&des, &msg);
}

}
[/c]

Huawei modems with Asterisk, another frustration

There are many: chan_mobile, chan_datacard, chan_dongle. I tried them all but none of them actually “works”.  They failed in controlled lab environments, they worked for periods of time but ended crashing the module and Asterisk itself.

At the time of writing this post the frustration is eating me. I spent the weekend trying to make chan_dongle to work with an E177 modem which a friend of mine bought from Amazon two weeks ago.

Chan_dongle is an effort from a developer who decided to share his work with us, I’m not criticizing him, I’m just publishing the results of my lab test along with some of the frustration originated from it.

I’ll read the code, try to figure out what’s happening and If I succeed, I’ll publish the results here.

 

Opensource DWG2000 messaging API

In my spare time I do some consulting jobs mostly about telecom stuff and in one of these jobs I wrote a Dialer software for Asterisk which makes phone calls to users (numbers) loaded from a database. If the call is successful the program must inform the called party about what just happened by sending a SMS. Everything was OK until this feature was required.

We used a 8 ports DWG2000 GSM gateway manufactured by Dinstar which works really fine in terms of overall performance and voice quality. It also supports sending/receiving SMS’s but the API exposed works only on Windows machines and since the source code of the driver remains undisclosed, we (I’m part of a team) were unable to port it to Linux. What they do provide is a detailed protocol specification with enough documentation to implement it by myself and the result of that effort can be found in my github account.

It is still in a very early stage but I’m planning to implement the whole protocol soon but for now, it works for sending and receiving SMS’s, it suited quite well the requirements of my last consulting job.