Hello,

someone published a npm package for etcd-based discovery service, which sounds similar to what you want to do:

  - https://www.kamailio.org/w/2015/10/kamailio-dispatcher-discovery-service-with-nodejs-and-etcd/

Alternative to dispatcher, you can also consider using rtjson module to push back destinations to kamailio in a json document via some API service.

But if you want to watch the state of destinations, then dispatcher is the way to go.

Cheers,
Daniel


On 31/01/2017 11:28, Casco, Alessio wrote:
Hello Daniel!

My goal is the following: I would like to use a service discovery application (consul is an example) that dynamically guides the kamailio back-ends. As soon as a new back-end registers into the discovery service, kamailio will start sending traffic to it.

Since writing a module is not an option right now, I though about using DNS and SRV records to achieve the same result, doing so I will be able to instruct kamailio dynamically, the idea of the dispatcher group, came in my mind only because I'd like to have something outside the main kamailio config, so in the case I have to change the name or do some adjustments, I don't have to restart the entire kamailio but use a RPC command for example.

Thanks
Alessio

On Mon, Jan 30, 2017 at 4:20 PM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:

Hello,

if you expect that dispatcher module will list the associated ip addresses with the hostname after a DNS SRV lookup, then this is not available.

Dispatcher module will still use the single hostname to set r-uri (or dst uri) and then TM module does the lookup before sending, inside t_relay(). Also, irc, the keepalive is sent only to the first ip resolved for a hostname.

If you want to relay on DNS SRV for loadbalancing, you don't need dispatcher at all, everything is done transparently for configuration file by tm and core.

Maybe you can detail a bit more what you want to achieve with dispatcher on this topic and we can think of alternatives,

Cheers,
Daniel


On 26/01/2017 11:34, Casco, Alessio wrote:
Thanks for your help,

Unfortunately with kamailio 4.4.4, dispatcher module and your suggestions, I still don't see the SRV record picked up (at least using the kamcmd  dispatcher.list command).

I didn't try the LCR module yet, I want to be sure first that dispatcher is not able to handle SRV first

Thanks
Alessio

On Wed, Jan 25, 2017 at 8:06 PM, Jeremy Gadd <jeremygadd@gmail.com> wrote:
Holy cow, sorry about that!

Put the hostname in dispatcher (no port or _sip._udp) and enable these:

use_dns_cache=on
use_dns_failover=on
dns_srv_lb=on

That's how I got it working (using the LCR module).

On Wed, Jan 25, 2017 at 1:05 PM, Jeremy Gadd <jeremygadd@gmail.com> wrote:
Put the hostname in dispatcher (no port) and enable these:


On Wed, Jan 25, 2017 at 9:30 AM, Casco, Alessio <alessio.casco@nexmo.com> wrote:
Hello Guys!

I'd like to be able to use SRV records inside dispatcher groups, so I can automatise the discovery of new backends on my network using DNS

I've tried with the following formats into the dispatcher.list file:

$group  _sip._udp.sip-voice_backends
$group  sip-voice_backends

and none looks to be working, running the kamailio_ctl dispatcher.list   won't show me the group set with SRV records. ( I also try NAPTR records, with no luck as well.)

* Does the dispatcher module support SRV or NAPTR records? (maybe my format is not correct) 
* If not, do you have any other idea on what I could do to achieve what I'd like to do?

Thanks
Alessio


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com