$du not expanded/evaluated?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

$du not expanded/evaluated?

robert
I am using the following in the opensips.cfg file.

$du correctly evaluates to a real value (e.g. "sip:XX.XX.XX.XX:5060" ) in the xlog, but inside the python_exec, it does not.

On the python side the incrementMissedCallsCount function gets the value "$du" rather than "sip:XX.XX.XX.XX:5060"


code:

xlog("REPORT: LB destination $du failed with code $T_reply_code\n");
python_exec('incrementMissedCallsCount',"$du");
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: $du not expanded/evaluated?

Bogdan-Andrei Iancu-2
Hi Robert,

According to the docs, the second parameter does not expands possible
variables.

Have you check if the dst URI is accessible via the SIPMsg class ?
http://www.opensips.org/html/docs/modules/2.2.x/python.html#idp54288

Regards,

Bogdan-Andrei Iancu
   OpenSIPS Founder and Developer
   http://www.opensips-solutions.com

OpenSIPS Summit May 2017 Amsterdam
   http://www.opensips.org/events/Summit-2017Amsterdam.html

On 04/11/2017 08:04 PM, robert wrote:

> I am using the following in the opensips.cfg file.
>
> $du correctly evaluates to a real value (e.g. "sip:XX.XX.XX.XX:5060" ) in
> the xlog, but inside the python_exec, it does not.
>
> On the python side the incrementMissedCallsCount function gets the value
> "$du" rather than "sip:XX.XX.XX.XX:5060"
>
>
> code:
>
> xlog("REPORT: LB destination $du failed with code $T_reply_code\n");
> python_exec('incrementMissedCallsCount',"$du");
>
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/du-not-expanded-evaluated-tp7606924.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.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
|  
Report Content as Inappropriate

Re: $du not expanded/evaluated?

robert
Wow, that is really bizarre. I don't think I have ever see any languages where variable expansion is based on which function they are passed to.

Anyways, I think your documentation needs to be updated, I don't see anything in your document stating expansion does not take place for the extra_args in python_exec(method_name [, extra_args]).  Also would be nice if you noted only Python 2 is supported

One more question, is it not possible to run threads in the python script called?  I am getting an odd error when I try to run a thread, but that script works fine when called for command line.

Robert Mundkowsky


-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:[hidden email]]
Sent: Wednesday, April 12, 2017 9:50 AM
To: OpenSIPS users mailling list <[hidden email]>; Mundkowsky, Robert <[hidden email]>
Subject: Re: [OpenSIPS-Users] $du not expanded/evaluated?

Hi Robert,

According to the docs, the second parameter does not expands possible variables.

Have you check if the dst URI is accessible via the SIPMsg class ?
http://www.opensips.org/html/docs/modules/2.2.x/python.html#idp54288

Regards,

Bogdan-Andrei Iancu
   OpenSIPS Founder and Developer
   http://www.opensips-solutions.com

OpenSIPS Summit May 2017 Amsterdam
   http://www.opensips.org/events/Summit-2017Amsterdam.html

On 04/11/2017 08:04 PM, robert wrote:

> I am using the following in the opensips.cfg file.
>
> $du correctly evaluates to a real value (e.g. "sip:XX.XX.XX.XX:5060" )
> in the xlog, but inside the python_exec, it does not.
>
> On the python side the incrementMissedCallsCount function gets the
> value "$du" rather than "sip:XX.XX.XX.XX:5060"
>
>
> code:
>
> xlog("REPORT: LB destination $du failed with code $T_reply_code\n");
> python_exec('incrementMissedCallsCount',"$du");
>
>
>
>
> --
> View this message in context:
> http://opensips-open-sip-server.1449251.n2.nabble.com/du-not-expanded-
> evaluated-tp7606924.html Sent from the OpenSIPS - Users mailing list
> archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


________________________________

This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


Thank you for your compliance.

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

Re: $du not expanded/evaluated?

Bogdan-Andrei Iancu-2
In terms of both code and documentation, anyone is free and more than
welcome to contribute with improvements or fixes. This is one of the
golden rules of Open Sources Softwares ;)

In regards to the python threads, I do not have the python knowledge to
formulate a comment.

Regards,

Bogdan-Andrei Iancu
   OpenSIPS Founder and Developer
   http://www.opensips-solutions.com

OpenSIPS Summit May 2017 Amsterdam
   http://www.opensips.org/events/Summit-2017Amsterdam.html

On 04/12/2017 05:10 PM, Mundkowsky, Robert wrote:

