Author Topic: Get Hostname in Yate  (Read 9970 times)

asymetrixs

  • Administrator
  • Newbie
  • *****
  • Posts: 47
    • View Profile
Get Hostname in Yate
« on: February 16, 2013, 03:28:55 PM »
Hi,

currently we write the hostname of our yate servers into the config files and use them for example in SQL statements like SELECT * FROM table WHERE yate_instance = 'yate1';
We do need this, because results from and operations on the DB depend on which yate-server is querying.

This is very odd, because each server needs it's own set of configuration files just for the hostname.

It would be great if there would be a property on the message object like nodename (which is already present in some handlers) which is available globally. Maybe not to confuse both and influence existing yate installations it could be a new property called "hostname".
We do use it in
- user.register
- engine.timer
- call.preroute
- call.route
- call.cdr (initquery, cdr_initialize, cdr_update, cdr_finalize)
- accounts (initquery, timerquery, statusquery)

I already talked with Paul with that but we did not come to a conclusion so far. He suggested to write a small module for that.

For anyone who just needs it in CDR, you can put this in regexroute.conf
Code: [Select]
[contexts]
.*=;nodename=$(nodename)


Who else is interested in this?
Null-Team what do you think?