Dan,
The uac_req_send() function uses values that have been set up in pseudo variables.
In the cfg file it would look like this (for example):
$uac_req(method) = "REGISTER"
$uac_req(ruri) = "sip:dan@example.com"
$uac_req(furi) = "sip:dan@example.com"
$uac_req(turi) = "sip:dan@example.com"
$uac_req(ouri) = "sip:app_svr.example.com"
$uac_req(hdrs) = "Contact: $ct\r\nX-Custom-Hdr: abc123\r\n"
uac_req_send()
To do this is a LUA script, you need to set the PVs and then call the function. The "modf" LUA function can be used to call functions as if they were in the main configuration file.
sr.pv.sets("$uac_req(method)", "REGISTER")
sr.pv.sets("$uac_req(ruri)", "sip:dan@example.com")
.
sr.modf("uac_req_send")
Regards,
Hugh
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel Ciprus Sent: 11 April 2014 14:50 To: miconda@gmail.com; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] LUA - UAC package implementation
uac_req() and uac_req_senf(). Is that doable with other functions ? Again, this has to be independent REGISTER (ISC interface functionality).
On 04/11/2014 06:16 AM, Daniel-Constantin Mierla wrote:
Hello,
what other functions do you need from uac module? uac_req_send() has no parameter and can be executed with sr.modf() from lua.
For functions with parameters, you would need to extend the lua api to be safe.
Cheers, Daniel
On 11/04/14 05:54, Daniel Ciprus wrote:
Hi,
How much of UAC package is implemented in LUA embedded module ? According to wiki seems like only "sr.uac.replace_from" is implemented. My goal is to "emulate" 3rd party registration by using UAC and LUA meaning that I will have to recreate register, tweak existing attributes and send it over to application server to process.
thanks Dan