opensips lua

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

opensips lua

OpenSIPS - Users mailing list
Hello Everyone,
Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp
Here are log 


Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012]

It insert #012

Lua script 

                local cmd_var = handle:read("*all")
                handle:close()
                xlog("Tested string ~> " .. cmd_var .. "\n")
                r eturn AVP_set("test-str", cmd_var)

Any help thank you

volga629

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

Vlad Patrascu

Hi Volga,

Sorry for getting to this so late. Do you still encounter this issue? I have tried to reproduce this myself but it seems that AVP_set() does set the value correctly.

Regards,

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 12/14/19 7:12 AM, volga629 via Users wrote:
Hello Everyone,
Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp
Here are log 


Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012]

It insert #012

Lua script 

                local cmd_var = handle:read("*all")
                handle:close()
                xlog("Tested string ~> " .. cmd_var .. "\n")
                r eturn AVP_set("test-str", cmd_var)

Any help thank you

volga629

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

OpenSIPS - Users mailing list
Hello Vlad,
Yes, it still in issue, but we have work around.  #012 it insert white spaces. 

$avp(sms-out) = $(avp(formatted-msg){s.trimr});

On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu <[hidden email]> wrote:

Hi Volga,

Sorry for getting to this so late. Do you still encounter this issue? I have tried to reproduce this myself but it seems that AVP_set() does set the value correctly.

Regards,

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 12/14/19 7:12 AM, volga629 via Users wrote:
Hello Everyone,
Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp
Here are log 


Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012]

It insert #012

Lua script 

                local cmd_var = handle:read("*all")
                handle:close()
                xlog("Tested string ~> " .. cmd_var .. "\n")
                r eturn AVP_set("test-str", cmd_var)

Any help thank you

volga629

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

Vlad Patrascu

I still don't think it is AVP_set function's fault for the whitespaces. Make sure that the string you produce in lua and want to return to opensips doesn't have a newline character at the end. It seems that syslog prints a newline as "#012" sometimes (if it's not actually at the end of a message).

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 1/13/20 3:26 PM, volga629 via Users wrote:
Hello Vlad,
Yes, it still in issue, but we have work around.  #012 it insert white spaces. 

$avp(sms-out) = $(avp(formatted-msg){s.trimr});

On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu [hidden email] wrote:

Hi Volga,

Sorry for getting to this so late. Do you still encounter this issue? I have tried to reproduce this myself but it seems that AVP_set() does set the value correctly.

Regards,

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 12/14/19 7:12 AM, volga629 via Users wrote:
Hello Everyone,
Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp
Here are log 


Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012]

It insert #012

Lua script 

                local cmd_var = handle:read("*all")
                handle:close()
                xlog("Tested string ~> " .. cmd_var .. "\n")
                r eturn AVP_set("test-str", cmd_var)

Any help thank you

volga629

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

OpenSIPS - Users mailing list
Hello Vlad,
In lua script  we use \n only in xlog.

this repository 


On Tue, Jan 14, 2020 at 13:37, Vlad Patrascu <[hidden email]> wrote:

I still don't think it is AVP_set function's fault for the whitespaces. Make sure that the string you produce in lua and want to return to opensips doesn't have a newline character at the end. It seems that syslog prints a newline as "#012" sometimes (if it's not actually at the end of a message).

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 1/13/20 3:26 PM, volga629 via Users wrote:
Hello Vlad,
Yes, it still in issue, but we have work around.  #012 it insert white spaces. 

$avp(sms-out) = $(avp(formatted-msg){s.trimr});

On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu [hidden email] wrote:

Hi Volga,

Sorry for getting to this so late. Do you still encounter this issue? I have tried to reproduce this myself but it seems that AVP_set() does set the value correctly.

Regards,

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 12/14/19 7:12 AM, volga629 via Users wrote:
Hello Everyone,
Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp
Here are log 


Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012]

It insert #012

Lua script 

                local cmd_var = handle:read("*all")
                handle:close()
                xlog("Tested string ~> " .. cmd_var .. "\n")
                r eturn AVP_set("test-str", cmd_var)

Any help thank you

volga629

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

