Hi Omar

 

You can check this function from registrar module https://kamailio.org/docs/modules/5.8.x/modules/registrar.html#registrar.f.lookup

 

I use it to send SIP messages to several endpoints

 

 

De: Omar Atef via sr-users <sr-users@lists.kamailio.org>
Enviado el: martes, 2 de abril de 2024 11:40
Para: sr-users@lists.kamailio.org
CC: o.atef@fiberme.com
Asunto: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?

 

Hello guys,

I'm recently new player in Kamailio SIP server and want to use it as SIP proxy server to Asterisk PBX server.

first of all, I've successfully registered my Asterisk to Kamailio as user "test" to get its "location" because my Asterisk is behind NAT.

Simply now I want to relay SIP messages to this user's location to receive them all in Asterisk. After I searched, I found this function rewritehost() but it needs to be a host or IP address, but in my case I want some way or function to relay to user "test" and then it well get the user location from Kamailio datebase automatically?


I hope it's clear XD

I tried to find a way to do MSQL query in kamalio.cfg to get the user contact from "location" table and then relay to the result but it did not work. I guess that I did it in wrong way but finally the Kamailio tutorials are so rare on google.

Thanks in advance,
Omar