Mengatasi Masalah Inbox di Kalkun

Pernah ada yang ketemu masalah ini?

Ini Solusinya

Jadi di inbox tidak tampil ada pesan masuk, padahal di database ternyata ada. Lha ini kenapa ?

Ini dikarenakan relasi antara tabel inbox dan user_inbox. Primary key yang ada di inbox harus ada sebagai foreign key di user_inbox. Seharusnya isi dalam tabel user_inbox adalah seperti ini

"id_inbox";"id_user";"trash"
"2";"1";"0"
"3";"1";"0"
"4";"1";"0"
"12";"1";"0"

Agar isi user_inbox menjadi seperti diatas, maka daemon.php harus dijalankan. Silakan baca README untuk konfigurasi daemon.

5. Configure daemon (to manage inbox and autoreply)
* Set path on gammu-smsd configuration at runonreceive directive, e.g:

      [smsd]
      runonreceive = /opt/lampp/htdocs/kalkun/scripts/daemon.sh

or, if you using Windows:

      [smsd]
      runonreceive = C:\xampp\htdocs\kalkun\scripts\daemon.bat

daemon dijalankan dengan memanfaatkan fungsi runonreceive pada gammu. Silakan membuat file daemon.bat/daemon.sh yang isinya mengakses http://localhost/kalkun/index.php/daemon/message_routine.  Setelah mengakses link tersebut, inbox akan tampil.

Saya memiliki alternatif lain agar script membaca inbox tidak dependent ke gammu. Caranya adalah dengan memanfaatkan fungsi auto refresh. Silakan anda cek menggunakan firebug, pada interval tertentu (default 1 menit) kalkun akan mengakses otomatis beberapa fungsi. Nah, daemon untuk inbox bisa kita masukkan disitu.

Silakan buka folder kalkun/application/views/js_init/ lalu buka file js_layout.php

Buat fungsi berikut

function new_daemon(refreshmode)
{
 $.get("<?php echo site_url('daemon/message_routine')?>", function(data) {});

 if(refreshmode == 'true') //refresh automatically if in threadlist 
 auto_refresh();
}

Lalu ubah baris 2 sampai 8 menjadi

var refreshId = setInterval(function() {
 $('.modem_status').load('<?php echo site_url('kalkun/notification')?>');
 new_notification('true');
 new_daemon('true');
}, 5000);

Ada variabel 5000 diatas maksudnya interval refresh setiap 5000 ms (5 detik), silakan dirubah sesuka hati

 

NB : Versi kalkun yang saya pakai Kalkun 0.7

23 thoughts on “Mengatasi Masalah Inbox di Kalkun

  1. mas saya udah coba,,,nih kodingan kalkunnya,,yang salah dimana ya?
    <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

    /*
    |————————————————————————–
    | Kalkun Metadata (DO NOT CHANGE!!!)
    |————————————————————————–
    |
    */
    $config['kalkun_version'] = '0.7.1';
    $config['kalkun_codename'] = 'Yogyakarta';
    $config['kalkun_release_date'] = '01 February 2013';
    $config['kalkun_upgradeable'] = TRUE;
    $config['kalkun_previous_version'] = '0.6';

    /*
    |————————————————————————–
    | Gammu Location (currently only used if you want to send WAP link)
    |————————————————————————–
    |
    | Gammu Installation Location
    | Default Locations… You will need to verify for your system
    | Linux : /usr/local/bin/gammu
    | Windows : C:\Program Files\Gammu 1.29.92\bin\
    |
    */
    $config['gammu_path'] = "C:\Gammu 1.29.92\bin\\";
    $config['gammu_sms_inject'] = $config['gammu_path']."gammu-smsd-inject";
    $config['gammu_config'] = $config['gammu_path']."config.ini";

    /*
    |————————————————————————–
    | Kalkun Cloud Feature Network Settings
    |————————————————————————–
    */
    $config['enable_proxy'] = false;
    $config['proxy_host'] = 'proxyhost.com';
    $config['proxy_port'] = '8080';
    $config['proxy_username'] = '';
    $config['proxy_password'] = '';

    /*
    |————————————————————————–
    | Conversation Grouping
    |————————————————————————–
    |
    | Enable/disable grouping on message list,
    | If set to FALSE, message will be listed as single message.
    |
    */
    $config['conversation_grouping'] = TRUE;

    /*
    |————————————————————————–
    | Modem Tolerant
    |————————————————————————–
    |
    | Modem tolerant (in minutes)
    | To decide if the modem connected or not, default is 10 minutes.
    |
    */
    $config['modem_tolerant'] = '10';

    /*
    |————————————————————————–
    | Inbox owner ID
    |————————————————————————–
    |
    | All message from inbox that don't belongs to anyone will be owned by this user ID.
    | Can be set to multiple users
    | Must be valid user ID
    |
    */
    $config['inbox_owner_id'] = array('1');

    /*
    |————————————————————————–
    | Disable Outgoing Message
    |————————————————————————–
    |
    | Disable outgoing messages.
    | To decide if the disable outgoing message. If enabled all outgoing
    | messages will be barred.
    |
    */

    $config['disable_outgoing'] = FALSE ;

    /*
    |————————————————————————–
    | SMS Bomber
    |————————————————————————–
    |
    | Send message repeatedly
    |
    */
    $config['sms_bomber'] = TRUE;

    /*
    |————————————————————————–
    | Enable Smiles/Emoticons
    |————————————————————————–
    |
    | Enable Smiley/Emoticons for messages
    |
    */
    $config['enable_emoticons'] = TRUE;

    /*
    |————————————————————————–
    | Append @username
    |————————————————————————–
    |
    | Append @username on sent messages
    | Act as identifier which messages sent by which username
    | @username will be automatically replaced by username who sent the messages
    |
    */
    $config['append_username'] = TRUE;
    $config['append_username_message'] = "support@cyberlink.co.id";

    /*
    |————————————————————————–
    | SMS Advertise
    |————————————————————————–
    |
    | Advertised message that will be appended at the end of message
    |
    */
    $config['sms_advertise'] = FALSE;
    $config['sms_advertise_message'] = "This is ads message";

    /*
    |————————————————————————–
    | New incoming message sound
    |————————————————————————–
    |
    | The sound filename (must be located on media/sound directory)
    |
    */
    $config['new_incoming_message_sound'] = 'bird1.wav';

    /*
    |————————————————————————–
    | Max sms sent by minute
    |————————————————————————–
    |
    | Usefull because of some carrier is blocking massive messaging.
    |
    */
    $config['max_sms_sent_by_minute'] = 1;

    /*
    |————————————————————————–
    | Inbox Routing Use Phonebook
    |————————————————————————–
    |
    | If no @username found on new incoming messages,
    | then Kalkun will check origin phonenumber on all user phonebook.
    |
    */
    $config['inbox_routing_use_phonebook'] = TRUE;

    /*
    |————————————————————————–
    | Only admin can permanently delete
    |————————————————————————–
    |
    | Prevent non-admin user from permanently delete message
    |
    */
    $config['only_admin_can_permanently_delete'] = TRUE;

    /*
    |————————————————————————–
    | Registration (Not implemented yet)
    |————————————————————————–
    |
    | Allow user register to your system
    |
    */
    //$config['registration'] = FALSE;

    /*
    |————————————————————————–
    | NCPR(DND) Filter (INDIA)
    |————————————————————————–
    |
    | Filters outgoing messages for numbers registered in NCPR(DND) Registry
    |
    */
    $config['ncpr'] = FALSE;

    /*
    |————————————————————————–
    | UNICODE
    |————————————————————————–
    |
    | Enable unicode by default?
    | Send as Unicode checkbox will automatically checked
    |
    */
    $config['unicode'] = FALSE;

    /*
    |————————————————————————–
    | Multiple phone/modem support
    |————————————————————————–
    |
    | state – enables/disabled
    | strategy
    | (First)
    | – scheduled_time (Start-End, Format: HH:MM:SS-HH:MM:SS)
    | – scheduled_day (Start-End, Format: 0-3, Note: 0 = Sunday, 1 = Monday, …, 6 = Saturday)
    | – scheduled_date (Start:End, Format: YYYY-MM-DD:YYYY-MM-DD)
    | – phone_number_prefix (Must be in array, eg. array('+62813', '+62856'))
    | – phone_number (Must be in array, eg. array('123456789', '987654321'))
    | (Second)
    | – failover (not implemented yet)
    | – recent (Must be in array, eg. array('sierra', 'fasttrack'), id and value is NOT used)
    | – round robin (Must be in array, eg. array('sierra', 'fasttrack'), id and value is NOT used)
    | id – Modem ID, must match to PhoneID on smsdrc
    | value – Modem value to use based on strategy
    |
    | NOTE: You can also use two strategy at the same time as long as it's valid
    | eg. scheduled_time:round_robin (stategy name is divided by ':')
    | This combination allow you to select multiple modem for same time range,
    | and those available/valid modem will be selected again with round robin strategy.
    |
    | Valid combination format: (First:Second)
    | Another combination example (valid):
    | – phone_number_prefix:round_robin
    | – scheduled_day:recent
    | Invalid/wrong combination:
    | – round_robin:phone_number_prefix
    | – round_robin:recent
    |
    */
    $config['multiple_modem_state'] = FALSE;
    $config['multiple_modem_strategy'] = 'scheduled_date';
    $config['multiple_modem'][0]['id'] = 'sierra';
    $config['multiple_modem'][0]['value'] = '2012-04-17:2012-05-17';

    $config['multiple_modem'][1]['id'] = 'fasttrack';
    $config['multiple_modem'][1]['value'] = '2014-04-17:2014-05-17';

    /*
    |————————————————————————–
    | Multiple phone/modem user preferences (Not implemented yet)
    |————————————————————————–
    |
    | Allow user to select modem when sending message
    |
    */
    //$config['multiple_modem_compose_state'] = FALSE;
    //$config['multiple_modem_compose_criteria'] = 'time';
    //$config['multiple_modem_compose_order'] = 'desc';

    /* End of file kalkun_settings.php */
    /* Location: ./application/config/kalkun_settings.php */

  2. Mas mau nanya
    bisa g sih di Kalkun ini kita buat sistem auto send ke group apabila ada perubahan suatu status di database lain?
    Misal gini mas,
    di database ada status awalnya A, tapi berapa lama kemudian berubah statusnya jadi , nah disitu Kalkun mulai ngirim perubahan status tsb ke group
    Bisa g mas kalo kaya gitu?
    Terima Kasih

  3. mau tanya mas knp pesan masuk hanya muncul di id user yg terdaftar di user_inbox saja knp di user lain tidak bs..
    contoh ssaya buat user A,B,C user A ini yg terdaftar pada isi di user_inbox..ketika pesan masuk knp tidak masuk ke inbox user B dan C?? apakah bs di setting semua user bs membaca inbox yg masuk..terimakasih..mohon jawabannya di tunggu..

  4. Bro sagung, thank you atas masukan perubahan code ini, tapi karena perubahan code ini..ketika kita akses inbox page berikutnya terjadi masalah auto refresh yang tidak sesuai…tampilan urlnya page inbox 40 namun isinya adalah page nomor 1..pdahal kita blom selesai melihat halaman 3 dan seterusnya

Mau Komen

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s