OpenSIPS - Users mailing list
In reply to this post by Vlad Patrascu
Hello Vlad,
In lua script  we use \n only in xlog.

this repository 


On Tue, Jan 14, 2020 at 13:37, Vlad Patrascu <[hidden email]> wrote:

I still don't think it is AVP_set function's fault for the whitespaces. Make sure that the string you produce in lua and want to return to opensips doesn't have a newline character at the end. It seems that syslog prints a newline as "#012" sometimes (if it's not actually at the end of a message).

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 1/13/20 3:26 PM, volga629 via Users wrote:
Hello Vlad,
Yes, it still in issue, but we have work around.  #012 it insert white spaces. 

$avp(sms-out) = $(avp(formatted-msg){s.trimr});

On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu [hidden email] wrote:

Hi Volga,

Sorry for getting to this so late. Do you still encounter this issue? I have tried to reproduce this myself but it seems that AVP_set() does set the value correctly.

Regards,

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 12/14/19 7:12 AM, volga629 via Users wrote:
Hello Everyone,
Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp
Here are log 


Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012]

It insert #012

Lua script 

                local cmd_var = handle:read("*all")
                handle:close()
                xlog("Tested string ~> " .. cmd_var .. "\n")
                r eturn AVP_set("test-str", cmd_var)

Any help thank you

volga629

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

Vlad Patrascu

You get the newline from the print() function in the python script that you call. I've tested with your script and for example this fixed it:

print(testing(),end="")

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 1/14/20 3:32 PM, volga629 via Users wrote:
Hello Vlad,
In lua script  we use \n only in xlog.

this repository 


On Tue, Jan 14, 2020 at 13:37, Vlad Patrascu [hidden email] wrote:

I still don't think it is AVP_set function's fault for the whitespaces. Make sure that the string you produce in lua and want to return to opensips doesn't have a newline character at the end. It seems that syslog prints a newline as "#012" sometimes (if it's not actually at the end of a message).

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 1/13/20 3:26 PM, volga629 via Users wrote:
Hello Vlad,
Yes, it still in issue, but we have work around.  #012 it insert white spaces. 

$avp(sms-out) = $(avp(formatted-msg){s.trimr});

On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu [hidden email] wrote:

Hi Volga,

Sorry for getting to this so late. Do you still encounter this issue? I have tried to reproduce this myself but it seems that AVP_set() does set the value correctly.

Regards,

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 12/14/19 7:12 AM, volga629 via Users wrote:
Hello Everyone,
Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp
Here are log 


Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012]

It insert #012

Lua script 

                local cmd_var = handle:read("*all")
                handle:close()
                xlog("Tested string ~> " .. cmd_var .. "\n")
                r eturn AVP_set("test-str", cmd_var)

Any help thank you

volga629

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

OpenSIPS - Users mailing list
Hello Vlad,
Thank you for pointing out. I adjusted as following and it resolve the issue 

if sys.argv[2] == "encode":
    print(encoding().strip())
elif sys.argv[2] == "decode":
    print(decoding().strip())
elif sys.argv[2] == "test":
    print(testing().strip())

volga629

On Tue, Jan 14, 2020 at 17:03, Vlad Patrascu <[hidden email]> wrote:

You get the newline from the print() function in the python script that you call. I've tested with your script and for example this fixed it:

print(testing(),end="")

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 1/14/20 3:32 PM, volga629 via Users wrote:
Hello Vlad,
In lua script  we use \n only in xlog.

this repository 


On Tue, Jan 14, 2020 at 13:37, Vlad Patrascu [hidden email] wrote:

I still don't think it is AVP_set function's fault for the whitespaces. Make sure that the string you produce in lua and want to return to opensips doesn't have a newline character at the end. It seems that syslog prints a newline as "#012" sometimes (if it's not actually at the end of a message).

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 1/13/20 3:26 PM, volga629 via Users wrote:
Hello Vlad,
Yes, it still in issue, but we have work around.  #012 it insert white spaces. 

$avp(sms-out) = $(avp(formatted-msg){s.trimr});

On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu [hidden email] wrote:

Hi Volga,