> Wow, that is really bizarre. I don't think I have ever see any languages where variable expansion is based on which function they are passed to.
>
> Anyways, I think your documentation needs to be updated, I don't see anything in your document stating expansion does not take place for the extra_args in python_exec(method_name [, extra_args]).  Also would be nice if you noted only Python 2 is supported
>
> One more question, is it not possible to run threads in the python script called?  I am getting an odd error when I try to run a thread, but that script works fine when called for command line.
>
> Robert Mundkowsky
>
>
> -----Original Message-----
> From: Bogdan-Andrei Iancu [mailto:[hidden email]]
> Sent: Wednesday, April 12, 2017 9:50 AM
> To: OpenSIPS users mailling list <[hidden email]>; Mundkowsky, Robert <[hidden email]>
> Subject: Re: [OpenSIPS-Users] $du not expanded/evaluated?
>
> Hi Robert,
>
> According to the docs, the second parameter does not expands possible variables.
>
> Have you check if the dst URI is accessible via the SIPMsg class ?
> http://www.opensips.org/html/docs/modules/2.2.x/python.html#idp54288
>
> Regards,
>
> Bogdan-Andrei Iancu
>     OpenSIPS Founder and Developer
>     http://www.opensips-solutions.com
>
> OpenSIPS Summit May 2017 Amsterdam
>     http://www.opensips.org/events/Summit-2017Amsterdam.html
>
> On 04/11/2017 08:04 PM, robert wrote:
>> I am using the following in the opensips.cfg file.
>>
>> $du correctly evaluates to a real value (e.g. "sip:XX.XX.XX.XX:5060" )
>> in the xlog, but inside the python_exec, it does not.
>>
>> On the python side the incrementMissedCallsCount function gets the
>> value "$du" rather than "sip:XX.XX.XX.XX:5060"
>>
>>
>> code:
>>
>> xlog("REPORT: LB destination $du failed with code $T_reply_code\n");
>> python_exec('incrementMissedCallsCount',"$du");
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://opensips-open-sip-server.1449251.n2.nabble.com/du-not-expanded-
>> evaluated-tp7606924.html Sent from the OpenSIPS - Users mailing list
>> archive at Nabble.com.
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> ________________________________
>
> This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.
>
>
> Thank you for your compliance.
>
> ________________________________


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

RE: $du not expanded/evaluated?

robert

Oh, is your documentation in Git?

 

Robert Mundkowsky

 

From: Bogdan-Andrei Iancu-2 [via OpenSIPS (Open SIP Server)] [mailto:ml-node+[hidden email]]
Sent: Thursday, April 13, 2017 5:26 AM
To: Mundkowsky, Robert <[hidden email]>
Subject: Re: $du not expanded/evaluated?

 

In terms of both code and documentation, anyone is free and more than
welcome to contribute with improvements or fixes. This is one of the
golden rules of Open Sources Softwares ;)

In regards to the python threads, I do not have the python knowledge to
formulate a comment.

Regards,

Bogdan-Andrei Iancu
   OpenSIPS Founder and Developer
   http://www.opensips-solutions.com

OpenSIPS Summit May 2017 Amsterdam
   http://www.opensips.org/events/Summit-2017Amsterdam.html

On 04/12/2017 05:10 PM, Mundkowsky, Robert wrote:


> Wow, that is really bizarre. I don't think I have ever see any languages where variable expansion is based on which function they are passed to.
>
> Anyways, I think your documentation needs to be updated, I don't see anything in your document stating expansion does not take place for the extra_args in python_exec(method_name [, extra_args]).  Also would be nice if you noted only Python 2 is supported
>
> One more question, is it not possible to run threads in the python script called?  I am getting an odd error when I try to run a thread, but that script works fine when called for command line.
>
> Robert Mundkowsky
>
>
> -----Original Message-----
> From: Bogdan-Andrei Iancu [mailto:[hidden email]]
> Sent: Wednesday, April 12, 2017 9:50 AM
> To: OpenSIPS users mailling list <[hidden email]>; Mundkowsky, Robert <[hidden email]>
> Subject: Re: [OpenSIPS-Users] $du not expanded/evaluated?
>
> Hi Robert,
>
> According to the docs, the second parameter does not expands possible variables.
>
> Have you check if the dst URI is accessible via the SIPMsg class ?
> http://www.opensips.org/html/docs/modules/2.2.x/python.html#idp54288
>
> Regards,
>
> Bogdan-Andrei Iancu
>     OpenSIPS Founder and Developer
>     http://www.opensips-solutions.com
>
> OpenSIPS Summit May 2017 Amsterdam
>     http://www.opensips.org/events/Summit-2017Amsterdam.html
>
> On 04/11/2017 08:04 PM, robert wrote:
>> I am using the following in the opensips.cfg file.
>>
>> $du correctly evaluates to a real value (e.g. "<a href="sip:XX.XX.XX.XX:5060">sip:XX.XX.XX.XX:5060" )
>> in the xlog, but inside the python_exec, it does not.
>>
>> On the python side the incrementMissedCallsCount function gets the
>> value "$du" rather than "<a href="sip:XX.XX.XX.XX:5060">sip:XX.XX.XX.XX:5060"
>>
>>
>> code:
>>
>> xlog("REPORT: LB destination $du failed with code $T_reply_code\n");
>> python_exec('incrementMissedCallsCount',"$du");
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://opensips-open-sip-server.1449251.n2.nabble.com/du-not-expanded-
>> evaluated-tp7606924.html Sent from the OpenSIPS - Users mailing list
>> archive at Nabble.com.
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> ________________________________
>
> This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.
>
>
> Thank you for your compliance.
>
> ________________________________



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


