[SR-Users] Re: change A number using a pool of numbers

2023-08-03 Thread Kaufman
Certainly app_lua (or any scripting language plugin, or KEMI, or system call) 
can do this, but that quickly falls out of scope of "Kamailio doing it" and 
into having an external program do it.  Most modules that would have 
functionality that requires "look up criteria based on a value" rely on a 
database. The specific request (grab a random entry based on criteria) is a 
combination of easily achieved with an order by some type of DB and not a 
common enough scenario for someone to have build a dediated module.

As far as speed goes, I'm not really sure what you could make that would be 
faster than pulling a random member out of redis.

Kaufman


From: Ali Taher 
Sent: Thursday, August 3, 2023 1:32 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: change A number using a pool of numbers


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Thanks Kaufman,

Relying on DB is of course one way to do it, but I thought that there are some 
modules that could be used and are faster, like app_lua but I'm not sure if it 
can be used to select a number randomly from a pool saved in a file.

Regards,


From: Kaufman mailto:bkauf...@bcmone.com>>
Sent: Wednesday, August 2, 2023 7:36 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] Re: change A number using a pool of numbers

There's functionally two parts to this question:


  1.  How to change a number
  2.  How to select a random number

For selection of the number it's probably easiest to rely on DB lookup. With 
one column as the original number and another column as the possible 
replacement numbers, then just select with an order by random to get the 
replacement number.

As far as changing the number, it can depend on specifically what number you're 
trying to change.  The RURI can be changed just by setting $rU.  Values in the 
To: or From: headers should be changed with the functions from the UAC module 
so that replies can have the original values restored.  For other miscellaneous 
headers like P-Asserted-Identity, just remove the old header and append a new 
one.

Regards,
Kaufman


From: Ali Taher mailto:ata...@vanrise.com>>
Sent: Wednesday, August 2, 2023 1:20 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] change A number using a pool of numbers


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello,

I'm looking to change the A number (from number) to a number selected randomly 
from a pool of existing numbers (hundreds) and then relay the call to a certain 
gateway.

What is the best and more efficient way to do it in kamailio?

Thanks in advance
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Setting up rtpengine to relay RTP

2023-08-03 Thread Henning Westerholt
Hello,

have you also enabled WITH_NAT? In the default cfg its required to get 
rtpengine.

Cheers,

Henning

-- 
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

> -Original Message-
> From: Alvaro Escobar 
> Sent: Mittwoch, 2. August 2023 05:19
> To: sr-users@lists.kamailio.org
> Subject: [SR-Users] Setting up rtpengine to relay RTP
> 
> Hello
> I have debian 11 with kamailio 5.6.4 (x86_64/linux).
> The kamailio is working fine.
> Now I need to setup rtprngine to relay RTP.
> I have installed the rtpengine using this guide: https://dfx.at/rtpengine/
> Version:  10.5.4.3-1+b1
> When I run: systemctl status rtpengine-daemon I got:
> ● rtpengine-daemon.service - RTP/media Proxy Daemon
>  Loaded: loaded (/lib/systemd/system/rtpengine-daemon.service; enabled;
> vendor preset: enabled)
>  Active: active (running) since Tue 2023-08-01 20:58:23 -05; 51min ago
>Docs: man:rtpengine(8)
> Process: 468 ExecStartPre=/usr/sbin/rtpengine-iptables-setup start
> (code=exited, status=0/SUCCESS)
>Main PID: 535 (rtpengine)
>   Tasks: 22 (limit: 2323)
>  Memory: 42.1M
> CPU: 720ms
>  CGroup: /system.slice/rtpengine-daemon.service
>  └─535 /usr/bin/rtpengine -f -E --no-log-timestamps --pidfile
> /run/rtpengine/rtpengine-daemon.pid --config-file
> /etc/rtpengine/rtpengine.conf
> 
> Aug 01 20:58:22 debian systemd[1]: Starting RTP/media Proxy Daemon...
> Aug 01 20:58:23 debian rtpengine[535]: INFO: [crypto] Generating new DTLS
> certificate Aug 01 20:58:23 debian rtpengine[535]: INFO: [core] Startup
> complete, version 10.5.4.3-1+b1 Aug 01 20:58:23 debian systemd[1]: Started
> RTP/media Proxy Daemon.
> Aug 01 20:58:23 debian rtpengine[535]: INFO: [http] Websocket listener
> thread running
> 
> I edited /etc/kamailio/kamailo.cfg with:
> #!define WITH_RTPENGINE
> #!ifdef WITH_RTPENGINE
> loadmodule "rtpengine.so"
> modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223")
> 
> systemctl restart kamilio
> 
> To check if the rtpengine module is running:
> kamcmd core.modules
> I got:
> permissions
> auth_db
> auth
> counters
> acc
> cfg_rpc
> ctl
> sanity
> xlog
> siputils
> textopsx
> textops
> registrar
> usrloc
> maxfwd
> pv
> rr
> sl
> tmx
> tm
> corex
> kex
> jsonrpcs
> db_mysql
> 
> The point is that I don't see the rtpengine module.
> There is another way to check if the rtpengine module is running ?
> 
> Regards
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe
> send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the
> sender!
> Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: change A number using a pool of numbers

2023-08-03 Thread Ali Taher
Thanks Kaufman,

Relying on DB is of course one way to do it, but I thought that there are some 
modules that could be used and are faster, like app_lua but I'm not sure if it 
can be used to select a number randomly from a pool saved in a file.

Regards,


From: Kaufman 
Sent: Wednesday, August 2, 2023 7:36 PM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: change A number using a pool of numbers

There's functionally two parts to this question:


  1.  How to change a number
  2.  How to select a random number

For selection of the number it's probably easiest to rely on DB lookup. With 
one column as the original number and another column as the possible 
replacement numbers, then just select with an order by random to get the 
replacement number.

As far as changing the number, it can depend on specifically what number you're 
trying to change.  The RURI can be changed just by setting $rU.  Values in the 
To: or From: headers should be changed with the functions from the UAC module 
so that replies can have the original values restored.  For other miscellaneous 
headers like P-Asserted-Identity, just remove the old header and append a new 
one.

Regards,
Kaufman


From: Ali Taher mailto:ata...@vanrise.com>>
Sent: Wednesday, August 2, 2023 1:20 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] change A number using a pool of numbers


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello,

I'm looking to change the A number (from number) to a number selected randomly 
from a pool of existing numbers (hundreds) and then relay the call to a certain 
gateway.

What is the best and more efficient way to do it in kamailio?

Thanks in advance
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe: