[SR-Users] unexpected error log when KSR.xhttp.xhttp_reply(404...)

2022-05-04 Thread hanxiaofang
Hello Kamailio community kamailio v5.5.4 debian10 Lua Scripting Routing: listen=tcp:127.0.0.1:5060 tcp_accept_no_cl=yes loadmodule "xhttp.so" loadmodule "app_lua.so" modparam("app_lua", "load", "/etc/kamailio/kamailio.lua") cfgengine "lua" function ksr_xhttp_event() KSR.set_reply_no_connect

Re: [SR-Users] Tips on picking random element from a list

2022-05-04 Thread Ben Kaufman
Without any external dependencies. Not sure how you're populating your pool of numbers for the caller id, but this generally works: ``` ## Populate your list however you want: $(avp(cid)) = "1551000"; $(avp(cid)) = "1551001"; $(avp(cid)) = "1551002"; $(avp(cid)) =

Re: [SR-Users] Tips on picking random element from a list

2022-05-04 Thread Fred Posner
If you were choosing random numbers from a pool of numbers, you could always lets say store the caller-id's in redis, connect kamailio to redis, and just use the RANDOMKEY function of redis to return a caller id. Fred Posner | palner.com o: +1 (212) 937-7844 On 5/4/22 15:43, Ben Kaufman wrote:

Re: [SR-Users] Tips on picking random element from a list

2022-05-04 Thread Ben Kaufman
How "random" do you need to be here? Given your example, a quick thought would be to just iterate over a list, using a counter and calculating the modulo (remainder) when dividing it by the number of elements you have. Another thought would be to use the core_hash() function over the call-id. h

Re: [SR-Users] sanity_reply not available from sanity module

2022-05-04 Thread Patrick Karton
Thanks! De : Daniel-Constantin Mierla Envoyé : mercredi 4 mai 2022 14:35 À : Kamailio (SER) - Users Mailing List ; Patrick Karton Objet : Re: [SR-Users] sanity_reply not available from sanity module Hello, indeed there was an error with the exported function

Re: [SR-Users] sanity_reply not available from sanity module

2022-05-04 Thread Daniel-Constantin Mierla
Hello, indeed there was an error with the exported function name. I pushed a commit for it:   * https://github.com/kamailio/kamailio/commit/7c52c05b09abdf2cf754cc02f3a1ea0855cdedd0 It will be backported. Cheers, Daniel On 04.05.22 15:55, Patrick Karton wrote: > Hello ,  > > the sanity_rep

[SR-Users] sanity_reply not available from sanity module

2022-05-04 Thread Patrick Karton
Hello , the sanity_reply function from sanity is not available in kamailio script so i get an error when i want to use it. in the module source i see this static cmd_export_t cmds[] = { {"sanity_check", (cmd_function)w_sanity_check, 0, 0, 0, REQUEST_ROUTE|ONREPLY_ROUTE}, {"sanity_check", (cmd_

Re: [SR-Users] FAILEDOVER ROUTING WITH DNS SRV Records

2022-05-04 Thread Fred Posner
On 5/4/22 05:08, Patrick Karton wrote: Hello, [snip] what i want is that all the ips resolved are tried until one succeeds. is there something to do to achieve that ? do i need to interact with failure route to try next ips ? https://github.com/kamailio/kamailio/blob/master/doc/tutorials/d

[SR-Users] iterating over htable with lua

2022-05-04 Thread David Villasmil
Hello guys, I'm trying to iterate over an htable in lus, this is what i have: === loadmodule "app_lua.so" modparam("app_lua", "load", "/etc/kamailio/myscript.lua") modparam("htable", "htable", "mydata=>size=16;autoexpire=0;dbtable=mydata;dbmode=0;") route { lu

[SR-Users] FAILEDOVER ROUTING WITH DNS SRV Records

2022-05-04 Thread Patrick Karton
Hello, im using kamaliio 5.5.3 and I want to do failedover routing with DNS SRV Records. in my lab i have these SRV records ;; ANSWER SECTION: voip.oov-obs-tools-dev.svc.cluster.local. 5 IN SRV 0 33 5060 100-68-7-74.voip.oov-obs-tools-dev.svc.cluster.local. voip.oov-obs-tools-dev.svc.cluster.l

Re: [SR-Users] function 'sl_send_reply' is not available

2022-05-04 Thread David Villasmil
Cool, thanks! On Tue, 3 May 2022 at 14:27, Yuriy Gorlichenko wrote: > Done it for myself but might be will be useful too: > There are some helpers and tools might be reused for some who uses lua > https://github.com/ovoshlook/kemi-lua-utils-and-tools > > вт, 3 мая 2022 г. в 13:28, David Villasmi