If you reply to this email, your message will be added to the discussion below:

http://opensips-open-sip-server.1449251.n2.nabble.com/du-not-expanded-evaluated-tp7606924p7606955.html

To unsubscribe from $du not expanded/evaluated?, click here.
NAML



This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


Thank you for your compliance.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: $du not expanded/evaluated?

Bogdan-Andrei Iancu-2
Of course it is:
    https://github.com/OpenSIPS/opensips/blob/master/modules/python/doc/python_admin.xml

Regards,
Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  http://www.opensips-solutions.com

OpenSIPS Summit May 2017 Amsterdam
  http://www.opensips.org/events/Summit-2017Amsterdam.html
On 04/13/2017 04:43 PM, robert wrote:

Oh, is your documentation in Git?

 

Robert Mundkowsky

 

From: Bogdan-Andrei Iancu-2 [via OpenSIPS (Open SIP Server)] [[hidden email][hidden email]]
Sent: Thursday, April 13, 2017 5:26 AM
To: Mundkowsky, Robert <[hidden email]>
Subject: Re: $du not expanded/evaluated?

 

In terms of both code and documentation, anyone is free and more than
welcome to contribute with improvements or fixes. This is one of the
golden rules of Open Sources Softwares ;)

In regards to the python threads, I do not have the python knowledge to
formulate a comment.

Regards,

Bogdan-Andrei Iancu
   OpenSIPS Founder and Developer
   http://www.opensips-solutions.com

OpenSIPS Summit May 2017 Amsterdam
   http://www.opensips.org/events/Summit-2017Amsterdam.html

On 04/12/2017 05:10 PM, Mundkowsky, Robert wrote:


> Wow, that is really bizarre. I don't think I have ever see any languages where variable expansion is based on which function they are passed to.
>
> Anyways, I think your documentation needs to be updated, I don't see anything in your document stating expansion does not take place for the extra_args in python_exec(method_name [, extra_args]).  Also would be nice if you noted only Python 2 is supported
>
> One more question, is it not possible to run threads in the python script called?  I am getting an odd error when I try to run a thread, but that script works fine when called for command line.
>
> Robert Mundkowsky
>
>
> -----Original Message-----
> From: Bogdan-Andrei Iancu [mailto:[hidden email]]
> Sent: Wednesday, April 12, 2017 9:50 AM
> To: OpenSIPS users mailling list <[hidden email]>; Mundkowsky, Robert <[hidden email]>
> Subject: Re: [OpenSIPS-Users] $du not expanded/evaluated?
>
> Hi Robert,
>
> According to the docs, the second parameter does not expands possible variables.
>
> Have you check if the dst URI is accessible via the SIPMsg class ?
> http://www.opensips.org/html/docs/modules/2.2.x/python.html#idp54288
>
> Regards,
>
> Bogdan-Andrei Iancu
>     OpenSIPS Founder and Developer
>     http://www.opensips-solutions.com
>
> OpenSIPS Summit May 2017 Amsterdam
>     http://www.opensips.org/events/Summit-2017Amsterdam.html
>
> On 04/11/2017 08:04 PM, robert wrote:
>> I am using the following in the opensips.cfg file.
>>
>> $du correctly evaluates to a real value (e.g. "<a href="sip:XX.XX.XX.XX:5060">sip:XX.XX.XX.XX:5060" )
>> in the xlog, but inside the python_exec, it does not.
>>
>> On the python side the incrementMissedCallsCount function gets the
>> value "$du" rather than "<a href="sip:XX.XX.XX.XX:5060">sip:XX.XX.XX.XX:5060"
>>
>>
>> code:
>>
>> xlog("REPORT: LB destination $du failed with code $T_reply_code\n");
>> python_exec('incrementMissedCallsCount',"$du");
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://opensips-open-sip-server.1449251.n2.nabble.com/du-not-expanded-
>> evaluated-tp7606924.html Sent from the OpenSIPS - Users mailing list
>> archive at Nabble.com.
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> ________________________________
>
> This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.
>
>
> Thank you for your compliance.
>
> ________________________________



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


If you reply to this email, your message will be added to the discussion below:

http://opensips-open-sip-server.1449251.n2.nabble.com/du-not-expanded-evaluated-tp7606924p7606955.html

To unsubscribe from $du not expanded/evaluated?, click here.
NAML



This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


Thank you for your compliance.




View this message in context: RE: $du not expanded/evaluated?
Sent from the OpenSIPS - Users mailing list archive at Nabble.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
Loading...