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]

6 thoughts on “Dinstar DWG2000 SMS API stable release

  1. Hi.
    I’m have Dinstar DWG 2000 and develop sms application on C# but dll not work. You can build dll files bindding for C# . Please

    Thanks

    • I can do that. In fact, I was working on it but I stopped the implementation because the project switched its direction. Are you working on Linux?

  2. I’m working on Windows . You can shared library write on C# to me. Please
    I’m test application but not work on windows 🙂

  3. Thank for your work! I have the same requiement for C# I have c++ source code from Dinstar but cannot use DLL in C#. Please if you just have DLLImport declarations, I will be thankfull to receive it

    best regards

  4. Hello,
    i am loking for any script (prefer php) to send/recieve ussd and sms to my dinstar DWG 2000.
    please help

Leave a Reply

Your email address will not be published. Required fields are marked *