Home > kalkun > Using Kalkun with other application

Using Kalkun with other application

Let say that you have some application like Point Of Sale, SAP, ERP, or other application that contains information about your client or friends, and somehow you want to reach them via SMS. OK, you have install Kalkun and it’s runs well, but how you send SMS with contact from other application? add/import it to Kalkun phonebook? Hmmm, it’s OK if you have only a few contact, but how about hundred or thousand contact? Your data will become redundant and hard to maintain.

So, maybe a better way is using ‘independent protocol’ that allow applications communicate each other, known as web service, i’ve planning using XML-RPC or SOAP to implement it. But it’s under (slow) development and i need some more time to finish it.

But, right now, i’ve implemented (actually, experimental one) a way for your application to communicate to Kalkun through PHP cURL. Let’s see how to use it.

First, you have to download the script here, and extract it to somewhere on your application directory.

Then, include it on your application script:



// some logic here, eg: database query to get phone number, and looping it
$config[‘base_url’] = “http://localhost/kalkun/index.php/&#8221;; // Kalkun URL
$config[‘session_file’] = “/tmp/cookies.txt”; // session file, must be writeable
$config[‘username’] = “username”; // Username on Kalkun
$config[‘password’] = “password”;
$config[‘phone_number’] = “123456”; // Your client/friend phone number
$config[‘message’] = “Test message from API”; // SMS content

$sms = new Kalkun_API($config);

// Other job


As you can see, all you need is to change the config parameters based on your configuration.

base_url: your Kalkun URL, don’t forget the index.php/
session_file: a file that save your session a.k.a login credential, it must be writeable by web server user
username and password: your login credential for Kalkun, not your application
phone_number: destination phone number, you’ve to get it from your application (through database query)
message: the SMS content

That’s all 😀

Categories: kalkun Tags:
  1. August 10, 2010 at 1:41 am

    tapi saya belum mencobanya.
    Oya saya sudah kirim ticket 🙂

  2. wahyu
    May 19, 2011 at 1:43 am

    Bang Arie, ane mo tanya nih,
    Bisa gak ambil sms untuk aplikasi lain tapi lewat KALKUN_API, kalo contoh di atas ini kan untuk kirim sms. Ato langsung connect ke databasenya, berarti kalo di CI itu di config.php ditambah setting database kalkun gitu yah?

  3. May 19, 2011 at 3:28 am

    @wahyu: Silahkan dibaca-baca tentang External Script

  4. January 4, 2012 at 8:32 pm

    You’ve ever tried to use it in openerp?

  1. February 24, 2011 at 1:33 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: