Cyclos SMS, please save my job!

Any communication concerning the SMS module

Moderators: hugo, alexandre, rmvanarkel

Post Reply
ken4ward
Posts: 94
Joined: Tue Sep 18, 2012 3:29 pm

Cyclos SMS, please save my job!

Post by ken4ward » Thu Mar 14, 2013 8:48 am

I have been on this for over a month and haven't found a solution to it. Though after extensive research I have been able to find where the constant was defined in Cyclos SMS file, but unable to edit it perfectly. My quest is this, from my previous posts, I noted that the Cyclos SMS works perfectly, the only thing that remains is for it to forward SMS back to both the sender and the receiver for any transaction originating from a mobile phone. Example is this:
-----Sender --08023445566 inputs this:
----pay 1111 08033224455 10 units

-------baseDriverConfig.properties----------
phone.with.area.code.len=11
phone.area.code.prefix=0
phone.country.code=00234

with this config in the baseDriverConfig.properties both sender and receiver gets SMS notification in the web application, noted by "external transaction" but not on their mobile phones. When I checked the SMS gateway log on the mobile phone it reads "Outgoing SMS forwarded with error code 200". So I changed the config thus:

-------baseDriverConfig.properties----------
phone.with.area.code.len=11
phone.area.code.prefix=0
phone.country.code=009234

When I send from the SMS monitor both the sender and the receiver get the feedback on their mobile phones. When I send from a mobile phone, it does not execute the transaction because of length difference. this is because every SMS transaction that originates from the mobile phone comes a prefix "+" and Cyclos converts it to "00"
So, since 009234 works on the SMS gateway on the mobile phone, I imported Cyclos SMS project into Eclipse and found out in this file that the "00" conversion is a string constant declared in this file : HttpGatewayReceiverServlet.java. I edited it to 009 but the change never took effect. I have tried to edit the driver-gateway_1.2.src.jar, decompile it, and the class files as well, but once I make changes to it and redeploy it as a jar file it reads error.
I earnestly plead for a Cyclos expert to truly help me out on this! Apart from the SMS gateway suggested in the WIKI has anybody tried out any other one? both in mobile app and online gateways. thanks. God bless in Jesus name.
Attachments
sms.png
sms.png (31.95 KiB) Viewed 6428 times

admin
Site Admin
Posts: 1417
Joined: Mon Jan 24, 2005 10:31 am

Re: Cyclos SMS, please save my job!

Post by admin » Thu Mar 14, 2013 1:24 pm

Hi,

It is not clear to us what your problem exactly is.
It seems that you trying to send a number format to the gateway that is not supported. So you could ask your gateway provider what format is supported besides a number starting with the + sign (like 00)
This could work.

If not you could try to implement a message interceptor:
You would need to set the the settings in the Driver config as follows
phone.with.area.code.len=0
phone.area.code.prefix=
phone.country.code=

And implement an interceptor, see http://www.cyclos.org/wiki/index.php/Me ... tercepting

ken4ward
Posts: 94
Joined: Tue Sep 18, 2012 3:29 pm

Re: Cyclos SMS, please save my job!

Post by ken4ward » Thu Mar 14, 2013 3:04 pm

Thanks very much for your reply. My simple quest is this: When a member sends SMS to the organization mobile number (the android phone that host the SMS Gateway prescribed in the Wiki) thus:
Member that sends SMS has these credentials: PIN = 1111, mobile number = 08022334455. He sends to the organization number (08044556677) on which the SMS gateway is hosted to pay member with registered mobile number - 08066778899

-----pay 1111 08066778899 10 units

SMS notifications is seen in both sender and receiver online accounts, as well as in their email (if enabled for notification), but they never get feedback on their mobile phones when this config is used in baseDriverConfig.properties thus:

phone.with.area.code.len=10
phone.area.code.prefix=0
phone.country.code=00234

All just need done is for them to get feedback. Thanks. If you have a better way to set this parameters, kindly share.

admin
Site Admin
Posts: 1417
Joined: Mon Jan 24, 2005 10:31 am

Re: Cyclos SMS, please save my job!

Post by admin » Thu Mar 14, 2013 4:07 pm

Possibly your gateway provider does not support the number format. Could you contact them?
When you test it with the monitor, does it return any error?

ken4ward
Posts: 94
Joined: Tue Sep 18, 2012 3:29 pm

Re: Cyclos SMS, please save my job!

Post by ken4ward » Fri Mar 15, 2013 9:15 am

Thanks. Definitely it has been confirmed that the sending format in Nigeria is "009" for all telcos and not "00". This is what is converted to "+". That is where the problem came from; and that is the reason I want to edit the string constant defined in \gateway\WEB-INF\lib\driver-gateway_1.2.jar\HttpGatewayReceiverServlet.class. Though I know this have to be decompiled. I have tried severally but have not gotten it done.
Please if you can teach me step by step on how to do this in eclipse, because I have imported it into eclipse, made the change from the source file; recompiled it, yet it does not reflect the changes made. If you are using Notepad++, the place to be edited is: line 105 - "internationalNumber.toString().replace("+", "00")" to be changed to "internationalNumber.toString().replace("+", "009")"


//------------------------ the start of theTransaction done with 009234 (this forwards the text)-----------------------

Code: Select all

2013-03-15 12:22:12  INFO ControllerFacade - Sending to driver: aioDriver. Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 08068592950
   text         = The WealthMarket: You have made a payment of 2,00 units to member: 08032283403. Transaction ID: null. Your new account balance is 10.366,00 units

2013-03-15 12:22:12  INFO ControllerFacade - Sending to driver: aioDriver. Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 08032283403
   text         = The WealthMarket: A payment of 2,00 units was received from JohnPayment1. Your balance is 220,00 units

2013-03-15 12:22:12  INFO DriverServiceImpl - A message from Controller has arrived: Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 08068592950
   text         = The WealthMarket: You have made a payment of 2,00 units to member: 08032283403. Transaction ID: null. Your new account balance is 10.366,00 units

2013-03-15 12:22:12  INFO DriverServiceImpl - A message from Controller has arrived: Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 08032283403
   text         = The WealthMarket: A payment of 2,00 units was received from JohnPayment1. Your balance is 220,00 units

2013-03-15 12:22:12  INFO HttpGatewayEngine - Sending message to gateway: Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 0092348068592950
   text         = The WealthMarket: You have made a payment of 2,00 units to member: 08032283403. Transaction ID: null. Your new account balance is 10.366,00 units

2013-03-15 12:22:12  INFO HttpGatewayEngine - Sending message to gateway: Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 0092348032283403
   text         = The WealthMarket: A payment of 2,00 units was received from JohnPayment1. Your balance is 220,00 units
//------------------------End of transaction done with 009234 (this forwards the text)------------------------------------------------------

//-----------------------The start of transaction done with 00234 (this does not forward the text)---------------------------------------

Code: Select all

2013-03-15 12:28:47  INFO DriverServiceImpl - A message from Controller has arrived: Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 08068592950
   text         = The WealthMarket: A payment of 3,00 units was received from ken4ward. Your balance is 10.369,00 units

2013-03-15 12:28:47  INFO ControllerFacade - Sending to driver: aioDriver. Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 08023472436
   text         = The WealthMarket: You have made a payment of 3,00 units to member: 08068592950. Transaction ID: null. Your new account balance is 9.777,00 units

2013-03-15 12:28:47  INFO HttpGatewayEngine - Sending message to gateway: Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 002348068592950
   text         = The WealthMarket: A payment of 3,00 units was received from ken4ward. Your balance is 10.369,00 units

2013-03-15 12:28:47  INFO DriverServiceImpl - A message from Controller has arrived: Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 08023472436
   text         = The WealthMarket: You have made a payment of 3,00 units to member: 08068592950. Transaction ID: null. Your new account balance is 9.777,00 units

2013-03-15 12:28:47  INFO HttpGatewayEngine - Sending message to gateway: Controller message:
   trace        = 1
   provider     = Airtel
   from         = 08023472436
   to           = 002348023472436
   text         = The WealthMarket: You have made a payment of 3,00 units to member: 08068592950. Transaction ID: null. Your new account balance is 9.777,00 units
//-----------------------The start of transaction done with 00234 (this does not forward the text)---------------------------------------
Please if possible you can just help me change this line of code in the SMS module, and post this to me. I'll really appreciate. Please help!!! Thanks in advance.
Last edited by ken4ward on Fri Mar 15, 2013 1:20 pm, edited 1 time in total.

admin
Site Admin
Posts: 1417
Joined: Mon Jan 24, 2005 10:31 am

Re: Cyclos SMS, please save my job!

Post by admin » Fri Mar 15, 2013 11:17 am

Hi,

You can find detailed information here: http://www.cyclos.org/wiki/index.php/Me ... tercepting
It contains all the necesary information to customize the message content and number format. This is as far as we can help you.
All the best

ken4ward
Posts: 94
Joined: Tue Sep 18, 2012 3:29 pm

Re: Cyclos SMS, please save my job!

Post by ken4ward » Fri Mar 15, 2013 12:36 pm

Thanks. If hard way the only way, then I am good to go; but not without you as a guide. I have just gone through the tutorial in the Wiki and read of an interface to implement: MessageInterceptor to be found here: \cyclos3-sms_1.2.2\src\driver-common\nl\strohalm\cyclos\driver\message or "nl.strohalm.cyclos.driver.message.interceptor". which I did not see in this directory. Am I wrong? Please help.
Furthermore, can you please give me a sample code of a message interceptor class?

According to the Wiki I should create a class thus:
public class CustomMessage extends BaseMessageHandlerImpl implements MessageInterceptor{

//-------implement this -------
public void handle(ControllerMessage controllerMessage){

}

//----------------implement this----
public void handle(DriverMessage driverMessage) {

}
}

Post Reply