Hello,

try to run with debug=3 in kamailio.cfg and see if you get more hints why the cass_retrieve() is returning negative code.

Cheers,
Daniel


On 02/07/16 13:01, Aqs Younas wrote:
Greetings Lists. 

I am having hard time trying to use ndb_cassandra with kamailio. I have successfully complied the module and kamailio runs without any error. 
Below is relevant snippet. 

loadmodule "ndb_cassandra.so"
modparam("ndb_cassandra", "host", "192.168.0.103")
modparam("ndb_cassandra", "port", 9160)

        $var(keyspace) = 'kamailio';
        $var(column_family) = 'numbers_directory';
        $var(key) = 15;
        $var(column) = 'number';
        xlog("L_INFO", "Valus to fetch are $var(keyspace), $var(column_family), $var(key), $var(column) \n");
        if (cass_retrieve("$var(keyspace)", "$var(column_family)", "$var(key)", "prefix", "$var(val_read)") > 0) {
                xlog("L_INFO", " ===== ndb_cassandra. Sucess while reading from Cassandra. val_read: \"$var(val_read)\"\n");
        } else {
                xlog("L_INFO", " ===== ndb_cassandra. Error while reading from Cassandra \n");
        }

Cassandra Table Structure. 

cqlsh:kamailio> describe numbers_directory;

CREATE TABLE kamailio.numbers_directory (
    id int PRIMARY KEY,
    description text,
    number text
) WITH bloom_filter_fp_chance = 0.01
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99.0PERCENTILE';


cqlsh:kamailio> select * from numbers_directory;

 id | description | number
----+-------------+-----------
 15 |        null | 212456789



When i make a call i get this in logs. 

Jul  1 19:10:42 debian ./kamailio[8142]: INFO: <script>: Valus to fetch are kamailio, numbers_directory, 15, number
Jul  1 19:10:42 debian ./kamailio[8142]: INFO: <script>:  ===== ndb_cassandra. Error while reading from Cassandra

I am stuck at this. Does anybody able to use kamailio with cassandra or can share their configuration?

Any pointer on this is much appreciated. 

Best Regards, 

Aqs Younas


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
http://www.asipto.com - http://www.kamailio.org
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda