Re: [OpenSIPS-Users] check for NULL values

2018-11-19 Thread Pasan Meemaduma via Users
 Hi Bogdan,

I'll try to get that done. I'm seeing this on a production server. I'll try to 
get the info you requested.
On Monday, 19 November 2018, 7:41:54 PM GMT+5:30, Bogdan-Andrei Iancu 
 wrote:  
 
  Hi Pasan,
 
 That is really weird I would say. Could you "pack" the minimal script to get 
this error (plus the pcap of the REGISTER) ? you can send them off list to me.
 
 Regards,
  Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
 On 11/16/2018 07:20 AM, Pasan Meemaduma wrote:
  
  Hi Bogdan, 
  I tried scrip_trace function and it also indicate same behavior, I can see 
the value of $tu but it still gives the error. Interesting thing is, it 
evaluates to true and invokes the remove() function as well.
  
  Nov 16 16:06:46  /usr/sbin/opensips[16582]: [Script 
Trace][/etc/opensips/opensips.cfg:814][reg-debug][core if] -> (REGISTER from 
Y.Y.Y.Y F=sip:XXX@x.x.x.x, T=sip:XXX@x.x.x.x ID=cd7921be-54514c80@v.v.v.v#012)
 Nov 16 16:06:46  /usr/sbin/opensips[16582]: ERROR:core:comp_scriptvar: cannot 
get left var value
 Nov 16 16:06:46  /usr/sbin/opensips[16582]: WARNING:core:do_action: error in 
expression at /etc/opensips/opensips.cfg:814
 Nov 16 16:06:52  /usr/sbin/opensips[16582]: [Script 
Trace][/etc/opensips/opensips.cfg:815][reg-debug][module remove] -> (REGISTER 
from Y.Y.Y.Y F=sip:XXX@x.x.x.x, T=sip:XXX@x.x.x.x 
ID=4afba829-fef90105@v.v.v.v#012)
 
  /etc/opensips/opensips.cfg:814
     if ( $tu != NULL ) {
     remove("location","$tu");
     }
 
 
  
  
  On Thursday, 15 November 2018, 5:25:54 PM GMT+5:30, Bogdan-Andrei Iancu 
 wrote:  
  
 Hi Pasan,
 
 Indeed, the logs show that the TO hdr is successfully parsed - are you 100% 
sure about the reported line ? maybe it is not the $tu related ? try to 
activate the script_trace() 
[http://www.opensips.org/Documentation/Script-CoreFunctions-2-4#toc42] function 
to see when exactly the error is generated. Maybe you can actually print $tu 
before, to see what you get.
 
 Regards,
  Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
  On 11/15/2018 10:04 AM, Pasan Meemaduma wrote:
  
  Hi Bogdan, 
  I'm not seeing any other related error msg prior to this. I'm calling this 
test in request route for a REGISTER request. Before the error pops up I could 
see the received msg successfully parse by opensips and can see value of To uri 
  Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_msg: SIP Request:
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_msg:  method:  

 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_msg:  uri: 

 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_msg:  version: 

 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: flags=2
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_via_param: found 
param type 232,  = ; state=16
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_via: end of header 
reached, state=5
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: via found, 
flags=2
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: this is 
the first via
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:receive_msg: After 
parse_msg...
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:receive_msg: preparing to 
run routing scripts...
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: flags=100
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:_parse_to: end of header 
reached, state=10
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:_parse_to: 
display={XX}, ruri={sip:xxx...@xx.xx.xx.x}
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field:  [48]; 
uri=[sip:XX@x.x.x.x]
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field: to body 
[XX #015#012]
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field: cseq 
: <79474> 
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:maxfwd:is_maxfwd_present: 
value = 70
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_to_param: 
tag=46474fbe5728f700o0
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:_parse_to: end of header 
reached, state=29
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:_parse_to: 
display={XX}, ruri={sip:XX@x.x.x.x}
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: flags=200
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field: 
content_length=0
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field: found end 
of header
 
  and following are the line that I get before the error If I set log level to 
6 
  Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: 
flags=
 Nov 15 18:19:19  /usr/sbin/opensips[21608]: 

[OpenSIPS-Users] rtpengine (setid_avp) issue with BYE and CANCEL

2018-11-19 Thread Mickael Hubert
Hi all,
I have a rtpengine with opensips, when I use rtpengine without setid_avp
all works like a charm

modparam("rtpengine", "rtpengine_sock", "udp:10.13.0.129:12221")

*When I want use setid_avp:*

modparam("rtpengine", "setid_avp", "$avp(setid)")
modparam("rtpengine", "rtpengine_sock", "1 == udp:10.13.0.129:12221")

*I call manage function in initial INVITE:*

$avp(setid) =  1;
create_dialog();
xlog("L_INFO","setid: $avp(setid)\n");
if(rtpengine_manage("ICE=remove"))
{
  xlog("L_INFO","SDP Offer: $ci for INVITE\n");
}

for an reply $avp(setid) is populate, and rtpengine works.

*but for BYE and CANCEL I have an issue:*

you can see the setid variable isn't populate for this CANCEL, but it is
populate for 487 reply !
I have this error log: ERROR:rtpengine:select_rtpe_node: script error -no
valid set selected / ERROR:rtpengine:rtpe_function_call: no available
proxies

When I force the setid to 1 for BYE and CANCEL, there isn't issue.

However, the module documentation explains :

*IMPORTANT: if you use multiple sets, take care and use the same set for
both rtpengine_offer()/rtpengine_answer() and rtpengine_delete()!! *
*If the set was selected using setid_avp, the avp needs to be set only once
before rtpengine_offer() or rtpengine_manage() call. *

Can you help me please ?

thanks in advance

PS: same issue with BYE method


Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:

Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: CANCEL END OF
CALL : call-id 1def6e7f-66b6-1237-7b9d-0050569229dc
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:

Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]: setid: 
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
*ERROR:rtpengine:select_rtpe_node:
script error -no valid set selected*
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22531]:
*ERROR:rtpengine:rtpe_function_call:
no available proxies*
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]:
1def6e7f-66b6-1237-7b9d-0050569229dc In ONREPLY ROUTE 2 - fu :
sip:+**@am-isbc1- , ru :  , si : 10.13.0.80, status : 487
Nov 19 16:53:41 am-scr1-test /usr/local/sbin/opensips[22521]: setid: 1

if (is_method("CANCEL"))
  {

xlog("L_INFO","
\n");
xlog("L_INFO","CANCEL END OF CALL : call-id $ci \n");

xlog("L_INFO","
\n");
xlog("L_INFO","setid: $avp(setid)\n");
if(rtpengine_manage("ICE=remove"))
{
  xlog("L_INFO","SDP Offer: $ci for CANCEL\n");
}
.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] check for NULL values

2018-11-19 Thread Bogdan-Andrei Iancu

Hi Pasan,

That is really weird I would say. Could you "pack" the minimal script to 
get this error (plus the pcap of the REGISTER) ? you can send them off 
list to me.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 11/16/2018 07:20 AM, Pasan Meemaduma wrote:

Hi Bogdan,

I tried scrip_trace function and it also indicate same behavior, I can 
see the value of $tu but it still gives the error. Interesting thing 
is, it evaluates to true and invokes the remove() function as well.


Nov 16 16:06:46  /usr/sbin/opensips[16582]: [Script 
Trace][/etc/opensips/opensips.cfg:814][reg-debug][core if] -> 
(REGISTER from Y.Y.Y.Y F=sip:XXX@x.x.x.x, T=sip:XXX@x.x.x.x 
ID=cd7921be-54514c80@v.v.v.v#012)
Nov 16 16:06:46  /usr/sbin/opensips[16582]: ERROR:core:comp_scriptvar: 
cannot get left var value
Nov 16 16:06:46  /usr/sbin/opensips[16582]: WARNING:core:do_action: 
error in expression at /etc/opensips/opensips.cfg:814
Nov 16 16:06:52  /usr/sbin/opensips[16582]: [Script 
Trace][/etc/opensips/opensips.cfg:815][reg-debug][module remove] -> 
(REGISTER from Y.Y.Y.Y F=sip:XXX@x.x.x.x, T=sip:XXX@x.x.x.x 
ID=4afba829-fef90105@v.v.v.v#012)


/etc/opensips/opensips.cfg:814
if ( $tu != NULL ) {
remove("location","$tu");
}




On Thursday, 15 November 2018, 5:25:54 PM GMT+5:30, Bogdan-Andrei 
Iancu  wrote:



Hi Pasan,

Indeed, the logs show that the TO hdr is successfully parsed - are you 
100% sure about the reported line ? maybe it is not the $tu related ? 
try to activate the script_trace() 
[http://www.opensips.org/Documentation/Script-CoreFunctions-2-4#toc42] 
function to see when exactly the error is generated. Maybe you can 
actually print $tu before, to see what you get.


Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
   http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 11/15/2018 10:04 AM, Pasan Meemaduma wrote:

Hi Bogdan,

I'm not seeing any other related error msg prior to this. I'm calling 
this test in request route for a REGISTER request. Before the error 
pops up I could see the received msg successfully parse by opensips 
and can see value of To uri


Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_msg: SIP 
Request:
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_msg:  
method:  
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_msg:  uri: 

Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_msg:  
version: 
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: 
flags=2
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_via_param: 
found param type 232,  = ; state=16
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_via: end 
of header reached, state=5
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: 
via found, flags=2
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: 
this is the first via
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:receive_msg: 
After parse_msg...
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:receive_msg: 
preparing to run routing scripts...
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: 
flags=100
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:_parse_to: end 
of header reached, state=10
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:_parse_to: 
display={XX}, ruri={sip:xxx...@xx.xx.xx.x}
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field: 
 [48]; uri=[sip:XX@x.x.x.x]
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field: 
to body [XX #015#012]
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field: 
cseq : <79474> 
Nov 15 18:19:19  /usr/sbin/opensips[21608]: 
DBG:maxfwd:is_maxfwd_present: value = 70
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_to_param: 
tag=46474fbe5728f700o0
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:_parse_to: end 
of header reached, state=29
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:_parse_to: 
display={XX}, ruri={sip:XX@x.x.x.x}
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: 
flags=200
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field: 
content_length=0
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:get_hdr_field: 
found end of header


and following are the line that I get before the error If I set log 
level to 6


Nov 15 18:19:19 /usr/sbin/opensips[21608]: DBG:core:parse_headers: 
flags=
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: 
flags=
Nov 15 18:19:19  /usr/sbin/opensips[21608]: DBG:core:parse_headers: 
flags=
Nov 15 18:19:19  /usr/sbin/opensips[21608]: 
ERROR:core:comp_scriptvar: cannot get left var value
Nov 15 18:19:19  /usr/sbin/opensips[21608]: WARN

Re: [OpenSIPS-Users] OpenSIPS Control Panel 8.2.4 was released

2018-11-19 Thread John Quick
Hello Bogdan,

The link works okay now, but (I think) only if the selected call is on the
first page of results in the siptrace tab.

John Quick
Smartvox Limited


> Hi John,
> 
> I found a small typo that affected who the link was constructed . See
>
https://github.com/OpenSIPS/opensips-cp/commit/d50503123477f99b0079570361407
7b685ca4579
>
> In order to link siptrace to cdrviewer, you need to (a) be sure homer 
> tool is disabled and (b) siptrace tool is enabled.
>
> Let me know if this fix does the trick for you.
>
> Best regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>http://www.opensips-solutions.com


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] system metrics

2018-11-19 Thread Bogdan-Andrei Iancu

Hi Dragomir,

See the statistics provided by the dialog module:
http://www.opensips.org/html/docs/modules/2.4.x/dialog.html#exported_statistics

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 11/19/2018 10:55 AM, Dragomir Haralambiev wrote:

Hello,

For system metrics i need to get number active dialogs.
How to do that easy.

Best regards,
Dragomir


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] redis cache sharing for dialog storage?

2018-11-19 Thread Bogdan-Andrei Iancu
Yes, that is correct - you need to use the /s marker in all the places 
where you mention the profile.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 11/18/2018 07:50 AM, J E H A N Z A I B wrote:

Thank you Bogdan.
Do I have to use /s marker for setting as well ?

set_dlg_profile("test/s"  ?

what about get_profile_size("test/s


On Thu, Nov 15, 2018 at 3:04 AM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:


Hi Jehanzaib,

Again, use the /s marker - see

http://www.opensips.org/html/docs/modules/2.4.x/dialog.html#param_profiles_with_value
.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
   http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 11/06/2018 01:11 AM, J E H A N Z A I B wrote:

Hi there,

I am not sure why the dialog stats will not  be shared. If all
records are going to redis then I have a redis cluster which
synchs the cache.
When I fetch the profile size it should be same (if it is being
fetched from the redis) across all the opensips node. I am bit
sceptical to upgrade without knowing what's happening.


On Tue, Nov 6, 2018 at 4:53 AM SamyGo mailto:govoi...@gmail.com>> wrote:

I have a strong feeling that you're using an old version of
opensips to expect it to share dialog states/profiles. I
think you'll need to use newer opensips 2.4+ having dialog
sharing capability using proto_bin and clusterer module:

http://www.opensips.org/html/docs/modules/2.4.x/dialog.html#param_profile_replication_cluster


On Mon, Nov 5, 2018 at 5:30 AM J E H A N Z A I B
mailto:jehanzaib.ki...@gmail.com>> wrote:

Hi team,

I used redis cache for dialog storage. I have 2 different
servers both are sharing the same redis. Is the profile
size shared in this case?

here is the dialog config.

loadmodule "dialog.so"
modparam("dialog", "enable_stats", 1)
modparam("dialog", "cachedb_url",
"redis:mysip://mysipx.xx.xx:/")

This is how I check my profile size.
create_dialog();
set_dlg_profile("myuniqprof","$avp(myprofile_id)");

get_profile_size("myuniqprof","$avp(myprofile_id)","$var(current_profile_size)");

Please note I am using version: opensips 1.11.3-notls


-- 
Regards,

Jehanzaib
___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



-- 
Regards,

Jehanzaib


___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




--
Regards,
Jehanzaib


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Forking sip MESSAGE to multiple endpoints

2018-11-19 Thread Bogdan-Andrei Iancu

Hi Aron,

Right now, the onreply_route is triggered all the time for all replies 
(1xx, 2xx, or higher) received on any of the branches.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 11/16/2018 07:48 PM, Podrigal, Aron wrote:

Thank you Bogdan.
The question is if we can add some flag, to always trigger 
onreply_route for each branch, so that one can do some cleanup / 
update database based on the reply for each branch.


On Fri, Nov 16, 2018, 12:25 PM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org> wrote:


Hi Aron,

The standard SIP forking (as per RFC3261) says only one
destination should get the reply. Nevertheless, there is the
RFC3841 defining "Content-Disposition: no-cancel" to prevent the
proxy to send Cancel upon first 200 OK.
We added support for it in OpenSIPS, starting 2.4 - see flag 0x10
- http://www.opensips.org/html/docs/modules/2.4.x/tm.html#func_t_relay
but it works only for INVITEs :D

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
   http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 11/14/2018 07:38 PM, Podrigal, Aron wrote:

Hi.

I want to fork a MESSAGE request to multiple endpoints and handle
the delivery status for each on reply.

currently I append_branch() for each additional destination. But
the problem is, that if any branch received a 200 reply, any
other branch which did not relay the request yet (ie socket
connection wasn't established) or TM timer is triggered, then
those branches are canceled without triggering onreply route or
failure route.

How could I implement it, so that I can handle the timeout or
failure for each endpoint?

Maybe t_replicate? Or is there an event raised for a canceled
branch which I can subscribe to?


Thanks


___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] system metrics

2018-11-19 Thread Dragomir Haralambiev
Hello,

For system metrics i need to get number active dialogs.
How to do that easy.

Best regards,
Dragomir
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users