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
Hi Omar
You can check this function from registrar module https://kamailio.org/docs/modules/5.8.x/modules/registrar.html#registrar.f.l...
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
Hello Samuel, I apreciate your response and I would like to clear my request that I want to route SIP message to different user wich is not included in URI, and lookup function just dealing with pseudo-variables and I wand to relay to static user like "test". May could you give me more information about it please?
Thank you,
From: SAMUEL MOYA TINOCO smoya@vivelibre.es Sent: Tuesday, April 2, 2024 12:29 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Cc: o.atef@fiberme.com Subject: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Hi Omar
You can check this function from registrar module https://kamailio.org/docs/modules/5.8.x/modules/registrar.html#registrar.f.l ookup
I use it to send SIP messages to several endpoints
De: Omar Atef via sr-users <sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org > Enviado el: martes, 2 de abril de 2024 11:40 Para: sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org CC: o.atef@fiberme.com mailto: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
Maybe you could try with uac module and this function https://www.kamailio.org/docs/modules/devel/modules/uac.html#uac.f.uac_repla...
Samuel Moya Tinoco Departamento de Sistemas y Redes Móvil: (+34) 606985997 smoya@vivelibre.esmailto:smoya@vivelibre.es
[cid:image003.png@01DA84FB.AFAED7E0]
Soluciones inteligentes para la autonomía personal
De: o.atef@fiberme.com o.atef@fiberme.com Enviado el: martes, 2 de abril de 2024 12:38 Para: SAMUEL MOYA TINOCO smoya@vivelibre.es; 'Kamailio (SER) - Users Mailing List' sr-users@lists.kamailio.org Asunto: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Hello Samuel, I apreciate your response and I would like to clear my request that I want to route SIP message to different user wich is not included in URI, and lookup function just dealing with pseudo-variables and I wand to relay to static user like "test". May could you give me more information about it please?
Thank you, From: SAMUEL MOYA TINOCO <smoya@vivelibre.esmailto:smoya@vivelibre.es> Sent: Tuesday, April 2, 2024 12:29 PM To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Cc: o.atef@fiberme.commailto:o.atef@fiberme.com Subject: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Hi Omar
You can check this function from registrar module https://kamailio.org/docs/modules/5.8.x/modules/registrar.html#registrar.f.l...
I use it to send SIP messages to several endpoints
De: Omar Atef via sr-users <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Enviado el: martes, 2 de abril de 2024 11:40 Para: sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org CC: o.atef@fiberme.commailto: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
Well, with function I gonna replace the TO header, but all what I need is just relay SIP messages throw the user test as a trunk without modifying the TO header.
Sorry for bothering you Im still beginner in Kamailio.
From: SAMUEL MOYA TINOCO smoya@vivelibre.es Sent: Tuesday, April 2, 2024 12:45 PM To: o.atef@fiberme.com; 'Kamailio (SER) - Users Mailing List' sr-users@lists.kamailio.org Subject: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Maybe you could try with uac module and this function https://www.kamailio.org/docs/modules/devel/modules/uac.html#uac.f.uac_repla ce_to
Samuel Moya Tinoco
Departamento de Sistemas y Redes
Móvil: (+34) 606985997
mailto:smoya@vivelibre.es smoya@vivelibre.es
Soluciones inteligentes para la autonomía personal
De: o.atef@fiberme.com mailto:o.atef@fiberme.com <o.atef@fiberme.com mailto:o.atef@fiberme.com > Enviado el: martes, 2 de abril de 2024 12:38 Para: SAMUEL MOYA TINOCO <smoya@vivelibre.es mailto:smoya@vivelibre.es >; 'Kamailio (SER) - Users Mailing List' <sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org > Asunto: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Hello Samuel, I apreciate your response and I would like to clear my request that I want to route SIP message to different user wich is not included in URI, and lookup function just dealing with pseudo-variables and I wand to relay to static user like test. May could you give me more information about it please?
Thank you,
From: SAMUEL MOYA TINOCO <smoya@vivelibre.es mailto:smoya@vivelibre.es > Sent: Tuesday, April 2, 2024 12:29 PM To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org > Cc: o.atef@fiberme.com mailto:o.atef@fiberme.com Subject: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Hi Omar
You can check this function from registrar module https://kamailio.org/docs/modules/5.8.x/modules/registrar.html#registrar.f.l ookup
I use it to send SIP messages to several endpoints
De: Omar Atef via sr-users <sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org > Enviado el: martes, 2 de abril de 2024 11:40 Para: sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org CC: o.atef@fiberme.com mailto: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
Then you have to use the first function I told you from the module registrar. If you look at the example from the docs you can use the case 1 "contacts found and returned" to create a switch and relay your sip messages when is case 1 Something like this
lookup("location"); switch ($retcode) {
case 1: t_relay(); case -3: sl_send_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Not Found"); exit; };
Samuel Moya Tinoco Departamento de Sistemas y Redes Móvil: (+34) 606985997 smoya@vivelibre.esmailto:smoya@vivelibre.es
[cid:image003.png@01DA84FE.FD11E920]
Soluciones inteligentes para la autonomía personal
De: o.atef@fiberme.com o.atef@fiberme.com Enviado el: martes, 2 de abril de 2024 12:51 Para: SAMUEL MOYA TINOCO smoya@vivelibre.es; 'Kamailio (SER) - Users Mailing List' sr-users@lists.kamailio.org Asunto: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Well, with function I gonna replace the TO header, but all what I need is just relay SIP messages throw the user "test" as a trunk without modifying the TO header. Sorry for bothering you I'm still beginner in Kamailio. From: SAMUEL MOYA TINOCO <smoya@vivelibre.esmailto:smoya@vivelibre.es> Sent: Tuesday, April 2, 2024 12:45 PM To: o.atef@fiberme.commailto:o.atef@fiberme.com; 'Kamailio (SER) - Users Mailing List' <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Subject: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Maybe you could try with uac module and this function https://www.kamailio.org/docs/modules/devel/modules/uac.html#uac.f.uac_repla...
Samuel Moya Tinoco Departamento de Sistemas y Redes Móvil: (+34) 606985997 smoya@vivelibre.esmailto:smoya@vivelibre.es
[cid:image003.png@01DA84FE.FD11E920]
Soluciones inteligentes para la autonomía personal
De: o.atef@fiberme.commailto:o.atef@fiberme.com <o.atef@fiberme.commailto:o.atef@fiberme.com> Enviado el: martes, 2 de abril de 2024 12:38 Para: SAMUEL MOYA TINOCO <smoya@vivelibre.esmailto:smoya@vivelibre.es>; 'Kamailio (SER) - Users Mailing List' <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Asunto: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Hello Samuel, I apreciate your response and I would like to clear my request that I want to route SIP message to different user wich is not included in URI, and lookup function just dealing with pseudo-variables and I wand to relay to static user like "test". May could you give me more information about it please?
Thank you, From: SAMUEL MOYA TINOCO <smoya@vivelibre.esmailto:smoya@vivelibre.es> Sent: Tuesday, April 2, 2024 12:29 PM To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Cc: o.atef@fiberme.commailto:o.atef@fiberme.com Subject: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Hi Omar
You can check this function from registrar module https://kamailio.org/docs/modules/5.8.x/modules/registrar.html#registrar.f.l...
I use it to send SIP messages to several endpoints
De: Omar Atef via sr-users <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Enviado el: martes, 2 de abril de 2024 11:40 Para: sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org CC: o.atef@fiberme.commailto: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
Give the t_relay from TM module a try to relay messages statefully, you can specify the IP and Port you want to relay messages to incase you do not want to relay based on the RURI. ________________________________ From: Omar Atef via sr-users sr-users@lists.kamailio.org Sent: Tuesday, April 2, 2024 2:51:24 PM To: 'SAMUEL MOYA TINOCO' smoya@vivelibre.es; 'Kamailio (SER) - Users Mailing List' sr-users@lists.kamailio.org Cc: o.atef@fiberme.com o.atef@fiberme.com Subject: [SR-Users] Re: How to relay SIP messages to specific registered user in Kamailio?
Well, with function I gonna replace the TO header, but all what I need is just relay SIP messages throw the user “test” as a trunk without modifying the TO header.
Sorry for bothering you I’m still beginner in Kamailio.
From: SAMUEL MOYA TINOCO smoya@vivelibre.es Sent: Tuesday, April 2, 2024 12:45 PM To: o.atef@fiberme.com; 'Kamailio (SER) - Users Mailing List' sr-users@lists.kamailio.org Subject: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Maybe you could try with uac module and this function https://www.kamailio.org/docs/modules/devel/modules/uac.html#uac.f.uac_repla...
Samuel Moya Tinoco
Departamento de Sistemas y Redes
Móvil: (+34) 606985997
smoya@vivelibre.esmailto:smoya@vivelibre.es
[cid:image003.png@01DA84FC.77C53990]
Soluciones inteligentes para la autonomía personal
De: o.atef@fiberme.commailto:o.atef@fiberme.com <o.atef@fiberme.commailto:o.atef@fiberme.com> Enviado el: martes, 2 de abril de 2024 12:38 Para: SAMUEL MOYA TINOCO <smoya@vivelibre.esmailto:smoya@vivelibre.es>; 'Kamailio (SER) - Users Mailing List' <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Asunto: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Hello Samuel, I apreciate your response and I would like to clear my request that I want to route SIP message to different user wich is not included in URI, and lookup function just dealing with pseudo-variables and I wand to relay to static user like “test“. May could you give me more information about it please?
Thank you,
From: SAMUEL MOYA TINOCO <smoya@vivelibre.esmailto:smoya@vivelibre.es> Sent: Tuesday, April 2, 2024 12:29 PM To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Cc: o.atef@fiberme.commailto:o.atef@fiberme.com Subject: RE: [SR-Users] How to relay SIP messages to specific registered user in Kamailio?
Hi Omar
You can check this function from registrar module https://kamailio.org/docs/modules/5.8.x/modules/registrar.html#registrar.f.l...
I use it to send SIP messages to several endpoints
De: Omar Atef via sr-users <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Enviado el: martes, 2 de abril de 2024 11:40 Para: sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org CC: o.atef@fiberme.commailto: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
Omar,
Lookup - function you're looking for https://www.kamailio.org/docs/modules/devel/modules/registrar.html#registrar...
Le mar. 2 avr. 2024 à 12:30, Omar Atef via sr-users < sr-users@lists.kamailio.org> a écrit :
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
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hello Ihor,
Thanks for your replay. Lookup is depending on pseudo-variables and in my case I want to lookup for a static user "test" which is not included in the R-uri or not even the request SIP message.
So is there any another way to do it?
Hi Omar
Thanks for your replay. Lookup is depending on pseudo-variables and in my case I want to lookup for a static user "test" which is not included in the R-uri or not even the request SIP message.
So is there any another way to do it?
Not sure what you exactly want to do. You want to add an additional branch to the ones you got from the location lookup?
https://kamailio.org/docs/modules/devel/modules/corex.html#corex.f.append_br...
Mit freundlichen Grüssen
-Benoît Panizzon-
Thanks guys for the inspiration, I just modified the R-uri like that: $rU="test" and then used lookup("location"). So finally it's working now thank you very much for all of you.