Monday, August 3, 2009

A Sample Process Calling Example

I used gnokii to send sms. So I need to execute the command from my code.

/usr/bin/gnokii --sendsms 8801712273933

So at first, I installed gnokii in my Ubuntu 9.04. Then
I copied the gnokiirc file from /etc to my home folder and renamed it to .gnokiirc
I opened the file and did some change to it. I was using my Siemens SK65 with a data cable.
I did some tweaking to my .gnokiirc file. All # signs indicate comments. I removed hash sign from some lines. Those lines are:


port = /dev/ttyUSB0
model = AT
initlength = default
connection = serial

As my model isn't supported officially by Gnokii so I added a hash sign before the "model = " line.
Then
I run this command in my console.

gnokii --identify


The output is something like this:
GNOKII Version 0.6.26
IMEI : 354784000367194
Manufacturer : SIEMENS
Model : Gipsy Soft Protocolstack
Product name : Gipsy Soft Protocolstack
Revision : 50,"OFFICIAL","2005

Then I wrothe C file sample.c












When I run this file, a new process is opened and gnokii --sendsms command is executed.After sending the SMS the process gonna close. The phone number in the code is the receiver of the message.
For more info, log into www.gnokii.com

Courtesy : Burhan Uddin


No comments: