Hi everyone
I'm trying to implement OpenSIPS-like mid registrar functionality using UAC module
Up to now, I was simply performing authentication on my kamailio instance, saving to local domain and forwarding the request to another proxy I'd like to lower the number of requests sent to this other proxy, by forwarding only a few of the incoming requests. This is not a problem to do, but then comes the handling of expiration. If the SIP UAC is disconnected, the registration expires on my kamailio instance, but I don't know how to correctly notify the other proxy on the unregistration (I was trying to build and send a request using uac_send_req(), but this is useless as I can't set the CSeq value)
While looking for a solution to my problem, I discovered that OpenSIPS had a mid registrar module doing exactly what I'd like to do (according to the documentation at least). I also saw old messages on this list that it was possible to achieve the same result with UAC module on kamailio
In particular, I don't see why (or if) I need to populate the uacreg table. I don't see why it should be necessary, and it would have a great impact on performance to use a db for this matter. I also don't need (I think) to have different local and remote from and to URIs
I think I need to build the a new REGISTER request using $uac_req, but I don't see any contact header in the outgoing request, despite having set reg_contact_addr value
Thanks for any clue you could give me
wrong list
--- I'm SoCIaL, MayBe
On 5/15/20 16:50, Easy Rider wrote:
Hi everyone
I'm trying to implement OpenSIPS-like mid registrar functionality using UAC module
Up to now, I was simply performing authentication on my kamailio instance, saving to local domain and forwarding the request to another proxy I'd like to lower the number of requests sent to this other proxy, by forwarding only a few of the incoming requests. This is not a problem to do, but then comes the handling of expiration. If the SIP UAC is disconnected, the registration expires on my kamailio instance, but I don't know how to correctly notify the other proxy on the unregistration (I was trying to build and send a request using uac_send_req(), but this is useless as I can't set the CSeq value)
While looking for a solution to my problem, I discovered that OpenSIPS had a mid registrar module doing exactly what I'd like to do (according to the documentation at least). I also saw old messages on this list that it was possible to achieve the same result with UAC module on kamailio
In particular, I don't see why (or if) I need to populate the uacreg table. I don't see why it should be necessary, and it would have a great impact on performance to use a db for this matter. I also don't need (I think) to have different local and remote from and to URIs
I think I need to build the a new REGISTER request using $uac_req, but I don't see any contact header in the outgoing request, despite having set reg_contact_addr value
Thanks for any clue you could give me
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Are you sure it's the wrong list?
1) OP said "OpenSIPS-like" --
2) OP said: "I discovered that OpenSIPS had a mid registrar module doing exactly what I'd like to do (according to the documentation at least). I also saw old messages on this list that it was possible to achieve the same result with UAC module on kamailio."
Sounds like you didn't read carefully! No worries, I am guilty of that all the time on this very list. :-)
-- Alex
On 5/15/20 6:00 PM, Social Boh wrote:
wrong list
I'm SoCIaL, MayBe
On 5/15/20 16:50, Easy Rider wrote:
Hi everyone
I'm trying to implement OpenSIPS-like mid registrar functionality using UAC module
Up to now, I was simply performing authentication on my kamailio instance, saving to local domain and forwarding the request to another proxy I'd like to lower the number of requests sent to this other proxy, by forwarding only a few of the incoming requests. This is not a problem to do, but then comes the handling of expiration. If the SIP UAC is disconnected, the registration expires on my kamailio instance, but I don't know how to correctly notify the other proxy on the unregistration (I was trying to build and send a request using uac_send_req(), but this is useless as I can't set the CSeq value)
While looking for a solution to my problem, I discovered that OpenSIPS had a mid registrar module doing exactly what I'd like to do (according to the documentation at least). I also saw old messages on this list that it was possible to achieve the same result with UAC module on kamailio
In particular, I don't see why (or if) I need to populate the uacreg table. I don't see why it should be necessary, and it would have a great impact on performance to use a db for this matter. I also don't need (I think) to have different local and remote from and to URIs
I think I need to build the a new REGISTER request using $uac_req, but I don't see any contact header in the outgoing request, despite having set reg_contact_addr value
Thanks for any clue you could give me
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello,
On 15.05.20 23:50, Easy Rider wrote:
Hi everyone
I'm trying to implement OpenSIPS-like mid registrar functionality using UAC module
Up to now, I was simply performing authentication on my kamailio instance, saving to local domain and forwarding the request to another proxy I'd like to lower the number of requests sent to this other proxy, by forwarding only a few of the incoming requests. This is not a problem to do, but then comes the handling of expiration. If the SIP UAC is disconnected, the registration expires on my kamailio instance, but I don't know how to correctly notify the other proxy on the unregistration (I was trying to build and send a request using uac_send_req(), but this is useless as I can't set the CSeq value)
Have you tried by setting the CSeq header inside $uac_req(hdrs)?
Then there is the option with t_uac_send() from tm module:
* https://www.kamailio.org/docs/modules/stable/modules/tm.html#tm.f.t_uac_send
While looking for a solution to my problem, I discovered that OpenSIPS had a mid registrar module doing exactly what I'd like to do (according to the documentation at least). I also saw old messages on this list that it was possible to achieve the same result with UAC module on kamailio
In particular, I don't see why (or if) I need to populate the uacreg table. I don't see why it should be necessary, and it would have a great impact on performance to use a db for this matter. I also don't need (I think) to have different local and remote from and to URIs
This kind of mapping allows more flexibility, you can set the same username/domain for remote and local users. But you can also have mapping on different providers. So I can run my kamailio at asipto.com with user id daniel@asipto.com, which can be then mapped to TELNUMBER@sipgate.com. So my kamailio registers to sipgate.com server with TELNUMBER and when someone is calling from PSTN the TELNUMBER, the call is forwarded to my kamailio at asipto.com, which will route it further to my phone daniel@asipto.com.
If you have same user id, the you can eventually skip uac_reg_lookup().
I think I need to build the a new REGISTER request using $uac_req, but I don't see any contact header in the outgoing request, despite having set reg_contact_addr value
The $uac_req(...) variable and uac_req_send() function are from the same uac module but they are independent of uac_reg_*() functions and uacreg db table. You have to add the Contact header in $uac_req(hdrs) if you want it the REGISTER generated with $uac_req(...) variable and uac_req_send() function (or with t_uac_send() from tm).
If you go with the uacreg db table and uac_reg_*() functions, then on unregister from end point you can use uac_req_disable() to perform unregister to the remote server. Then there is uac_req_enable() to get it back registered to the remote server when new registration comes from end point.
When a registrations expires due to time out, you can have an event_route executed from usrloc module where you can do uac_req_disable().
I think you have all the pieces that you need to enable/disable registrations to remote server based on registration/unregistration of the end point. By setting a larger expires value inside uacreg table, you should achieve what you look for.
Cheers, Daniel
Thanks for the answer, very helpful
On 16.05.2020 11:02, Daniel-Constantin Mierla wrote :
Have you tried by setting the CSeq header inside $uac_req(hdrs)?
I tried, it simply adds another CSeq header, not replacing the generated one (I also tried with User-Agent header) I may have to replace it manually on tm:local-request event route
Then there is the option with t_uac_send() from tm module:
https://www.kamailio.org/docs/modules/stable/modules/tm.html#tm.f.t_uac_send
I did not know about this uac from TM module I tried the function, but it doesn't seem to accept variables as parameters... I must be doing something wrong, it is almost useless if it can't be used with variables
Thanks
Hello,
On 16.05.20 23:56, Easy Rider wrote:
Thanks for the answer, very helpful
On 16.05.2020 11:02, Daniel-Constantin Mierla wrote :
Have you tried by setting the CSeq header inside $uac_req(hdrs)?
I tried, it simply adds another CSeq header, not replacing the generated one (I also tried with User-Agent header) I may have to replace it manually on tm:local-request event route
Then there is the option with t_uac_send() from tm module: * https://www.kamailio.org/docs/modules/stable/modules/tm.html#tm.f.t_uac_send
I did not know about this uac from TM module I tried the function, but it doesn't seem to accept variables as parameters... I must be doing something wrong, it is almost useless if it can't be used with variables
I looked at the code and it is supposed to evaluate variables. Can you show how you used the function and eventually what was sent to the network?
Cheers, Daniel
Hello
Le lun. 18 mai 2020 à 17:50, Daniel-Constantin Mierla miconda@gmail.com a écrit :
Hello, On 16.05.20 23:56, Easy Rider wrote:
Thanks for the answer, very helpful
On 16.05.2020 11:02, Daniel-Constantin Mierla wrote :
Have you tried by setting the CSeq header inside $uac_req(hdrs)?
I tried, it simply adds another CSeq header, not replacing the generated one (I also tried with User-Agent header) I may have to replace it manually on tm:local-request event route
Then there is the option with t_uac_send() from tm module:
https://www.kamailio.org/docs/modules/stable/modules/tm.html#tm.f.t_uac_send
I did not know about this uac from TM module I tried the function, but it doesn't seem to accept variables as parameters... I must be doing something wrong, it is almost useless if it can't be used with variables
I looked at the code and it is supposed to evaluate variables. Can you show how you used the function and eventually what was sent to the network?
Problem is solved, it was a mistake on my side (I don't know which one though...), and I can use variables with no problem Thanks a lot
Cheers, Daniel
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla
Hello,
On 18.05.20 22:42, Easy Rider wrote:
Hello
Le lun. 18 mai 2020 à 17:50, Daniel-Constantin Mierla <miconda@gmail.com mailto:miconda@gmail.com> a écrit :
Hello, On 16.05.20 23:56, Easy Rider wrote:
Thanks for the answer, very helpful On 16.05.2020 11:02, Daniel-Constantin Mierla wrote : Have you tried by setting the CSeq header inside $uac_req(hdrs)? I tried, it simply adds another CSeq header, not replacing the generated one (I also tried with User-Agent header) I may have to replace it manually on tm:local-request event route Then there is the option with t_uac_send() from tm module: * https://www.kamailio.org/docs/modules/stable/modules/tm.html#tm.f.t_uac_send I did not know about this uac from TM module I tried the function, but it doesn't seem to accept variables as parameters... I must be doing something wrong, it is almost useless if it can't be used with variables
I looked at the code and it is supposed to evaluate variables. Can you show how you used the function and eventually what was sent to the network?
Problem is solved, it was a mistake on my side (I don't know which one though...), and I can use variables with no problem Thanks a lot
Good to know it was sorted out and no issue in the code.
Cheers, Daniel