I'm trying to implement failover using the load_contacts/next_contacts from the lcr module. The problem I have is the INVITE message is sent simultaneously to both contact's instead of trying the first and then the second. I keep getting 'load_contacts(): DEBUG: Nothing to do - all same q!' when I've set them up with separate q values??
Anyone else have issues with this? Did I set up the data incorrectly or possibly something in the config?
Thanks in advance for any help or advice Shannon
debug: 0(20640) rewrite_uri: Rewriting Request-URI with ' sip:3125551234@xx.xx.xx.144:5060' 0(20640) xl_get_spec_value: error - null sp->itf 0(20640) Lookup done 0(20640) load_contacts(): DEBUG: Nothing to do - all same q! 0(20640) Contacts loaded sip:3125551234@xx.xx.xx.144:5060 0(20640) next_contacts(): DEBUG: No AVPs -- we are done! 0(20640) Next Contacts loaded sip:3125551234@xx.xx.xx.144:5060
config snip: if(!lookup("location")) { sl_send_reply("404", "Not Found"); xlog("L_ERROR","Unkonwn location sending 404\n"); return; } else { xlog("L_INFO"," Lookup done \n"); } if(!load_contacts()){ sl_send_reply("500", "Server Internal Error - Cannot load translations"); xlog("L_ERROR"," Unable to load contacts <$ru> \n"); exit; } else { xlog("L_INFO"," Contacts loaded <$ru>\n"); } if(next_contacts()) { xlog("L_INFO"," Next Contacts loaded <$ru>\n"); t_on_failure("10"); } else { xlog("L_ERROR"," Unable to load next_contacts <$ru> \n"); exit; }
mysql location table: +------------+--------+-------------------------------------+----------+------+---------------------+------+-----------------+------+---------------------+-------+------------+--------+---------+ | username | domain | contact | received | path | expires | q | callid | cseq | last_modified | flags | user_agent | socket | methods | +------------+--------+-------------------------------------+----------+------+---------------------+------+-----------------+------+---------------------+-------+------------+--------+---------+ | 3125551234 | | sip:3125551234@xx.xx.xx.180:5060 | NULL | NULL | 2020-05-28 21:32:15 | 0.40 | Default-Call-ID | 42 | 2007-07-29 11:35:02 | 128 | | NULL | NULL | | 3125551234 | | sip:3125551234@xx.xx.xx.144:5060 | NULL | NULL | 2020-05-28 21:32:15 | 0.30 | Default-Call-ID | 42 | 2007-08-17 09:36:00 | 128 | | NULL | NULL | +------------+--------+-------------------------------------+----------+------+---------------------+------+-----------------+------+---------------------+-------+------------+--------+---------+
SMP writes:
I'm trying to implement failover using the load_contacts/next_contacts from the lcr module. The problem I have is the INVITE message is sent simultaneously to both contact's instead of trying the first and then the second. I keep getting 'load_contacts(): DEBUG: Nothing to do - all same q!' when I've set them up with separate q values??
check what the value of your destination set ($ds) is before you call load_contacts().
-- juha
On 8/17/07, Juha Heinanen jh@tutpro.com wrote:
SMP writes:
I'm trying to implement failover using the load_contacts/next_contacts
from
the lcr module. The problem I have is the INVITE message is sent simultaneously to both contact's instead of trying the first and then
the
second. I keep getting 'load_contacts(): DEBUG: Nothing to do - all
same
q!' when I've set them up with separate q values??
check what the value of your destination set ($ds) is before you call load_contacts().
Sure enough, lookup() is pulling them as the same q value. How do you get lookup("location") to recognize the q value stored in the db?
0(20824) Lookup done, Contact: sip:3125551234@xxx.xxx.129.144:5060;q=0, sip:3125551234@xxx.xxx.129.180:5060;q=0 0(20824) load_contacts(): DEBUG: Nothing to do - all same q! 0(20824) Contacts loaded Contact: sip:3125551234@xxx.xxx.129.144:5060;q=0, sip:3125551234@xxx.xxx.129.180:5060;q=0 0(20824) next_contacts(): DEBUG: No AVPs -- we are done!
Thanks, Shannon
-- juha
SMP writes:
Sure enough, lookup() is pulling them as the same q value. How do you get lookup("location") to recognize the q value stored in the db?
i'm not usrloc module expert, but my understanding is that if you insert records yourself to location table, you need to set usrloc db_mode to 3 (DB-Only scheme).
-- juha
Thanks and sorry I didn't post back sooner. I got it working now, appears the db column for 'q' was float(3,2) and needed to be float(10,2).
On 8/18/07, Juha Heinanen jh@tutpro.com wrote:
SMP writes:
Sure enough, lookup() is pulling them as the same q value. How do you
get
lookup("location") to recognize the q value stored in the db?
i'm not usrloc module expert, but my understanding is that if you insert records yourself to location table, you need to set usrloc db_mode to 3 (DB-Only scheme).
-- juha