Sorry for getting to this so late. Do you still encounter this issue? I have tried to reproduce this myself but it seems that AVP_set() does set the value correctly.

Regards,

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 12/14/19 7:12 AM, volga629 via Users wrote:
Hello Everyone,
Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp
Here are log 


Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012]

It insert #012

Lua script 

                local cmd_var = handle:read("*all")
                handle:close()
                xlog("Tested string ~> " .. cmd_var .. "\n")
                r eturn AVP_set("test-str", cmd_var)

Any help thank you

volga629

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

OpenSIPS - Users mailing list
Hello Vlad,
In latest master  was added support for 5.2 and 5.3, wrapper  produce error.
So it can't open python scripts.


Any help thank you.

Jan 24 17:24:35 dev1-fr /usr/sbin/opensips[26796]: siplua: encode:UTF16BE:fjhqqq
Jan 24 17:24:35 dev1-fr /usr/sbin/opensips[26796]: siplua: siplua error running function arg_function: /etc/opensips/scripts/convert.lua:15: attempt to index a nil value (global 'io')
Jan 24 17:24:35 dev1-fr /usr/sbin/opensips[26796]: DBG:core:destroy_index_avp: AVP with the specified index not found

volga629

On Sun, Jan 19, 2020 at 10:11, volga629 via Users <[hidden email]> wrote:
Hello Vlad,
Thank you for pointing out. I adjusted as following and it resolve the issue 

if sys.argv[2] == "encode":
    print(encoding().strip())
elif sys.argv[2] == "decode":
    print(decoding().strip())
elif sys.argv[2] == "test":
    print(testing().strip())

volga629

On Tue, Jan 14, 2020 at 17:03, Vlad Patrascu <[hidden email]> wrote:

You get the newline from the print() function in the python script that you call. I've tested with your script and for example this fixed it:

print(testing(),end="")

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 1/14/20 3:32 PM, volga629 via Users wrote:
Hello Vlad,
In lua script  we use \n only in xlog.

this repository 


On Tue, Jan 14, 2020 at 13:37, Vlad Patrascu [hidden email] wrote:

I still don't think it is AVP_set function's fault for the whitespaces. Make sure that the string you produce in lua and want to return to opensips doesn't have a newline character at the end. It seems that syslog prints a newline as "#012" sometimes (if it's not actually at the end of a message).

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 1/13/20 3:26 PM, volga629 via Users wrote:
Hello Vlad,
Yes, it still in issue, but we have work around.  #012 it insert white spaces. 

$avp(sms-out) = $(avp(formatted-msg){s.trimr});

On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu [hidden email] wrote:

Hi Volga,

Sorry for getting to this so late. Do you still encounter this issue? I have tried to reproduce this myself but it seems that AVP_set() does set the value correctly.

Regards,

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 12/14/19 7:12 AM, volga629 via Users wrote:
Hello Everyone,
Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp
Here are log 


Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0
Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012]

It insert #012

Lua script 

                local cmd_var = handle:read("*all")
                handle:close()
                xlog("Tested string ~> " .. cmd_var .. "\n")
                r eturn AVP_set("test-str", cmd_var)

Any help thank you

volga629

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

Răzvan Crainea-2
Please open a ticket with this issue, as this seems to be a regression
during porting to lua 5.2/5.3.
In the meantime, please continue using lua5.1.

Best regards,
Răzvan

On 1/24/20 6:32 PM, volga629 via Users wrote:

> Hello Vlad,
> In latest master  was added support for 5.2 and 5.3, wrapper  produce error.
> So it can't open python scripts.
>
>
> Any help thank you.
>
> Jan 24 17:24:35 dev1-fr /usr/sbin/opensips[26796]: siplua:
> encode:UTF16BE:fjhqqq
> Jan 24 17:24:35 dev1-fr /usr/sbin/opensips[26796]: siplua: siplua error
> running function arg_function: /etc/opensips/scripts/convert.lua:15:
> attempt to index a nil value (global 'io')
> Jan 24 17:24:35 dev1-fr /usr/sbin/opensips[26796]:
> DBG:core:destroy_index_avp: AVP with the specified index not found
>
> volga629
>
> On Sun, Jan 19, 2020 at 10:11, volga629 via Users
> <[hidden email]> wrote:
>> Hello Vlad,
>> Thank you for pointing out. I adjusted as following and it resolve the
>> issue
>>
>> if sys.argv[2] == "encode":
>>     print(encoding().strip())
>> elif sys.argv[2] == "decode":
>>     print(decoding().strip())
>> elif sys.argv[2] == "test":
>>     print(testing().strip())
>>
>> volga629
>>
>> On Tue, Jan 14, 2020 at 17:03, Vlad Patrascu <[hidden email]> wrote:
>>>
>>> You get the newline from the print() function in the python script
>>> that you call. I've tested with your script and for example this
>>> fixed it:
>>>
>>> print(testing(),end="")
>>>
>>> Vlad Patrascu
>>> OpenSIPS Developer
>>> http://www.opensips-solutions.com
>>> On 1/14/20 3:32 PM, volga629 via Users wrote:
>>>> Hello Vlad,
>>>> In lua script  we use \n only in xlog.
>>>>
>>>> this repository
>>>>
>>>> https://github.com/VoIP-SAAS/opensips-smpp-lua
>>>>
>>>> On Tue, Jan 14, 2020 at 13:37, Vlad Patrascu <[hidden email]> wrote:
>>>>>
>>>>> I still don't think it is AVP_set function's fault for the
>>>>> whitespaces. Make sure that the string you produce in lua and want
>>>>> to return to opensips doesn't have a newline character at the end.
>>>>> It seems that syslog prints a newline as "#012" sometimes (if it's
>>>>> not actually at the end of a message).
>>>>>
>>>>> Vlad Patrascu
>>>>> OpenSIPS Developer
>>>>> http://www.opensips-solutions.com
>>>>> On 1/13/20 3:26 PM, volga629 via Users wrote:
>>>>>> Hello Vlad,
>>>>>> Yes, it still in issue, but we have work around.  #012 it insert
>>>>>> white spaces.
>>>>>>
>>>>>> $avp(sms-out) = $(avp(formatted-msg){s.trimr});
>>>>>>
>>>>>> On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu <[hidden email]>
>>>>>> wrote:
>>>>>>>
>>>>>>> Hi Volga,
>>>>>>>
>>>>>>> Sorry for getting to this so late. Do you still encounter this
>>>>>>> issue? I have tried to reproduce this myself but it seems that
>>>>>>> AVP_set() does set the value correctly.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Vlad Patrascu
>>>>>>> OpenSIPS Developer
>>>>>>> http://www.opensips-solutions.com
>>>>>>> On 12/14/19 7:12 AM, volga629 via Users wrote:
>>>>>>>> Hello Everyone,
>>>>>>>> Having some issue get lua to set proper avp.  When it set in
>>>>>>>> insert some extra characters into value of avp
>>>>>>>> Here are log
>>>>>>>>
>>>>>>>>
>>>>>>>> Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua:
>>>>>>>> test::wwwww nah.uy/u5bmnc
>>>>>>>> Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua:
>>>>>>>> Tested string ~>0
>>>>>>>> Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN:
>>>>>>>> Test string ~> [0#012]
>>>>>>>>
>>>>>>>> It insert #012
>>>>>>>>
>>>>>>>> Lua script
>>>>>>>>
>>>>>>>>                 local cmd_var = handle:read("*all")
>>>>>>>>                 handle:close()
>>>>>>>>                 xlog("Tested string ~> " .. cmd_var .. "\n")
>>>>>>>>                 r eturn AVP_set("test-str", cmd_var)
>>>>>>>>
>>>>>>>> Any help thank you
>>>>>>>>
>>>>>>>> volga629
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Users mailing list
>>>>>>>> [hidden email]
>>>>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>>
>>>>>> _______________________________________________
>>>>>> Users mailing list
>>>>>> [hidden email]
>>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> [hidden email]
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about MID_REGISTRAR module

OpenSIPS - Users mailing list
Hi, Social Boh !
 
It’s absolutely OK, because when mid-registrar
re-send a REGISTER, it does not change the IP address
in the Contact: header.
 
So, when the ‘main server’ sends an INVITE to the end-point,
it sends it not to the mid-registrar, but to the IP address
being pointed in the Contact: header.
 
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
 

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about MID_REGISTRAR module

OpenSIPS - Users mailing list
Hi, Social Boh !
 
It’s absolutely OK, because when mid-registrar
re-send a REGISTER, it does not change the IP address
in the Contact: header.
 
So, when the ‘main server’ sends an INVITE to the end-point,
it sends it not to the mid-registrar, but to the IP address
being pointed in the Contact: header.
 
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about MID_REGISTRAR module

OpenSIPS - Users mailing list
In reply to this post by OpenSIPS - Users mailing list
excuse me please, wrong thread...
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
 

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about MID_REGISTRAR module

OpenSIPS - Users mailing list
In reply to this post by OpenSIPS - Users mailing list
 
Even more, speaking about SIP protocol and REGISTER requests in general,
it’s worth saying that you can specify some ‘third-party’ address with which
the Contact: header of your REGISTER will be filled, and the INVITES for that
endpoint will be sent to that address and not to the device which initiated the SIP registration.
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about MID_REGISTRAR module

Social Boh
In reply to this post by OpenSIPS - Users mailing list

Maybe my question not is totally clear:

Alice and Bob register to Mid_Registrar and Mid_registrar send REGISTER to Main Registrar.

If ALice call Bob the INVITE arrives to mid_registrar and not to Main Registrar, is it correct?

Regards

---
I'm SoCIaL, MayBe
El 27/01/2020 a las 06:28, Alexey Kazantsev via Users escribió:
Hi, Social Boh !
 
It’s absolutely OK, because when mid-registrar
re-send a REGISTER, it does not change the IP address
in the Contact: header.
 
So, when the ‘main server’ sends an INVITE to the end-point,
it sends it not to the mid-registrar, but to the IP address
being pointed in the Contact: header.
 
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: opensips lua

OpenSIPS - Users mailing list
In reply to this post by Răzvan Crainea-2

On Mon, Jan 27, 2020 at 10:31, Răzvan Crainea <[hidden email]> wrote:
Please open a ticket with this issue, as this seems to be a regression during porting to lua 5.2/5.3. In the meantime, please continue using lua5.1. Best regards, Răzvan On 1/24/20 6:32 PM, volga629 via Users wrote:
Hello Vlad, In latest master  was added support for 5.2 and 5.3, wrapper  produce error. So it can't open python scripts. Any help thank you. Jan 24 17:24:35 dev1-fr /usr/sbin/opensips[26796]: siplua: encode:UTF16BE:fjhqqq Jan 24 17:24:35 dev1-fr /usr/sbin/opensips[26796]: siplua: siplua error running function arg_function: /etc/opensips/scripts/convert.lua:15: attempt to index a nil value (global 'io') Jan 24 17:24:35 dev1-fr /usr/sbin/opensips[26796]: DBG:core:destroy_index_avp: AVP with the specified index not found volga629 On Sun, Jan 19, 2020 at 10:11, volga629 via Users <[hidden email]> wrote:
Hello Vlad, Thank you for pointing out. I adjusted as following and it resolve the issue if sys.argv[2] == "encode":     print(encoding().strip()) elif sys.argv[2] == "decode":     print(decoding().strip()) elif sys.argv[2] == "test":     print(testing().strip()) volga629 On Tue, Jan 14, 2020 at 17:03, Vlad Patrascu <[hidden email]> wrote:
You get the newline from the print() function in the python script that you call. I've tested with your script and for example this fixed it: print(testing(),end="") Vlad Patrascu OpenSIPS Developer http://www.opensips-solutions.com On 1/14/20 3:32 PM, volga629 via Users wrote:
Hello Vlad, In lua script  we use \n only in xlog. this repository https://github.com/VoIP-SAAS/opensips-smpp-lua On Tue, Jan 14, 2020 at 13:37, Vlad Patrascu <[hidden email]> wrote:
I still don't think it is AVP_set function's fault for the whitespaces. Make sure that the string you produce in lua and want to return to opensips doesn't have a newline character at the end. It seems that syslog prints a newline as "#012" sometimes (if it's not actually at the end of a message). Vlad Patrascu OpenSIPS Developer http://www.opensips-solutions.com On 1/13/20 3:26 PM, volga629 via Users wrote:
Hello Vlad, Yes, it still in issue, but we have work around.  #012 it insert white spaces. $avp(sms-out) = $(avp(formatted-msg){s.trimr}); On Mon, Jan 13, 2020 at 12:26, Vlad Patrascu <[hidden email]> wrote:
Hi Volga, Sorry for getting to this so late. Do you still encounter this issue? I have tried to reproduce this myself but it seems that AVP_set() does set the value correctly. Regards, Vlad Patrascu OpenSIPS Developer http://www.opensips-solutions.com On 12/14/19 7:12 AM, volga629 via Users wrote:
Hello Everyone, Having some issue get lua to set proper avp.  When it set in insert some extra characters into value of avp Here are log Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: test::wwwww nah.uy/u5bmnc Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: siplua: Tested string ~>0 Dec 14 05:53:41 dev1-fr /usr/sbin/opensips[12985]: SMS_ROUTE_IN: Test string ~> [0#012] It insert #012 Lua script                 local cmd_var = handle:read("*all")                 handle:close()                 xlog("Tested string ~> " .. cmd_var .. "\n")                 r eturn AVP_set("test-str", cmd_var) Any help thank you volga629 _______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
--
Răzvan Crainea OpenSIPS Core Developer http://www.opensips-solutions.com _______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about MID_REGISTRAR module

OpenSIPS - Users mailing list
In reply to this post by Social Boh
 
It is absolutely correct.
And that’s your job, as a VoIP adminitsrator, to forward this INVITE
to the appropriate server.
 
Any SIP client will send INVITE to the server defined in its settings,
at least if something additional is not configured («Outbound proxy»
or «Route» or maybe it’s called something else, depending on the vendor/software author).
 
 
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
 

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about MID_REGISTRAR module

A. Sannucci

Perfect...

so why in the Tutorial de INVITE comes from Main Registrar?

   # initial requests from main registrar, need to look them up!
    if (is_method("INVITE|MESSAGE") && $si == "10.0.0.3" && $sp == 5070) {
        xlog("looking up $ru!\n");
        if (!mid_registrar_lookup("location")) {
            t_reply("404", "Not Found");
            exit;
        }

        t_relay();

        exit;
    }
El 27/01/2020 a las 08:35, Alexey Kazantsev via Users escribió:
 
It is absolutely correct.
And that’s your job, as a VoIP adminitsrator, to forward this INVITE
to the appropriate server.
 
Any SIP client will send INVITE to the server defined in its settings,
at least if something additional is not configured («Outbound proxy»
or «Route» or maybe it’s called something else, depending on the vendor/software author).
 
 
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
 

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about MID_REGISTRAR module

Social Boh
In reply to this post by OpenSIPS - Users mailing list

Perfect...

so why in the Tutorial de INVITE comes from Main Registrar?

   # initial requests from main registrar, need to look them up!
    if (is_method("INVITE|MESSAGE") && $si == "10.0.0.3" && $sp == 5070) {
        xlog("looking up $ru!\n");
        if (!mid_registrar_lookup("location")) {
            t_reply("404", "Not Found");
            exit;
        }

        t_relay();

        exit;
    }

The INVITE from user go trough the mid_registrar to main registrar and then came back to mid_registrar to called user...
---
I'm SoCIaL, MayBe
El 27/01/2020 a las 08:35, Alexey Kazantsev via Users escribió:
 
It is absolutely correct.
And that’s your job, as a VoIP adminitsrator, to forward this INVITE
to the appropriate server.
 
Any SIP client will send INVITE to the server defined in its settings,
at least if something additional is not configured («Outbound proxy»
or «Route» or maybe it’s called something else, depending on the vendor/software author).
 
 
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
 

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Doubt about MID_REGISTRAR module

OpenSIPS - Users mailing list
Well, let’s check out in which mode is mid_registrar configured?
 
-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
 

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
12