Monday, May 2, 2011

Invalid destination address in delivery receipts [ OpenSmpp and Logica ]

Logica SMPP Simulator is the main open source simulator use for testing application developed using SMPP (Short Message Peer to Peer) protocol.
OpenSmpp/SMS Tools is a recent initiative to build up an open source Java library which implements the SMPP protocol. It is again based on an open source Java SMPP API originally released by Logica.

I wonder both of these project has a problem with delivery receipts (deliver_sm) in their sample SMSC implementation. The issue I am going to explain should have a big impact if a SMPP application plan to test delivery receipt against above two products.

Refer the method "private void deliver(DeliveryInfoEntry entry)" of the DeliveryInfoSender.java class.(Logica SMPP Simulatoin in package com.logica.smscsim and OpenSmpp/SMS Tools in package org.smpp.smscsim ).

It's wrongly setting up delivery receipt destination address.

Example :

Assume ESME send message with source address = 0777123233 and destination address = 7878 to SMSC.

When SMSC replay back to ESME, SMSC destination address should be 0777123233 and source address should be 7878

In an implementation code following changes need to do to support this correctly.

current

deliver.setDestAddr(submit.getDestAddr());

need to change as

deliver.setDestAddr(submit.getSourceAddr());

Thursday, September 16, 2010

Ruby CAS Client with Ruby 1.9.1

The existing code base of Ruby CAS client is not compatible with Ruby 1.9.1 and When I test I got following error.

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

I have modified the existing code base to overcome this issue. Please see the attached link. You can download the modified source from here. It works fine with Ruby 1.9.1

I have added http.verify_mode = OpenSSL::SSL::VERIFY_NONE and https.verify_mode = OpenSSL::SSL::VERIFY_NONE when create http or https connection.

Saturday, April 4, 2009

I am back

I am back…after being no post for more than 8 months. And I am glad I am finally back. What happened? I have had a difficult time in last quarter and extremely difficult to find a time for writing. But it seems half way ok and I am doing my work as usual. Keeping in your eyeball open I am back!

Thursday, June 5, 2008

How to build ruby OpenAMQ extension

Building ruby extension of OpenAMQ is bit painful. I have wrote step by step guide to build ruby extension. Please refer the following URL : http://wiki.openamq.org/addon:ruby-extension/comments/show

Tuesday, April 8, 2008

Shutdown hook for C++

Shutdown hook is not a strange for Java people. It's there since JDK 1.3 . But for the C++ I couldn't found similar function. I wrote a simple program to demonstrate the some features of shutdown hook using available function in c++. I think C++ library is rich enough to write a complete shutdown hook. But indeed it bit hard when compare to Java.

When you hit the Ctrl+c following program will call “fnBeforeExit” function before the system get shut.
If you wish you can try this program by replacing never ending loop with “exit(0)”.

//
// File: Newmain.cc
// Author: eranga
//
// Created on April 8, 2008, 3:52 PM
//

#include < stdio.h>
#include < stdlib.h>
#include < iostream>
#include < csignal>

//
// Shut down hook for C++
//

//Shut down function done all the cleanups
void fnBeforeExit(void) {
puts("Exit function calls.");
puts("Do connection close, filde descriptor close...etc in here.");
}

//Function to call when interactive attention signal recieved
//Generally generated by the application user.
void sigint_handler(int sig) {
std::cout << "Exit call ( Ctrl + C ) " << sig << "\n";
exit(0);
}

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

/*
* The function pointed by the function pointer argument is called when the program terminates normally.
* If more than one atexit function has been
* specified by different calls to this function,
* they are all executed in reverse order as a stack,
* i.e. the last function specified is the first to be executed at exit.
* One single function can be registered to be executed at exit more than once.
* C++ implementations are required to support the registration of at least 32 atexit functions.
*/
atexit(fnBeforeExit);

std :: cout << "Program started....." << std::endl;

/*
* Specifies a way to handle signals
* SIGINT - (Signal Interrupt) Interactive attention signal. Generally generated by the application user.
*/
signal(SIGINT, sigint_handler);

while(true){

}

return (EXIT_SUCCESS);
}

Saturday, March 15, 2008

Quickfix support for FIX 5.0

Still I couldn’t see progressive communication about FIX 5.0 protocol support for Quickfix engine. Some of the user raise this question few times back in the developer mailing list, but still can’t see the green light. The current release of Quickfix 1.12.4 is pretty stable and according to Oren Quickfix willing to support FIX 5.0 near future.

Sunday, January 13, 2008

Long MAX in C++

Yesterday I wrote a program to print long max in C++. In 32 bit systems it prints a very small value [ Refer the program ). I am wonder if I want to store a long number which is the most appropriate data type in C++.

#include < stdlib.h>
#include < iostream>
#include < limits>

using namespace std;

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

// Print the long max value
// 64 bit machine this prints -> 9223372036854775807
// 32 bit machine this prints -> 2147483647
cout << "Max value for long : " << numeric_limits::max() << endl;

return (EXIT_SUCCESS);
}