Re: [OpenSIPS-Users] E_ACC_EVENT Question
Based on this test it is not clear that the issue is with the event route params, as you have not verified that the acc_extra field’s new value is actually set. If it is not set properly then the event route param will not show it properly, which is an issue but a different issue. So can you try logging the value after you change it in HANDLE_INVITE? Ben Newlin From: Users on behalf of Alexander Perkins Date: Thursday, June 6, 2024 at 10:18 AM To: Bogdan-Andrei Iancu Cc: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] E_ACC_EVENT Question EXTERNAL EMAIL - Please use caution with links and attachments Hi Bogdan. We tried the approach that Ben brought up, but we still do not get any values in the event hook. For example (much more simplified cfg script below), modparam("acc","extra_fields","evi: src_ip -> source_ip; dst_ip -> destination_ip) route { do_accounting("evi", "cdr|missed|failed"); $acc_extra(dst_ip) = "Bogdan is awesome!"; xlog("L_INFO","***src_ip: $acc_extra(dst_ip)"); ## I see this value in the log as Bogdan is Awesome!, which is correct. route(HANDLE_INVITE); } route [HANDLE_INVITE] { $acc_extra(dst_ip) = "8.8.8.8"; } event_route [E_ACC_EVENT] { #log on entry xlog("L_INFO","entered event_route\n"); xlog("L_INFO","Destination IP: $param(destination_ip); ## I see this value in the log as Bogdan is Awesome!, which is not correct.. Expecting to see 8.8.8.8 } When I look at the logs, I see the value is set correctly from the route block. But I don't see it correct from the event block. What am I missing? Thank you, Alex On Wed, Jun 5, 2024 at 11:33 AM Bogdan-Andrei Iancu mailto:bog...@opensips.org>> wrote: Hi Alexander. When you say "they don't seem to populate correctly", you mean they are NULL val, or wrong value? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 04.06.2024 23:59, Alexander Perkins wrote: Hi All. We are working on implementing the E_ACC_EVENT so we may use that for accounting purposes instead of the DB. Now, most things appear to work as they should. However, when we attempt to access the extra accounting fields, they don't seem to populate correctly (I've highlighted the extra variables). Here is the config: modparam("acc","extra_fields","evi: src_ip -> source_ip; dst_ip -> destination_ip) event_route [E_ACC_EVENT] { #log on entry xlog("L_INFO","entered event_route\n"); #Default Params $var(method) = $param(method); #Extra Params $var(src_ip) = $acc_extra(src_ip); $var(source_test) = $si; $var(dst_ip) = $acc_extra(dst_ip); #log vars to test xlog("L_INFO","heres the ER variable: $var(source_test) and $var(src_ip)\n"); } What am I missing? Can someone point me in the right direction? Any help is really appreciated. Thank you, Alex Perkins ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Strip prefix
Glad you got it working! It’s not immediately clear to me why the end of string anchor would be required on the subst_exp nor why it’s absence would cause the errors you were seeing. A bit strange. Ben Newlin From: Users on behalf of morris edery Date: Thursday, June 6, 2024 at 12:52 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments Hello Ben, here is what works for me. dpid = 17 pr = 0 match_op = 1 match_exp = ^770555.+ match_flags = 0 subst_exp = ^770555(.+)$ repl_exp = \1 $ sign did the trick. Thanks so much for the support. On Wed, Jun 5, 2024 at 10:04 AM Ben Newlin mailto:ben.new...@genesys.com>> wrote: There’s a few issues. 1. You are missing a “.” in your match_exp. The way you have it written will only match repeating digit 5 after the prefix. 2. Your subst_exp is too greedy. The wildcards in the first grouping will make that grouping match the whole string, and there will be nothing left for the second grouping (or it won’t match at all because of the + in the second grouping, not sure). If you are trying to match a fixed-string prefix you don’t need wildcards for that. You also don’t need to capture that grouping, since you aren’t using it in the replace. Try this: dpid = 17 pr = 0 match_op = 1 match_exp = ^770555.+ match_flags = 0 subst_exp = ^770555(.+) repl_exp = \1 Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of morris edery mailto:morrised...@gmail.com>> Date: Wednesday, June 5, 2024 at 12:48 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments Hello Team, im trying to strip a prefix with dialplan from a number and from some reason have no success on that , please tell me what im doing wrong ? below opensips 2.4.8 dpid = 17 pr = 0 match_op = 1 match_exp = ^770555+ match_flags = 0 subst_exp = ^(*770555*)(.+) repl_exp = \2 need to remove 770555 on cfg file if (dp_translate("17", "$rU/$rU")){ } Thanks ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Strip prefix
It looks right to me. The error you get when changing repl_exp to “\1” implies to me that it is causing the dpid to fail to load from the database at all due to some syntax issue. Is you database escaping or converting the “\” maybe? I’d recommend increasing the logging verbosity of opensips and doing a module reload and the test scenario and see what the logs say about why it isn’t matching. Ben Newlin From: Users on behalf of morris edery Date: Wednesday, June 5, 2024 at 1:46 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments Yes i change it all dpid = 17 pr = 0 match_op = 1 match_exp = ^770555.+ match_flags = 0 subst_exp = ^770555(.+) repl_exp = \1 without \1 im able to complete the call but prefix still there and when i add the \1 on repl_exp i get the error On Wed, Jun 5, 2024 at 1:13 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: Did you make all the changes I suggested or only changed the repl_exp? I detailed changes needed to the match_exp and subst_exp as well. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of morris edery mailto:morrised...@gmail.com>> Date: Wednesday, June 5, 2024 at 12:44 PM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments Still no luck. when i add repl_exp = \1 i get this Jun 5 12:13:04 [12250] DBG:dialplan:dp_translate_f: input is 7705557867129454 Jun 5 12:13:04 [12250] DBG:dialplan:dp_translate_f: no information available for dpid 17 DBG:sl:sl_reply_error: error text is Bad URI (475/SL) On Wed, Jun 5, 2024 at 10:04 AM Ben Newlin mailto:ben.new...@genesys.com>> wrote: There’s a few issues. 1. You are missing a “.” in your match_exp. The way you have it written will only match repeating digit 5 after the prefix. 2. Your subst_exp is too greedy. The wildcards in the first grouping will make that grouping match the whole string, and there will be nothing left for the second grouping (or it won’t match at all because of the + in the second grouping, not sure). If you are trying to match a fixed-string prefix you don’t need wildcards for that. You also don’t need to capture that grouping, since you aren’t using it in the replace. Try this: dpid = 17 pr = 0 match_op = 1 match_exp = ^770555.+ match_flags = 0 subst_exp = ^770555(.+) repl_exp = \1 Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of morris edery mailto:morrised...@gmail.com>> Date: Wednesday, June 5, 2024 at 12:48 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments Hello Team, im trying to strip a prefix with dialplan from a number and from some reason have no success on that , please tell me what im doing wrong ? below opensips 2.4.8 dpid = 17 pr = 0 match_op = 1 match_exp = ^770555+ match_flags = 0 subst_exp = ^(*770555*)(.+) repl_exp = \2 need to remove 770555 on cfg file if (dp_translate("17", "$rU/$rU")){ } Thanks ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Strip prefix
Did you make all the changes I suggested or only changed the repl_exp? I detailed changes needed to the match_exp and subst_exp as well. Ben Newlin From: Users on behalf of morris edery Date: Wednesday, June 5, 2024 at 12:44 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments Still no luck. when i add repl_exp = \1 i get this Jun 5 12:13:04 [12250] DBG:dialplan:dp_translate_f: input is 7705557867129454 Jun 5 12:13:04 [12250] DBG:dialplan:dp_translate_f: no information available for dpid 17 DBG:sl:sl_reply_error: error text is Bad URI (475/SL) On Wed, Jun 5, 2024 at 10:04 AM Ben Newlin mailto:ben.new...@genesys.com>> wrote: There’s a few issues. 1. You are missing a “.” in your match_exp. The way you have it written will only match repeating digit 5 after the prefix. 2. Your subst_exp is too greedy. The wildcards in the first grouping will make that grouping match the whole string, and there will be nothing left for the second grouping (or it won’t match at all because of the + in the second grouping, not sure). If you are trying to match a fixed-string prefix you don’t need wildcards for that. You also don’t need to capture that grouping, since you aren’t using it in the replace. Try this: dpid = 17 pr = 0 match_op = 1 match_exp = ^770555.+ match_flags = 0 subst_exp = ^770555(.+) repl_exp = \1 Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of morris edery mailto:morrised...@gmail.com>> Date: Wednesday, June 5, 2024 at 12:48 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments Hello Team, im trying to strip a prefix with dialplan from a number and from some reason have no success on that , please tell me what im doing wrong ? below opensips 2.4.8 dpid = 17 pr = 0 match_op = 1 match_exp = ^770555+ match_flags = 0 subst_exp = ^(*770555*)(.+) repl_exp = \2 need to remove 770555 on cfg file if (dp_translate("17", "$rU/$rU")){ } Thanks ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] E_ACC_EVENT Question
Yes, but I did give the wrong link for [1]. [1] - https://www.opensips.org/Documentation/Script-CoreVar-3-4#param I will also note that if you are only using the extra fields for events then defining the log name does seem a bit unnecessary as it is only changing the name used to access the $param. This could actually be more confusing; maybe better to have the $acc_extra and $param names align. Ben Newlin From: Bogdan-Andrei Iancu Date: Wednesday, June 5, 2024 at 12:31 PM To: Ben Newlin , OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] E_ACC_EVENT Question EXTERNAL EMAIL - Please use caution with links and attachments yes, good spotting, Ben is right here, all the fields provided by an event must be fetched via $param() Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 05.06.2024 18:55, Ben Newlin wrote: If I’m understanding correctly, acc_extra variables are only used during message processing; they are not visible in event routes. Parameters passed to event routes are accessed using the $param() notation [1]. Per the ACC module docs [2]: * Events accounting - log_name will be the name of the parameter in the event raised. So I believe in your config it would be: #Extra Params $var(src_ip) = $param(source_ip); $var(dst_ip) = $param (destination_ip); Note that the param name is the log name, not the tag. As an additional note, your reference to the $si variable as a sanity check is not valid as that variable is also only available in a message processing route. Its value is not defined in an event route. [1] - https://www.opensips.org/Documentation/Script-Routes-3-4#toc9<https://www.opensips.org/Documentation/Script-Routes-3-4#toc9> [2] - https://opensips.org/docs/modules/3.4.x/acc.html#ACC-extra-id<https://opensips.org/docs/modules/3.4.x/acc.html#ACC-extra-id> Ben Newlin From: Users <mailto:users-boun...@lists.opensips.org> on behalf of Alexander Perkins <mailto:alexanderhenryperk...@gmail.com> Date: Wednesday, June 5, 2024 at 11:37 AM To: Bogdan-Andrei Iancu <mailto:bog...@opensips.org> Cc: OpenSIPS users mailling list <mailto:users@lists.opensips.org> Subject: Re: [OpenSIPS-Users] E_ACC_EVENT Question EXTERNAL EMAIL - Please use caution with links and attachments Hi Bogdan. Thank you for getting back to me. When we take a look at what populates, they are either incorrect (for example, src_ip is always 0.0.0.0, but we see it correct in the route block), or they are null. Let me know if this helps. Thank you, Alex On Wed, Jun 5, 2024 at 11:33 AM Bogdan-Andrei Iancu mailto:bog...@opensips.org>> wrote: Hi Alexander. When you say "they don't seem to populate correctly", you mean they are NULL val, or wrong value? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 04.06.2024 23:59, Alexander Perkins wrote: Hi All. We are working on implementing the E_ACC_EVENT so we may use that for accounting purposes instead of the DB. Now, most things appear to work as they should. However, when we attempt to access the extra accounting fields, they don't seem to populate correctly (I've highlighted the extra variables). Here is the config: modparam("acc","extra_fields","evi: src_ip -> source_ip; dst_ip -> destination_ip) event_route [E_ACC_EVENT] { #log on entry xlog("L_INFO","entered event_route\n"); #Default Params $var(method) = $param(method); #Extra Params $var(src_ip) = $acc_extra(src_ip); $var(source_test) = $si; $var(dst_ip) = $acc_extra(dst_ip); #log vars to test xlog("L_INFO","heres the ER variable: $var(source_test) and $var(src_ip)\n"); } What am I missing? Can someone point me in the right direction? Any help is really appreciated. Thank you, Alex Perkins ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] E_ACC_EVENT Question
If I’m understanding correctly, acc_extra variables are only used during message processing; they are not visible in event routes. Parameters passed to event routes are accessed using the $param() notation [1]. Per the ACC module docs [2]: * Events accounting - log_name will be the name of the parameter in the event raised. So I believe in your config it would be: #Extra Params $var(src_ip) = $param(source_ip); $var(dst_ip) = $param (destination_ip); Note that the param name is the log name, not the tag. As an additional note, your reference to the $si variable as a sanity check is not valid as that variable is also only available in a message processing route. Its value is not defined in an event route. [1] - https://www.opensips.org/Documentation/Script-Routes-3-4#toc9 [2] - https://opensips.org/docs/modules/3.4.x/acc.html#ACC-extra-id Ben Newlin From: Users on behalf of Alexander Perkins Date: Wednesday, June 5, 2024 at 11:37 AM To: Bogdan-Andrei Iancu Cc: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] E_ACC_EVENT Question EXTERNAL EMAIL - Please use caution with links and attachments Hi Bogdan. Thank you for getting back to me. When we take a look at what populates, they are either incorrect (for example, src_ip is always 0.0.0.0, but we see it correct in the route block), or they are null. Let me know if this helps. Thank you, Alex On Wed, Jun 5, 2024 at 11:33 AM Bogdan-Andrei Iancu mailto:bog...@opensips.org>> wrote: Hi Alexander. When you say "they don't seem to populate correctly", you mean they are NULL val, or wrong value? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 04.06.2024 23:59, Alexander Perkins wrote: Hi All. We are working on implementing the E_ACC_EVENT so we may use that for accounting purposes instead of the DB. Now, most things appear to work as they should. However, when we attempt to access the extra accounting fields, they don't seem to populate correctly (I've highlighted the extra variables). Here is the config: modparam("acc","extra_fields","evi: src_ip -> source_ip; dst_ip -> destination_ip) event_route [E_ACC_EVENT] { #log on entry xlog("L_INFO","entered event_route\n"); #Default Params $var(method) = $param(method); #Extra Params $var(src_ip) = $acc_extra(src_ip); $var(source_test) = $si; $var(dst_ip) = $acc_extra(dst_ip); #log vars to test xlog("L_INFO","heres the ER variable: $var(source_test) and $var(src_ip)\n"); } What am I missing? Can someone point me in the right direction? Any help is really appreciated. Thank you, Alex Perkins ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Strip prefix
There’s a few issues. 1. You are missing a “.” in your match_exp. The way you have it written will only match repeating digit 5 after the prefix. 2. Your subst_exp is too greedy. The wildcards in the first grouping will make that grouping match the whole string, and there will be nothing left for the second grouping (or it won’t match at all because of the + in the second grouping, not sure). If you are trying to match a fixed-string prefix you don’t need wildcards for that. You also don’t need to capture that grouping, since you aren’t using it in the replace. Try this: dpid = 17 pr = 0 match_op = 1 match_exp = ^770555.+ match_flags = 0 subst_exp = ^770555(.+) repl_exp = \1 Ben Newlin From: Users on behalf of morris edery Date: Wednesday, June 5, 2024 at 12:48 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Strip prefix EXTERNAL EMAIL - Please use caution with links and attachments Hello Team, im trying to strip a prefix with dialplan from a number and from some reason have no success on that , please tell me what im doing wrong ? below opensips 2.4.8 dpid = 17 pr = 0 match_op = 1 match_exp = ^770555+ match_flags = 0 subst_exp = ^(*770555*)(.+) repl_exp = \2 need to remove 770555 on cfg file if (dp_translate("17", "$rU/$rU")){ } Thanks ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] opensips not failing over on 500.
Yes, the default behavior of failure_route is to revert the received reply back upstream [1]. If failover is desired a new branch must be created by some action in the failure_route. I don’t use load_balancer but I believe for that module this would be the lb_next function [2]. [1] - https://www.opensips.org/Documentation/Script-Routes-3-5#toc3 [2] - https://opensips.org/docs/modules/3.5.x/load_balancer.html#func_lb_next Ben Newlin From: Users on behalf of Johan De Clercq Date: Wednesday, May 29, 2024 at 3:56 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] opensips not failing over on 500. EXTERNAL EMAIL - Please use caution with links and attachments Hi, I think that this is by design. when you use load_balancer and you want to failover on receiving certain cause codes, then you need to do that in failure_route, I believe. Opensips will nto failover automatically to the next destination when receiving 500. Am I correct with my assumption ? Br, Johan. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Send failed
There are many different reasons for this error. With just this one line description and no more context it isn’t possible to say why it is occurring. The most common cause of 477 errors is issues with the TCP/TLS connection to the far end. Have you tried capturing a trace of the call attempt? Have you verified your TCP/TLS settings are correct and are aligned with what the far end expects? Have you verified the message is being sent to the correct remote target to begin with? Ben Newlin From: Users on behalf of Prathibha B Date: Thursday, May 2, 2024 at 8:56 AM To: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] Send failed EXTERNAL EMAIL - Please use caution with links and attachments Can someone point me on how to resolve this issue? On Wed, 1 May 2024 at 18:49, Prathibha B mailto:prathibhab@gmail.com>> wrote: How to solve this error- 477 send failed. -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] external applications
There is no generic answer to that question. It depends on your routing script and the way your system works. The code you posted before checking for INVITE could do it, but only if it is placed in the right location. You may want to review the different types of routes used in OpenSIPS scripting [1], and what kind of message or processing is being performed in each. That may help you determine where to place your checks. Routing of a SIP request always begins in the unnamed route block. [1] - https://www.opensips.org/Documentation/Script-Routes-3-4 Ben Newlin From: Users on behalf of Prathibha B Date: Thursday, April 4, 2024 at 8:21 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments My question is not regarding exec command. How to capture the start of the call? I'm unable to get the start. Sent from Outlook for Android<https://aka.ms/AAb9ysg> From: Users on behalf of Ben Newlin Sent: Thursday, April 4, 2024 9:22:28 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] external applications Per the documentation [1], input variables to the script are provided as a separate parameter to the exec command. It does not do a direct shell execution of the entire first parameter. So it should be: exec(“script.sh”, “INVITE”); Also, for a relative command I’m not entirely sure where OpenSIPS would look. It could be the working directory or it could be the directory from which opensips was launched. Have you tried using an absolute path? Are you setting the wdir [2] parameter? [1] - https://opensips.org/docs/modules/3.4.x/exec.html#func_exec<https://opensips.org/docs/modules/3.4.x/exec.html#func_exec> [2] - https://www.opensips.org/Documentation/Script-CoreParameters-3-4#wdir<https://www.opensips.org/Documentation/Script-CoreParameters-3-4#wdir> Ben Newlin From: Users on behalf of Prathibha B Date: Thursday, April 4, 2024 at 11:32 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments I've used the above code inside the route block. On Thu, 4 Apr 2024 at 12:02, Prathibha B mailto:prathibhab@gmail.com>> wrote: if($rm == "INVITE") { xlog("Request method = $rm"); exec("script.sh \"INVITE\""); } With the above code , I am getting the Request method = INVITE twice in the log file. But the exec() is not getting executed. On Wed, 3 Apr 2024 at 19:43, Prathibha B mailto:prathibhab@gmail.com>> wrote: Yes. I am canceling the call prior to dialog creation. Sent from Outlook for Android<https://aka.ms/AAb9ysg> ________ From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Ben Newlin mailto:ben.new...@genesys.com>> Sent: Wednesday, April 3, 2024 7:03:33 PM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] external applications If your script is cancelling the call then why wouldn’t you “capture it” in the same place? Send whatever you need to whatever external entity you are using directly. You don’t need a callback to trigger if you know you are taking the action. A created dialog being cancelled should result in a state change event – to CANCELLED I think - so I assume you mean you are cancelling it prior to dialog creation, in which case there won’t be any dialog callback. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Prathibha B mailto:prathibhab@gmail.com>> Date: Wednesday, April 3, 2024 at 2:35 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments I am capturing the dropped call after ringing in failure_route, but If I cancelled during the start of the call, how to capture it. On Tue, 2 Apr 2024 at 20:38, Ben Newlin mailto:ben.new...@genesys.com>> wrote: The start of the call would be when you call “create_dialog”. The dialog state for that is “UNCONFIRMED”. I’m not sure whether a dialog state change event is raised for creation. It may only be raised when the state changes after creation. But since you control the dialog creation, you can just take whatever action you desire at that time. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Prathibha B mailto:prathibhab@gmail.com>> Date: Tuesday, April 2, 2024 at 8:05 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] external appl
Re: [OpenSIPS-Users] dashboard stats from opensips
All of the dlg_vals should be available after calling load_dialog_ctx. We are using it that way in our system. Ben Newlin From: Users on behalf of nz deals Date: Thursday, April 4, 2024 at 9:56 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] dashboard stats from opensips EXTERNAL EMAIL - Please use caution with links and attachments Much appreciated Ben, I was able to test $params so all is good with them. I was not able to access attributes which I have set after the create_dialog. create_dialog(); $dlg_val(caller) = $fu; $dlg_val(callee) = $ru; i also wanted to access $dlg_val(caller) and $dlg_val(callee) under event_route[E_DLG_STATE_CHANGED] On Thu, 4 Apr 2024 at 11:10, Ben Newlin mailto:ben.new...@genesys.com>> wrote: The parameters exposed by the E_DLG_STATE_CHANGED event are documented [1]. They are accessed using the $param notation [2]. You can then use load_dialog_ctx [3] and get all the other dialog information you need. [1] - https://opensips.org/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED<https://opensips.org/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED>. [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-4#param<https://www.opensips.org/Documentation/Script-CoreVar-3-4#param> [3] - https://opensips.org/docs/modules/3.2.x/dialog.html#func_load_dialog_ctx<https://opensips.org/docs/modules/3.2.x/dialog.html#func_load_dialog_ctx> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of nz deals mailto:nzdealsh...@gmail.com>> Date: Wednesday, April 3, 2024 at 5:38 PM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>>, Bogdan-Andrei Iancu mailto:bog...@opensips.org>> Subject: Re: [OpenSIPS-Users] dashboard stats from opensips EXTERNAL EMAIL - Please use caution with links and attachments Thank you, Brett. My thoughts have been on events and Redis ;) I'll also explore RabbitMQ, thanks for the suggestion. From what I gather, we can utilize E_DLG_STATE_CHANGED within the event route. Could you guide me on how to retrieve the dialogid/callid and its state? If I can access this information in the event_route[E_DLG_STATE_CHANGED], storing the value would be straightforward. Thanks On Thu, 4 Apr 2024 at 10:13, Brett Nemeroff mailto:br...@nemeroff.com>> wrote: I'd recommend using the events and rabbitmq. You should be able to do just about anything with that. What cps are you processing? On Wed, Apr 3, 2024 at 3:46 PM nz deals mailto:nzdealsh...@gmail.com>> wrote: Thanks Ben, The issue with the scheduled task is that it introduces a delay. I'm exploring methods to enable real-time display. By streaming events directly from OpenSIPS, we could achieve live updates on the display. Thank you Regards, Jason On Thu, 4 Apr 2024 at 06:15, Ben Newlin mailto:ben.new...@genesys.com>> wrote: OpenSIPS will already track some very basic statistics like this for you using the Statistics module. https://opensips.org/docs/modules/3.4.x/statistics.html<https://opensips.org/docs/modules/3.4.x/statistics.html> For example, the Dialog module exposes concurrent calls. We have a scheduled job that queries those stats via MI and pushes them into our external metrics system, allowing us to create dashboards from the data. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of nz deals mailto:nzdealsh...@gmail.com>> Date: Wednesday, April 3, 2024 at 1:03 PM To: Bogdan-Andrei Iancu mailto:bog...@opensips.org>> Cc: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] dashboard stats from opensips EXTERNAL EMAIL - Please use caution with links and attachments Hi Bogdan, Yes, something along the lines of the OpenSIPs control panel, but I'm looking for very basic statistics, such as the details of currently active calls and a straightforward graph displaying concurrent calls. Thank you Regards, Jason On Thu, 4 Apr 2024 at 03:27, Bogdan-Andrei Iancu mailto:bog...@opensips.org>> wrote: Hi Jason, Have you checked the Dashboard in OpenSIPS Control Panel ? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 03.04.2024 13:54, nz deals wrote: > Hi everyone, > > I'm seeking guidance on creating a dashboard. I'm considering saving > dialog events in Redis (straight from OpenSIPS), allowing my dashboard > to directly access the Redis cache. Do you think this is a wise > strategy, or do you have any alternative suggestions? Any expert's > suggestion will be highly appreciated. In fact if someone has any > example to check, raise dialog events like call, ringi
Re: [OpenSIPS-Users] question on core statistics.
Are you calling drop() anywhere in your script? https://www.opensips.org/Documentation/Script-CoreFunctions-3-4#toc13 Ben Newlin From: Users on behalf of Johan De Clercq Date: Thursday, April 18, 2024 at 5:27 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] question on core statistics. EXTERNAL EMAIL - Please use caution with links and attachments would it make sense to recompile with other flags ? And how do I set them (I don't find these of menuconfig's compile options)? Currently it has MAX_RECV_BUFFER_SIZE 262144 and BUF_SIZE 65535. Can somebody explain also what both flags mean. Op do 18 apr 2024 om 11:07 schreef Johan De Clercq mailto:jo...@democon.be>>: would it make sense to recompile with other flags ? Currently it has MAX_RECV_BUFFER_SIZE 262144 and BUF_SIZE 65535. Can somebody explain also what both flags mean. flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535 poll method support: poll, epoll, sigio_rt, select. Op do 18 apr 2024 om 10:32 schreef Johan De Clercq mailto:jo...@democon.be>>: Guys, I have an opensips instance running with 24 worker children. The worker load is very low. UDP queues are on 50 megs. when i query via the OS cat /proc/net/udp sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode ref pointer drops 590: 03231D0A:13C4 : 07 : 00: 00 413684019 2 880074820bc0 0 591: 03231D0A:13C5 : 07 : 00: 00 413766438 2 880465e4a440 0 592: 03231D0A:13C6 : 07 : 00: 00 412035865 2 8803e5a56b80 0 934: 01231D0A:151C : 07 : 00: 00 26790 2 88046c054840 0 935: 0201FFEF:151D : 07 : 00: 00 26787 2 88046c054bc0 0 935: 01231D0A:151D : 07 : 00: 00 26791 2 88046c0544c0 0 1972: :D92A : 07 : 00: 00 15506 2 88046dce5040 0 5479: :E6DD : 07 : 00: 00 22811 2 880465e4ab40 0 12075: AA0914AC:00A1 : 07 : 00: 00 20572 2 88086d020800 0 12075: 017F:00A1 : 07 : 00: 00 20571 2 88086d020b80 0 13320: :857E : 07 : 00: 1000 17515 2 8800368ac780 0 15661: :CEA3 : 07 : 00: 00 15505 2 8800368acb00 0 => no drops what worries me is that there are drop requests and they go up when I query via the mi interface opensipsctl fifo get_statistics drop_requests core:drop_requests:: 198107 opensipsctl fifo get_statistics drop_requests core:drop_requests:: 199157 opensipsctl_reg fifo get_statistics drop_requests core:drop_requests:: 204116 I don't see any memory issue, also the processload is low. so 3 questions: - what exactly is drop_request. - do I need to worry about this - how can I make them go lower. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] another question on sip format's.
As far as I can tell though all the examples are valid for the userinfo portion of the URI. SIP-URI = sip: [ userinfo ] hostport uri-parameters [ headers ] SIPS-URI = sips: [ userinfo ] hostport uri-parameters [ headers ] userinfo = ( user / telephone-subscriber ) [ ":" password ] "@" user = 1*( unreserved / escaped / user-unreserved ) user-unreserved = "&" / "=" / "+" / "$" / "," / ";" / "?" / "/" password = *( unreserved / escaped / "&" / "=" / "+" / "$" / "," ) As far as I know, user parameters of this type aren’t explicitly used or defined by RFC 3261 for SIP URIs; they really come from tel URIs [1]. But their use in SIP is widespread and defined in various other RFCs as well. [1] - https://datatracker.ietf.org/doc/html/rfc3966 Ben Newlin From: Users on behalf of Bogdan-Andrei Iancu Date: Thursday, April 11, 2024 at 10:26 AM To: OpenSIPS users mailling list , Johan De Clercq Subject: Re: [OpenSIPS-Users] another question on sip format's. EXTERNAL EMAIL - Please use caution with links and attachments According to the grammar, the URI params are ONLY after the domain part (see https://www.ietf.org/rfc/rfc3261.html<https://www.ietf.org/rfc/rfc3261.html> page 222) SIP-URI = "sip:" [ userinfo ] hostport uri-parameters [ headers ] SIPS-URI = "sips:" [ userinfo ] hostport uri-parameters [ headers ] Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 11.04.2024 15:23, Johan De Clercq wrote: Can param's be added anywhere in a user part. e.g. sip:0123456789;gw=case106@1.2.3.4<mailto:case106@1.2.3.4> //this is for sure valid. sip:gw=case107;0123456789@1.2.3.4<mailto:case107%3B0123456789@1.2.3.4> sip:gw=case108;0123456789;gw=case108@1.2.3.4<mailto:case108@1.2.3.4> the fist one is for sure valid, but what about the other two ? BR, ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] on from and to header.
RFC 3261 is explicit that the From and To headers in a response MUST be equal to those in the request, with the exception of the potential addition of a tag in the To header if not already present. https://www.rfc-editor.org/rfc/rfc3261.html#section-8.2.6.2 Ben Newlin From: Users on behalf of Johan De Clercq Date: Wednesday, April 10, 2024 at 9:44 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] on from and to header. EXTERNAL EMAIL - Please use caution with links and attachments This is more a protocol question then anything else. A sends a call B INVITE B@5.6.7.8<mailto:B@5.6.7.8> from: http://sip:A@1.2.3.4:5060>>;tag=1 to: mailto:sip%3AB@5.6.7.8>> call-id: 1 .. B responds with from and to in e164 format 200 OK from: http://sip:+32A@1.2.3.4:5060>>;tag=1 to: mailto:sip%3A%2B32B@5.6.7.8>>; tag=2 call-id: 1 My gut feeling says to me that A will not like this and hence that B should respong with A and B instead of +32A and +32B. But can somebody explain me why or why not? Best regards, Johan. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Waiting for 200 OK
This is a valid point that I missed. You can’t send an INVITE back to the UAC while the original INVITE remains unanswered. The UAC should/must respond with a 491 Request Pending. This is the use case that UPDATE was created for, and that would work if the UAC supports it. If it must be INVITE then you would have to be a B2BUA because you would have to answer the initial INVITE from the UAC while the outgoing INVITE was still in progress, so that you could do the re-INVITE. Ben Newlin From: Bogdan-Andrei Iancu Date: Tuesday, April 9, 2024 at 10:55 AM To: Parthesh Bhavsar , OpenSIPS users mailling list , Ben Newlin Subject: Re: [OpenSIPS-Users] Waiting for 200 OK EXTERNAL EMAIL - Please use caution with links and attachments Hi, my 2 cents here - how comes you want to send a RE-INVITE _BEFORE_ having the dialog established??? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 09.04.2024 17:35, Parthesh Bhavsar via Users wrote: It seems after setting T_fr_timeout parameter it was sending a CANCEL request to another leg but for my requirement I need to send Reinvite. Also for generating Reinvite I have used dlg_send_sequential() as I use opensips as a proxy server. Any other modules on which I look for? Regards, Parthesh Bhavsar | Software Engineer | VOIP On Tue, Apr 9, 2024 at 7:36 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: The timing requirement can be solved using the $T_fr_timeout parameter [1]. For sending a re-Invite back to the UAC I believe you’d have to be a B2BUA. [1] - https://opensips.org/docs/modules/3.4.x/tm.html#pv_T_fr_timeout<https://opensips.org/docs/modules/3.4.x/tm.html#pv_T_fr_timeout> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Parthesh Bhavsar via Users mailto:users@lists.opensips.org>> Date: Tuesday, April 9, 2024 at 5:31 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: [OpenSIPS-Users] Waiting for 200 OK EXTERNAL EMAIL - Please use caution with links and attachments Hello, I have a requirement where If I get 183 responses then I need to wait for a specific period of time for 200 OK and if 200 OK is not received in that time then I need to send Reinvte back to UA with some modifications. I have gone through the SST module but have not found anything relevant to match my requirements. Can anyone suggest some module or function on which I can go further to meet my requirements. Regards, Parthesh Bhavsar | Software Engineer | VOIP [https://ecosmobnew.ecosmob.net/wp-content/uploads/2024/04/opensip-email-signature.jpg]<https://www.ecosmob.com/opensips-summit> Disclaimer In addition to generic Disclaimer which you have agreed on our website, any views or opinions presented in this email are solely those of the originator and do not necessarily represent those of the Company or its sister concerns. Any liability (in negligence, contract or otherwise) arising from any third party taking any action, or refraining from taking any action on the basis of any of the information contained in this email is hereby excluded. Confidentiality This communication (including any attachment/s) is intended only for the use of the addressee(s) and contains information that is PRIVILEGED AND CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying of this communication is prohibited. Please inform originator if you have received it in error. Caution for viruses, malware etc. This communication, including any attachments, may not be free of viruses, trojans, similar or new contaminants/malware, interceptions or interference, and may not be compatible with your systems. You shall carry out virus/malware scanning on your own before opening any attachment to this e-mail. The sender of this e-mail and Company including its sister concerns shall not be liable for any damage that may incur to you as a result of viruses, incompleteness of this message, a delay in receipt of this message or any other computer problems. [https://ecosmobnew.ecosmob.net/wp-content/uploads/2024/04/opensip-email-signature.jpg]<https://www.ecosmob.com/opensips-summit/> Disclaimer In addition to generic Disclaimer which you have agreed on our website, any views or opinions presented in this email are solely those of the originator and do not necessarily represent those of the Company or its sister concerns. Any liability (in negligence, contract or otherwise) arising from any third party taking any action, or refraining from taking any action on the basis of any of the information contained in this email is hereby excluded. Confidentiality This communication (including any attachment/s) is intended only for the use of the ad
Re: [OpenSIPS-Users] Waiting for 200 OK
You’re right, that timer would drop the call. Not sure why I was thinking that would work. Sorry! Ben Newlin From: Parthesh Bhavsar Date: Tuesday, April 9, 2024 at 10:35 AM To: Ben Newlin Cc: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Waiting for 200 OK EXTERNAL EMAIL - Please use caution with links and attachments It seems after setting T_fr_timeout parameter it was sending a CANCEL request to another leg but for my requirement I need to send Reinvite. Also for generating Reinvite I have used dlg_send_sequential() as I use opensips as a proxy server. Any other modules on which I look for? Regards, Parthesh Bhavsar | Software Engineer | VOIP On Tue, Apr 9, 2024 at 7:36 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: The timing requirement can be solved using the $T_fr_timeout parameter [1]. For sending a re-Invite back to the UAC I believe you’d have to be a B2BUA. [1] - https://opensips.org/docs/modules/3.4.x/tm.html#pv_T_fr_timeout<https://opensips.org/docs/modules/3.4.x/tm.html#pv_T_fr_timeout> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Parthesh Bhavsar via Users mailto:users@lists.opensips.org>> Date: Tuesday, April 9, 2024 at 5:31 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: [OpenSIPS-Users] Waiting for 200 OK EXTERNAL EMAIL - Please use caution with links and attachments Hello, I have a requirement where If I get 183 responses then I need to wait for a specific period of time for 200 OK and if 200 OK is not received in that time then I need to send Reinvte back to UA with some modifications. I have gone through the SST module but have not found anything relevant to match my requirements. Can anyone suggest some module or function on which I can go further to meet my requirements. Regards, Parthesh Bhavsar | Software Engineer | VOIP [https://ecosmobnew.ecosmob.net/wp-content/uploads/2024/04/opensip-email-signature.jpg]<https://www.ecosmob.com/opensips-summit> Disclaimer In addition to generic Disclaimer which you have agreed on our website, any views or opinions presented in this email are solely those of the originator and do not necessarily represent those of the Company or its sister concerns. Any liability (in negligence, contract or otherwise) arising from any third party taking any action, or refraining from taking any action on the basis of any of the information contained in this email is hereby excluded. Confidentiality This communication (including any attachment/s) is intended only for the use of the addressee(s) and contains information that is PRIVILEGED AND CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying of this communication is prohibited. Please inform originator if you have received it in error. Caution for viruses, malware etc. This communication, including any attachments, may not be free of viruses, trojans, similar or new contaminants/malware, interceptions or interference, and may not be compatible with your systems. You shall carry out virus/malware scanning on your own before opening any attachment to this e-mail. The sender of this e-mail and Company including its sister concerns shall not be liable for any damage that may incur to you as a result of viruses, incompleteness of this message, a delay in receipt of this message or any other computer problems. [https://ecosmobnew.ecosmob.net/wp-content/uploads/2024/04/opensip-email-signature.jpg]<https://www.ecosmob.com/opensips-summit/> Disclaimer In addition to generic Disclaimer which you have agreed on our website, any views or opinions presented in this email are solely those of the originator and do not necessarily represent those of the Company or its sister concerns. Any liability (in negligence, contract or otherwise) arising from any third party taking any action, or refraining from taking any action on the basis of any of the information contained in this email is hereby excluded. Confidentiality This communication (including any attachment/s) is intended only for the use of the addressee(s) and contains information that is PRIVILEGED AND CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying of this communication is prohibited. Please inform originator if you have received it in error. Caution for viruses, malware etc. This communication, including any attachments, may not be free of viruses, trojans, similar or new contaminants/malware, interceptions or interference, and may not be compatible with your systems. You shall carry out virus/malware scanning on your own before opening any attachment to this e-mail. The sender of this e-mail and Company including its sister concerns shall not be liable for any damage that may incur to you as a result of viruses, incompleteness of this message, a delay in rec
Re: [OpenSIPS-Users] Waiting for 200 OK
The timing requirement can be solved using the $T_fr_timeout parameter [1]. For sending a re-Invite back to the UAC I believe you’d have to be a B2BUA. [1] - https://opensips.org/docs/modules/3.4.x/tm.html#pv_T_fr_timeout Ben Newlin From: Users on behalf of Parthesh Bhavsar via Users Date: Tuesday, April 9, 2024 at 5:31 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Waiting for 200 OK EXTERNAL EMAIL - Please use caution with links and attachments Hello, I have a requirement where If I get 183 responses then I need to wait for a specific period of time for 200 OK and if 200 OK is not received in that time then I need to send Reinvte back to UA with some modifications. I have gone through the SST module but have not found anything relevant to match my requirements. Can anyone suggest some module or function on which I can go further to meet my requirements. Regards, Parthesh Bhavsar | Software Engineer | VOIP [https://ecosmobnew.ecosmob.net/wp-content/uploads/2024/04/opensip-email-signature.jpg]<https://www.ecosmob.com/opensips-summit/> Disclaimer In addition to generic Disclaimer which you have agreed on our website, any views or opinions presented in this email are solely those of the originator and do not necessarily represent those of the Company or its sister concerns. Any liability (in negligence, contract or otherwise) arising from any third party taking any action, or refraining from taking any action on the basis of any of the information contained in this email is hereby excluded. Confidentiality This communication (including any attachment/s) is intended only for the use of the addressee(s) and contains information that is PRIVILEGED AND CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying of this communication is prohibited. Please inform originator if you have received it in error. Caution for viruses, malware etc. This communication, including any attachments, may not be free of viruses, trojans, similar or new contaminants/malware, interceptions or interference, and may not be compatible with your systems. You shall carry out virus/malware scanning on your own before opening any attachment to this e-mail. The sender of this e-mail and Company including its sister concerns shall not be liable for any damage that may incur to you as a result of viruses, incompleteness of this message, a delay in receipt of this message or any other computer problems. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] external applications
If you are executing that as the first command in the main route block the dialog will not have been created yet. The $DLG_status variable is only valid after the dialog has been created either by a call to create_dialog or by using another module that requires and auto-creates a dialog. Additionally, $DLG_status is documented to only be available for sequential requests, and only after calling loose_route (or match_dialog or topology_hiding_match, I believe). https://opensips.org/docs/modules/3.4.x/dialog.html#pv_DLG_status https://opensips.org/docs/modules/3.4.x/dialog.html#func_create_dialog I still don’t understand why you need some event to capture the start of the call. Even if you are not creating the dialog directly, your routing script has to have some sort of logic that is specific to a new call. Whatever you are trying to “capture” can be captured there. If you cannot identify the path a new call will take through your script, I don’t think anyone here will be able to help you much, at least not without the entire script. Ben Newlin From: Users on behalf of Prathibha B Date: Friday, April 5, 2024 at 3:42 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments route { if($DLG_status == 1) xlog("UNCONFIRMED\n"); } On Fri, 5 Apr 2024 at 13:09, Prathibha B mailto:prathibhab@gmail.com>> wrote: I am not getting $DLG_status = UNCONFORMED at the start of the call. Can someone help? ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] external applications
Per the documentation [1], input variables to the script are provided as a separate parameter to the exec command. It does not do a direct shell execution of the entire first parameter. So it should be: exec(“script.sh”, “INVITE”); Also, for a relative command I’m not entirely sure where OpenSIPS would look. It could be the working directory or it could be the directory from which opensips was launched. Have you tried using an absolute path? Are you setting the wdir [2] parameter? [1] - https://opensips.org/docs/modules/3.4.x/exec.html#func_exec [2] - https://www.opensips.org/Documentation/Script-CoreParameters-3-4#wdir Ben Newlin From: Users on behalf of Prathibha B Date: Thursday, April 4, 2024 at 11:32 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments I've used the above code inside the route block. On Thu, 4 Apr 2024 at 12:02, Prathibha B mailto:prathibhab@gmail.com>> wrote: if($rm == "INVITE") { xlog("Request method = $rm"); exec("script.sh \"INVITE\""); } With the above code , I am getting the Request method = INVITE twice in the log file. But the exec() is not getting executed. On Wed, 3 Apr 2024 at 19:43, Prathibha B mailto:prathibhab@gmail.com>> wrote: Yes. I am canceling the call prior to dialog creation. Sent from Outlook for Android<https://aka.ms/AAb9ysg> From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Ben Newlin mailto:ben.new...@genesys.com>> Sent: Wednesday, April 3, 2024 7:03:33 PM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] external applications If your script is cancelling the call then why wouldn’t you “capture it” in the same place? Send whatever you need to whatever external entity you are using directly. You don’t need a callback to trigger if you know you are taking the action. A created dialog being cancelled should result in a state change event – to CANCELLED I think - so I assume you mean you are cancelling it prior to dialog creation, in which case there won’t be any dialog callback. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Prathibha B mailto:prathibhab@gmail.com>> Date: Wednesday, April 3, 2024 at 2:35 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments I am capturing the dropped call after ringing in failure_route, but If I cancelled during the start of the call, how to capture it. On Tue, 2 Apr 2024 at 20:38, Ben Newlin mailto:ben.new...@genesys.com>> wrote: The start of the call would be when you call “create_dialog”. The dialog state for that is “UNCONFIRMED”. I’m not sure whether a dialog state change event is raised for creation. It may only be raised when the state changes after creation. But since you control the dialog creation, you can just take whatever action you desire at that time. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Prathibha B mailto:prathibhab@gmail.com>> Date: Tuesday, April 2, 2024 at 8:05 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments I tried is_method("INVITE"), but it is getting called only at the start of RINGING. On Tue, 2 Apr 2024 at 15:09, Prathibha B mailto:prathibhab@gmail.com>> wrote: I am able to capture the trying status also. But not getting the START of the call... On Tue, 2 Apr 2024 at 14:59, Prathibha B mailto:prathibhab@gmail.com>> wrote: How do I identify the START and TRYING state of the call? I am able to capture RINGING, ANSWER and TERMINATED states. On Tue, 2 Apr 2024 at 14:51, Prathibha B mailto:prathibhab@gmail.com>> wrote: I tried event_route[E_DLG_STATE_CHANGED] { } I am getting syntax error. On Tue, 2 Apr 2024 at 14:45, Prathibha B mailto:prathibhab@gmail.com>> wrote: How to use E_DLG_STATE_CHANGED to identify the start of the call? On Wed, 20 Mar 2024 at 19:46, Ben Newlin mailto:ben.new...@genesys.com>> wrote: You can also use the REST client. And there are many other ways, as well. There is no single correct answer to the vague question of connecting to any generic “external application”. You must understand your systems and decide the best approach depending on the needs and capabilities of both the external application and OpenSIPS. Ben Newlin From: Users mai
Re: [OpenSIPS-Users] dashboard stats from opensips
The parameters exposed by the E_DLG_STATE_CHANGED event are documented [1]. They are accessed using the $param notation [2]. You can then use load_dialog_ctx [3] and get all the other dialog information you need. [1] - https://opensips.org/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED. [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-4#param [3] - https://opensips.org/docs/modules/3.2.x/dialog.html#func_load_dialog_ctx Ben Newlin From: Users on behalf of nz deals Date: Wednesday, April 3, 2024 at 5:38 PM To: OpenSIPS users mailling list , Bogdan-Andrei Iancu Subject: Re: [OpenSIPS-Users] dashboard stats from opensips EXTERNAL EMAIL - Please use caution with links and attachments Thank you, Brett. My thoughts have been on events and Redis ;) I'll also explore RabbitMQ, thanks for the suggestion. From what I gather, we can utilize E_DLG_STATE_CHANGED within the event route. Could you guide me on how to retrieve the dialogid/callid and its state? If I can access this information in the event_route[E_DLG_STATE_CHANGED], storing the value would be straightforward. Thanks On Thu, 4 Apr 2024 at 10:13, Brett Nemeroff mailto:br...@nemeroff.com>> wrote: I'd recommend using the events and rabbitmq. You should be able to do just about anything with that. What cps are you processing? On Wed, Apr 3, 2024 at 3:46 PM nz deals mailto:nzdealsh...@gmail.com>> wrote: Thanks Ben, The issue with the scheduled task is that it introduces a delay. I'm exploring methods to enable real-time display. By streaming events directly from OpenSIPS, we could achieve live updates on the display. Thank you Regards, Jason On Thu, 4 Apr 2024 at 06:15, Ben Newlin mailto:ben.new...@genesys.com>> wrote: OpenSIPS will already track some very basic statistics like this for you using the Statistics module. https://opensips.org/docs/modules/3.4.x/statistics.html<https://opensips.org/docs/modules/3.4.x/statistics.html> For example, the Dialog module exposes concurrent calls. We have a scheduled job that queries those stats via MI and pushes them into our external metrics system, allowing us to create dashboards from the data. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of nz deals mailto:nzdealsh...@gmail.com>> Date: Wednesday, April 3, 2024 at 1:03 PM To: Bogdan-Andrei Iancu mailto:bog...@opensips.org>> Cc: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] dashboard stats from opensips EXTERNAL EMAIL - Please use caution with links and attachments Hi Bogdan, Yes, something along the lines of the OpenSIPs control panel, but I'm looking for very basic statistics, such as the details of currently active calls and a straightforward graph displaying concurrent calls. Thank you Regards, Jason On Thu, 4 Apr 2024 at 03:27, Bogdan-Andrei Iancu mailto:bog...@opensips.org>> wrote: Hi Jason, Have you checked the Dashboard in OpenSIPS Control Panel ? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 03.04.2024 13:54, nz deals wrote: > Hi everyone, > > I'm seeking guidance on creating a dashboard. I'm considering saving > dialog events in Redis (straight from OpenSIPS), allowing my dashboard > to directly access the Redis cache. Do you think this is a wise > strategy, or do you have any alternative suggestions? Any expert's > suggestion will be highly appreciated. In fact if someone has any > example to check, raise dialog events like call, ringing, 183, > answered , cancel and bye etc... > > Thank you > > Regards, > Jason > > ___ > Users mailing list > Users@lists.opensips.org<mailto:Users@lists.opensips.org> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] dashboard stats from opensips
OpenSIPS will already track some very basic statistics like this for you using the Statistics module. https://opensips.org/docs/modules/3.4.x/statistics.html For example, the Dialog module exposes concurrent calls. We have a scheduled job that queries those stats via MI and pushes them into our external metrics system, allowing us to create dashboards from the data. Ben Newlin From: Users on behalf of nz deals Date: Wednesday, April 3, 2024 at 1:03 PM To: Bogdan-Andrei Iancu Cc: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] dashboard stats from opensips EXTERNAL EMAIL - Please use caution with links and attachments Hi Bogdan, Yes, something along the lines of the OpenSIPs control panel, but I'm looking for very basic statistics, such as the details of currently active calls and a straightforward graph displaying concurrent calls. Thank you Regards, Jason On Thu, 4 Apr 2024 at 03:27, Bogdan-Andrei Iancu mailto:bog...@opensips.org>> wrote: Hi Jason, Have you checked the Dashboard in OpenSIPS Control Panel ? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 03.04.2024 13:54, nz deals wrote: > Hi everyone, > > I'm seeking guidance on creating a dashboard. I'm considering saving > dialog events in Redis (straight from OpenSIPS), allowing my dashboard > to directly access the Redis cache. Do you think this is a wise > strategy, or do you have any alternative suggestions? Any expert's > suggestion will be highly appreciated. In fact if someone has any > example to check, raise dialog events like call, ringing, 183, > answered , cancel and bye etc... > > Thank you > > Regards, > Jason > > ___ > Users mailing list > Users@lists.opensips.org<mailto:Users@lists.opensips.org> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] external applications
If your script is cancelling the call then why wouldn’t you “capture it” in the same place? Send whatever you need to whatever external entity you are using directly. You don’t need a callback to trigger if you know you are taking the action. A created dialog being cancelled should result in a state change event – to CANCELLED I think - so I assume you mean you are cancelling it prior to dialog creation, in which case there won’t be any dialog callback. Ben Newlin From: Users on behalf of Prathibha B Date: Wednesday, April 3, 2024 at 2:35 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments I am capturing the dropped call after ringing in failure_route, but If I cancelled during the start of the call, how to capture it. On Tue, 2 Apr 2024 at 20:38, Ben Newlin mailto:ben.new...@genesys.com>> wrote: The start of the call would be when you call “create_dialog”. The dialog state for that is “UNCONFIRMED”. I’m not sure whether a dialog state change event is raised for creation. It may only be raised when the state changes after creation. But since you control the dialog creation, you can just take whatever action you desire at that time. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Prathibha B mailto:prathibhab@gmail.com>> Date: Tuesday, April 2, 2024 at 8:05 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments I tried is_method("INVITE"), but it is getting called only at the start of RINGING. On Tue, 2 Apr 2024 at 15:09, Prathibha B mailto:prathibhab@gmail.com>> wrote: I am able to capture the trying status also. But not getting the START of the call... On Tue, 2 Apr 2024 at 14:59, Prathibha B mailto:prathibhab@gmail.com>> wrote: How do I identify the START and TRYING state of the call? I am able to capture RINGING, ANSWER and TERMINATED states. On Tue, 2 Apr 2024 at 14:51, Prathibha B mailto:prathibhab@gmail.com>> wrote: I tried event_route[E_DLG_STATE_CHANGED] { } I am getting syntax error. On Tue, 2 Apr 2024 at 14:45, Prathibha B mailto:prathibhab@gmail.com>> wrote: How to use E_DLG_STATE_CHANGED to identify the start of the call? On Wed, 20 Mar 2024 at 19:46, Ben Newlin mailto:ben.new...@genesys.com>> wrote: You can also use the REST client. And there are many other ways, as well. There is no single correct answer to the vague question of connecting to any generic “external application”. You must understand your systems and decide the best approach depending on the needs and capabilities of both the external application and OpenSIPS. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Bogdan-Andrei Iancu mailto:bog...@opensips.org>> Date: Wednesday, March 20, 2024 at 10:06 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>>, Prathibha B mailto:prathibhab@gmail.com>> Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments Use the dialog events: https://opensips.org/html/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED<https://opensips.org/html/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED> And you subscribe from outside OpenSIPS for such events: https://www.opensips.org/Documentation/Interface-Events-3-4<https://www.opensips.org/Documentation/Interface-Events-3-4> Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 20.03.2024 12:16, Prathibha B wrote: No. I want to pass START, CONNECT, END messages from OpenSIPS to external application. On Wed, 20 Mar 2024 at 15:42, Marcin Groszek mailto:mar...@voipplus.net>> wrote: Well, to execute external command from opensips you may want to use EXEC module. this is a manual for v3.2: https://opensips.org/html/docs/modules/3.2.x/exec.html<https://opensips.org/html/docs/modules/3.2.x/exec.html> On 3/20/2024 5:00 AM, Prathibha B wrote: How to integrate OpenSIPS with external applications? -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> -- Best Regards: Marcin Groszek Business Phone Service https://www.voipplus.net<https://www.voipplus.net>
Re: [OpenSIPS-Users] Trying for more than 60 secs
Can you clarify what you mean when you say “User keeps on Trying”? Do you mean the calling party? Those settings only affect OpenSIPS’ behavior. Also confirm what you mean by “User B is not available”. Is the SIP endpoint not responding at all, is it sending provisional responses, or is it sending a “Not Available” response like 480? These settings only control behavior in the first scenario. If User B is sending responses, it will reset the timer with every response, that is per RFC3261 (this was actually discussed in another very recent thread here). Ben Newlin From: Users on behalf of Prathibha B Date: Wednesday, April 3, 2024 at 12:54 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Trying for more than 60 secs EXTERNAL EMAIL - Please use caution with links and attachments modparam("tm", "fr_timeout", 45) modparam("tm", "fr_inv_timeout", 60) These are the tm parameters I've set in opensips. When User B is not available, User keeps on Trying without stopping. -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] external applications
The start of the call would be when you call “create_dialog”. The dialog state for that is “UNCONFIRMED”. I’m not sure whether a dialog state change event is raised for creation. It may only be raised when the state changes after creation. But since you control the dialog creation, you can just take whatever action you desire at that time. Ben Newlin From: Users on behalf of Prathibha B Date: Tuesday, April 2, 2024 at 8:05 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments I tried is_method("INVITE"), but it is getting called only at the start of RINGING. On Tue, 2 Apr 2024 at 15:09, Prathibha B mailto:prathibhab@gmail.com>> wrote: I am able to capture the trying status also. But not getting the START of the call... On Tue, 2 Apr 2024 at 14:59, Prathibha B mailto:prathibhab@gmail.com>> wrote: How do I identify the START and TRYING state of the call? I am able to capture RINGING, ANSWER and TERMINATED states. On Tue, 2 Apr 2024 at 14:51, Prathibha B mailto:prathibhab@gmail.com>> wrote: I tried event_route[E_DLG_STATE_CHANGED] { } I am getting syntax error. On Tue, 2 Apr 2024 at 14:45, Prathibha B mailto:prathibhab@gmail.com>> wrote: How to use E_DLG_STATE_CHANGED to identify the start of the call? On Wed, 20 Mar 2024 at 19:46, Ben Newlin mailto:ben.new...@genesys.com>> wrote: You can also use the REST client. And there are many other ways, as well. There is no single correct answer to the vague question of connecting to any generic “external application”. You must understand your systems and decide the best approach depending on the needs and capabilities of both the external application and OpenSIPS. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Bogdan-Andrei Iancu mailto:bog...@opensips.org>> Date: Wednesday, March 20, 2024 at 10:06 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>>, Prathibha B mailto:prathibhab@gmail.com>> Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments Use the dialog events: https://opensips.org/html/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED<https://opensips.org/html/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED> And you subscribe from outside OpenSIPS for such events: https://www.opensips.org/Documentation/Interface-Events-3-4<https://www.opensips.org/Documentation/Interface-Events-3-4> Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 20.03.2024 12:16, Prathibha B wrote: No. I want to pass START, CONNECT, END messages from OpenSIPS to external application. On Wed, 20 Mar 2024 at 15:42, Marcin Groszek mailto:mar...@voipplus.net>> wrote: Well, to execute external command from opensips you may want to use EXEC module. this is a manual for v3.2: https://opensips.org/html/docs/modules/3.2.x/exec.html<https://opensips.org/html/docs/modules/3.2.x/exec.html> On 3/20/2024 5:00 AM, Prathibha B wrote: How to integrate OpenSIPS with external applications? -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> -- Best Regards: Marcin Groszek Business Phone Service https://www.voipplus.net<https://www.voipplus.net> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> -- Regards, B.Prathibha -- Regards, B.Prathibha -- Regards, B.Prathibha -- Regards, B.Prathibha -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Trncated SIP header .
We use PostgreSQL and we ran into this as well. We altered all of our tables to use type “TEXT” for these columns, which has no length limit, instead of the default VARCHAR(255). We have not had any issues with this; OpenSIPS doesn’t seem to care about the length. Ben Newlin From: Users on behalf of Sasmita Panda Date: Tuesday, April 2, 2024 at 7:20 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Trncated SIP header . EXTERNAL EMAIL - Please use caution with links and attachments I am using opensips 3.2 . I have added a custom header in the sip requests like REGISTER and INVITE called X-Tag . This tag (X-Tag header) has a large number of key value pairs that get printed in the logs . Around 50 key value pair strings . I am not able to port the data here as that makes my message very large and that gets rejected before posting in the group . In the wireshark trace in the server the header value gets truncated and also in the DB attr column shows the truncated value . Is this because the attr column size is ( string of 255 ) . If so then can I increase this value or is there any restriction by opensips ? Even if the data is not showing in the DB , is opensips able to save the entire data and process that during the call ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] unix timestamp in microseconds
There are many ways and they are all clearly documented: https://opensips.org/docs/modules/3.4.x/cfgutils.html#func_get_accurate_time https://www.opensips.org/Documentation/Script-CoreFunctions-3-4#get_timestamp https://www.opensips.org/Documentation/Script-CoreVar-3-4#time https://www.opensips.org/Documentation/Script-CoreVar-3-4#Tsm Please do try to find answers on your own before engaging the mailing list with such trivial questions. Ben Newlin From: Users on behalf of Prathibha B Date: Tuesday, April 2, 2024 at 2:37 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] unix timestamp in microseconds EXTERNAL EMAIL - Please use caution with links and attachments How to get the unix timestamp in microseconds? -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] external applications
You can also use the REST client. And there are many other ways, as well. There is no single correct answer to the vague question of connecting to any generic “external application”. You must understand your systems and decide the best approach depending on the needs and capabilities of both the external application and OpenSIPS. Ben Newlin From: Users on behalf of Bogdan-Andrei Iancu Date: Wednesday, March 20, 2024 at 10:06 AM To: OpenSIPS users mailling list , Prathibha B Subject: Re: [OpenSIPS-Users] external applications EXTERNAL EMAIL - Please use caution with links and attachments Use the dialog events: https://opensips.org/html/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED<https://opensips.org/html/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED> And you subscribe from outside OpenSIPS for such events: https://www.opensips.org/Documentation/Interface-Events-3-4<https://www.opensips.org/Documentation/Interface-Events-3-4> Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> https://www.siphub.com<https://www.siphub.com> On 20.03.2024 12:16, Prathibha B wrote: No. I want to pass START, CONNECT, END messages from OpenSIPS to external application. On Wed, 20 Mar 2024 at 15:42, Marcin Groszek mailto:mar...@voipplus.net>> wrote: Well, to execute external command from opensips you may want to use EXEC module. this is a manual for v3.2: https://opensips.org/html/docs/modules/3.2.x/exec.html<https://opensips.org/html/docs/modules/3.2.x/exec.html> On 3/20/2024 5:00 AM, Prathibha B wrote: How to integrate OpenSIPS with external applications? -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> -- Best Regards: Marcin Groszek Business Phone Service https://www.voipplus.net<https://www.voipplus.net> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Basic sum question
You have to use parentheses in order to use a transformation on a variable. $var(cs) = $(cs{s.int}) + 1; Ben Newlin From: Users on behalf of Social Boh Date: Monday, March 18, 2024 at 4:44 PM To: users@lists.opensips.org Subject: [OpenSIPS-Users] Basic sum question EXTERNAL EMAIL - Please use caution with links and attachments Hello list how can I add a 1 to a script variable like: $var(cs) = $cs{s.int} + 1; Result: ERROR:core:eval_elem: invalid string operands WARNING:core:do_assign: no value in right expression at /etc/opensips/opensips.cfg:205 Thank you Regards -- --- I'm SoCIaL, MayBe ___ 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] variable/avp value check
Alexey, Apologies, you are correct about the columns setting. I also did not understand your use case. Unfortunately the answer is that as far as I know this cannot be done, at least not directly using the DB model you have. The OpenSIPS cache interface is fundamentally designed to be a key/value store. You can query any data for a specific key, but you cannot query data for all keys. This is a limitation of converting the data from SQL to a key/value store. There are cachedb implementations that support wildcards in the key – e.g. redis – but sql_cacher only works with OpenSIPS local cache, which makes sense as it is intended to cache the data locally. If you were caching the data between 2 external systems you would not want/need OpenSIPS to do that for you. And afaik OpenSIPS local cache implementation does not support wildcards, so you can only look up a specific key. A workaround for this could be to create an SQL view in your database, and direct OpenSIPS sql_cacher module to query the view, rather than the table directly. You can use the view to reformat the data in any way you would like, so that the cache query can return the data you want given whatever key makes sense. We use views in this way in our system, though not to achieve this specific use case of getting all values. For example, you could create a view that formats the data into two columns: “original column name” and “all values” (or something like that). The original column name would be the key, and would be “base_id”. The second column would be a list or set of all the values of “base_id”. The sql_cacher query would use “base_id” as the key and would return all the base_id values. You could do this with any or all columns of the original table. The view would return only a single row for each column of the original table included. There are probably other ways to solve this as well, though I must admit it’s not clear to me the use case for having the list of values without knowing which key they were associated with in the original data. Ben Newlin From: Users on behalf of Alexey Date: Tuesday, February 13, 2024 at 1:55 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] variable/avp value check EXTERNAL EMAIL - Please use caution with links and attachments Hi Ben, thank you for your response but this is not the case. Documentation says: 'columns : If not present, all the columns from the table will be cached'. So in our case all columns from the DB are cached. Our main question - How does '$sql_cached_value(id{sep}col{sep}key)' work ? We want that this PV exports the full column 'base_id" from the cached DB. But now it seems that the PV can export only one row which is limited by the 'key' value. Could you kindly provide us an example of the string '$sql_cached_value(id{sep}col{sep}key)' which lets us extract the full column (array) from the cached DB ? -- best regards, Alexey https://alexeyka.zantsev.com ___ 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] variable/avp value check
Alexey, You have not provided the list of columns you want to the sql_cacher config. Please review https://opensips.org/docs/modules/3.2.x/sql_cacher.html#param_cache_table. You need to add something like: columns=column_1 column_2 column_3 Ben Newlin From: Users on behalf of Alexey Date: Monday, February 12, 2024 at 1:23 AM To: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] variable/avp value check EXTERNAL EMAIL - Please use caution with links and attachments Hi list, We implemented next config: # cachedb module loadmodule "cachedb_local.so" modparam("cachedb_local", "cachedb_url", "local:///my_cache") modparam("cachedb_local", "cache_collections", "my_cache") # sql_cacher module loadmodule "sql_cacher.so" modparam("sql_cacher", "cache_table", "id=my_cache db_url=mysql://opensips:opensipsrw@x.x.x.x/opensips cachedb_url=local:///my_cache table=test key=base_id on_demand=0 ") $avp(list) = $sql_cached_value(my_cache:base_id:key1); xlog(" local_cash id = $(avp(list)[*])\n"); avp_print(); The DB is something like that: +++---+---+ | id | base_id | comment| +++---+---+ | 1 | 111 | id_111| | 2 | 222 | id_222 | | 3 | 333 | id_333 | | 4 | ...| id_... | +++---+---+ It seems the $sql_cached_value can extract the only one row which is mentioned in the ‘key’ value from the cached DB. But our goal is to extract the whole column (array) from the DB and store that array to $avp. Is there any way to extract the whole column (base_id in my sample) from the cached DB ? Maybe you can provide right way to make request via $avp(a) = $sql_cached_value(caching_name:column_name_1:key1); ? We expect something similar to avp_db_query("select base_id from test","$avp(list)"); xlog("avp(list)=$(avp(list)[*])\n"); Thanks in advance ! -- best regards, Alexey https://alexeyka.zantsev.com ___ 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] variable/avp value check
The SQL Cacher module I mentioned does exactly this already. It seems you’ve just created a very simplified version of that module in your script. I’d recommend checking it out: https://opensips.org/docs/modules/3.2.x/sql_cacher.html Ben Newlin From: Users on behalf of Alexey Date: Friday, February 9, 2024 at 12:46 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] variable/avp value check EXTERNAL EMAIL - Please use caution with links and attachments Hi list, the problem was solved. Highlights: 1. Select data from DB using timer_route with timeout (for regular data updates) and store it in AVP. This AVP is seen in timer_route only. So, put all its values into the local_cache (with the same timeout), to be able to use it in the main route. timer_route[id_update, 300] { # get all IDs of customers who have some feature (our inner logic) # and store all them in a single AVP. avp_db_query("select customer_id from customers","$avp(goldencustomers)"); # put each AVP's index value into a separate local_cache attribute (record) with value "1". for ($var(blahblah) in $(avp(goldencustomers)[*])) cache_store ("local","goldencustomers_$var(blahblah)","1",300); } 2. Get needed parts of SIP-headers according to our inner logic... Don't forget to reset variables before applying the value! (See "Hints" section: https://www.opensips.org/Documentation/Script-CoreVar-3-2#varscript ) # main route route { ... # initial INVITES section ... $var(customerfullid) = NULL; $var(customerfullid) = $(fn{s.select,0, }); # get "Customer-1234 from full CallerID. index 0, separator is space. $var(customerid) = NULL; $var(customerid) = $(var(customerfullid){s.select,1,-}); # get 1234 from "Customer-1234 $var(ret) = NULL; cache_fetch("local", "goldencustomers_$var(blahblah)", $var(ret)); # check if there is a local_cache attribute value for INVITE with such ID in 'From:' header if ($var(ret) == "1") { xlog("L_INFO", "[$ci] attr value from cache_local is: $var(ret) . $var(customerfullid) has privileges. goto route customers_gold"); route(customers_gold); } else { xlog("L_INFO", "[$ci] attr value from cache_local is: $var(ret) . $var(customerfullid) has no privileges. goto route customers_all"); route(customers_all); } ... } #main route END 3. Additional routes. # do not apply global call-limits here route[customers_gold] { xlog("L_INFO", "[$ci] This is $route . This $var(customerfullid) has privileges. Global call-limits not applied."); ... } # apply global call-limits here route[customers_all] { xlog("L_INFO", "[$ci] This is $route . This $var(customerfullid) has no privileges. Global call-limits applied."); ... # call-limit logic } -- best regards, Alexey https://alexeyka.zantsev.com ___ 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] variable/avp value check
You should look at the SQL Cacher module: https://opensips.org/docs/modules/3.2.x/sql_cacher.html Ben Newlin From: Users on behalf of Alexey Date: Wednesday, February 7, 2024 at 11:13 AM To: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] variable/avp value check EXTERNAL EMAIL - Please use caution with links and attachments for each [1] statement seems to be what I need [1] https://www.opensips.org/Documentation/Script-Statements-3-2#toc4 -- best regards, Alexey https://alexeyka.zantsev.com ___ 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] $DLG_lifetime but in ms
A few people have mentioned this but I haven’t seen a response. Why do you have to do this conversion in the script? The call duration in ms is already included by default in every CDR. We are only talking about rounding here, why wouldn’t your rating application do that for you? That’s much less complex than adding an entirely new field just so OpenSIPS can do the rounding. Ben Newlin From: Users on behalf of tre...@webon.co.za Date: Tuesday, January 23, 2024 at 2:42 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] $DLG_lifetime but in ms EXTERNAL EMAIL - Please use caution with links and attachments On Tue, 2024-01-23 at 09:25 -0600, Marcin Groszek wrote: > > If you are not calculating the cost of the call in the script it self > you may create external script to go over your acc table and use > "ms_duration" to adjust "duration" > > or use $Ts$Tsm at the beginning of the call, save it to a dialog and > compare it with same value at the end of the call, then round up and > write to acc table and/or calculate cost of the call. > > > > > On 1/23/2024 9:01 AM, Marcin Groszek wrote: > > > > use math_ceil > > > > 1.4.5. math_ceil(number, result_var) > > > > Truncates a number, always towards +infinity. This means that > > ceil(3.2) = 4.0 and ceil(-2.9) = -2.0 > > > > > > 1.10.3. $DLG_lifetime > > > > Returns the duration (in seconds)... Hi Marcin, Using math_ceil on $DLG_lifetime wont work as it returns seconds not ms. As for your other suggestion I am doing something similar just not sure its the most efficient I am using get_accurate_time would $ts$Tsm be a better approach, at 200OK in onreply route if ($rs == 200) { get_accurate_time($var(now_s), $var(now_us)); $dlg_val(start_s) = $var(now_s); $dlg_val(start_us) = $var(now_us); } then on BYE if (is_method("BYE")) { get_accurate_time($var(end_s), $var(end_us)); ts_usec_delta($(dlg_val(start_s){s.int}), $(dlg_val(start_us){s.int}), $var(end_s), $var(end_us) , $var(billed_duration)); $var(end_us) , $acc_extra(billed_duration)\n"); math_eval("$var(billed_duration) / 100", $var(billed_duration)); math_ceil($var(billed_duration),$var(billed_duration)); $acc_extra(billed_duration) = $var(billed_duration); ## Rate the call math_eval("$acc_extra(c_price) / 60 * $acc_extra(billed_duration)", $var(c_cost)); math_eval("$acc_extra(v_price) / 60 * $acc_extra(billed_duration)", $var(v_cost)); $acc_extra(cost) = $var(c_cost); $acc_extra(v_cost) = $var(v_cost); } 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
Re: [OpenSIPS-Users] on SIP number presentation.
I agree with you. The From number should always be what is displayed to the called party. Ben Newlin From: Users on behalf of johan Date: Friday, December 1, 2023 at 10:20 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] on SIP number presentation. EXTERNAL EMAIL - Please use caution with links and attachments All, the opinions are divided on this at 2 very big customers. with number presentation allowed, what is displayed to the B user if the following 3 headers have different numbers in the invite. - pai - ppi - from. to me, the answer is that from takes precedence. what is the list's opinion. ___ 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] Strange ACK between OpenSIPS and Kamailio
The Contact fields in messages sent from different User Agents are not expected to be the same. The Contact header provides a URL which can be used to contact the UA about the dialog. If UAs were sending the same Contact as other UAs, they would be directing future requests to a different server. It is the Request URI of the ACK that should match the Contact from the 200 OK. The ACK is not required to have a Contact at all, as the UAC’s Contact was already provided in the INVITE. Ben Newlin From: Users on behalf of Social Boh Date: Thursday, November 9, 2023 at 9:16 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Strange ACK between OpenSIPS and Kamailio EXTERNAL EMAIL - Please use caution with links and attachments Hello list, I have a problem in communication between an OpenSIPs and a Kamailio. The call comes from OpenSIPs to Kamailio, it is answered but the ACK that OpenSIPs sends to Kamailio I think is not correct: 200OK from Kamailio to OpenSIPs: Contact: ACK from OpenSIPs to Kamailio: Contact: I think the ACK Contact Header from OpenSIPs to Kamailio should have the same 200 OK content 194.195.XXX.XXX is a Asterisk PBX 177.242.XXX.XXX is OpenSIPs Result Kamailio don't send ACK to Asterisk PBX and the call ends about 30 seconds. Any hint, please? -- --- I'm SoCIaL, MayBe ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch .
Sasmita, I can’t provide a working example as I don’t have a use case like this. However, this piece of script you’ve provided does not represent a correct flow. I think you may need to review how the different types of routes, and particularly branch routes, work. [1] I don’t have any experience with Registrar module, so take all of the following with a grain of salt. Someone with more experience with registrar can maybe keep me honest here. You should only need to call next_branches() one time, as it already loads all contacts returned by lookup() into parallel branches (assuming you are using the “b” flag for lookup()). This means they are all sent out at once, not serially. So you don’t need to send the next branch in failure_route because they’ve all already been sent. The branch route is executed as the last route before the message is being sent out. You certainly do not need to call next_branches() there either, in fact its behavior in a branch route is not defined in the docs. Also, I don’t know what your route “1” does, but you likely don’t need it from branch route either. As long as you don’t drop the branch, it will automatically be sent out. Lastly, you have the actual drop() command commented out, so this code won’t work as I described. Lastly, failure_route is armed for the whole request. In the case of parallel branching, it will only be called once for the request, not once for each branch, and only if all branches receive negative replies. One thing I’m not clear about is what happens if you end up dropping all the branches. I don’t know if failure_route would be called then, but it would be pretty easy to verify that. I think it would. Again, I can’t speak to your specific use case, but a representative version of the solution I recommended is below. *I have not tested or verified this code.* route { # all of your normal routing logic if (lookup(“”, “b”)) { if (next_branches()) { t_on_branch(“check_attrs”); t_on_failure(“no_branches”); } else { # handle case of no contacts t_reply(404, “Not Found”); } } else { # handle case of failed lookup t_reply(404, “Not Found”); } } branch_route[check_attrs] { $var(count) = $(hdr(Call-Info){csv.count}); while($(var(count) >= 0)) { if ($(avp(attr){s.index, $(hdr(Call-Info){csv.value,$var(i)})}) == NULL) { # as soon as one requirement doesn’t match, you know you don’t want to route drop(); } xlog("count: $var(count)\n"); $var(count) = $var(count) - 1; } } failure_route[no_branches] { # handle case where all branches failed t_reply(404, “Not Found”); } [1] https://www.opensips.org/Documentation/Script-Routes-3-2 Ben Newlin From: Users on behalf of Sasmita Panda Date: Thursday, November 2, 2023 at 9:36 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . Hi Ben , failure_route[1] { if ( t_check_status("404|477|480|481|408|486|50[234]")){ if (next_branches()) { t_on_branch("attr"); } } } branch_route[attr] { $var(count) = $(hdr(Call-Info){csv.count}); $var(i) = 0; $var(match-count) = 0; while($var(i) < $(var(count))){ if ($(avp(attr){s.index, $(hdr(Call-Info){csv.value,$var(i)})}) != NULL){ xlog("counter: $var(i)th index matched in attribute \n"); $var(match-count)= $var(match-count) + 1; } xlog("counter: $var(i)\n"); $var(i) = $var(i) + 1; } if ($var(i) == $var(match-count)){ ## Here I want to give call to that contact .. if that fails then again it should come to next branch and again compare t_on_failure("1"); route(1); } else{ # Here if the condition does not match . then i want to do the comparison again if (next_branches()){ t_on_branch("attr"); } # drop(); } } As for my expectation, it's not working . How does it work ? Where should I use T_branch_Idx ? Can I get some examples of this ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Need some information regarding accounting module .
Sasmita, A negative response to an in-dialog request does not automatically terminate the call. If the rejection of the re-INVITE is not acceptable to either party, they must still send a BYE if they desire to disconnect the call. After the 500 response, it is correct that there are no transactions as the re-INVITE transaction has been responded and closed. But the lack of active transactions does not mean the dialog/call is not still active. Based on your description the accounting seems correct. Any UAs involved that believed the call was disconnected based on the 500 response are not operating correctly. Ben Newlin From: Users on behalf of Sasmita Panda Date: Tuesday, October 31, 2023 at 4:21 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Need some information regarding accounting module . EXTERNAL EMAIL - Please use caution with links and attachments Hi All , I just got an wired call example on which the ACC information is not as for my expectation . I have Opensips 1.11 version . Example : Call started at : Oct 17 19:24:40:512 Re-Invite on this session : Oct 17 19:24:40:810 For the Re-Invite The client got " 500 Server Internal Error " which Opensips gave . After that there was no transaction in the session . The call got disconnected due to the error message . But The ACC info for that call : Oct 18 07:33:32 (After 12 hr ) Although Opensips created the 500 error message still the session did not get cleaned and Acc was printed after so long with a bigger talktime : duration=43729 . Which is totally beyond my expectation . I have attached the opensips config file as well . I am not sure . Do I need to call drop_accounting while in an error scenario ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Ratelimit usage
Have you read the description of the RED algorithm? Are you sure you are generating appropriate traffic to cause a drop? That algorithm seems like it would be difficult to control/predict the drops accurately for a test. If you are sending a constant traffic volume to it, it never will drop. If you are just testing, you may want to go with a simpler algorithm where you can more easily control when/how many are being dropped. The standard way to use the module for CPS is to use the SBT algorithm with a window_size of 1. [1] [1] https://opensips.org/docs/modules/3.2.x/ratelimit.html#param_window_size Ben Newlin From: Users on behalf of Adrien LACOMME Date: Friday, October 27, 2023 at 12:03 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Ratelimit usage EXTERNAL EMAIL - Please use caution with links and attachments Hello, I added this line to my code, in fact it's better to decrease the counter if I drop the call. But my problem is that the rl_check function never drop calls, I do not enter in the IF condition. For the algorithm, I'm actually just trying the module, I will probably not stay with RED. De : Users de la part de Wadii ELMAJDI | Evenmedia Envoyé : vendredi 27 octobre 2023 17:39 À : OpenSIPS users mailling list Objet : Re: [OpenSIPS-Users] Ratelimit usage Hello Adrien Try : if (!rl_check("test1", 1, "RED")) { rl_dec_count("test1") send_reply(487, "Request Terminated: CPS limit exceeded"); exit; } * If you are using ratelimit to limit only successful traffic, you need to explicitely decrease the counter for the declined calls using the rl_dec_count() function also I’m not sure RED is the best algorithm for your usecase. De : Users De la part de Adrien LACOMME Envoyé : vendredi 27 octobre 2023 17:06 À : users@lists.opensips.org Objet : [OpenSIPS-Users] Ratelimit usage Hi, I'm trying to implement CPS limitation on OpenSIPS and I got some difficulties to understand how ratelimit module works. Here is the setup (I want to limit cps to 1) : if (!rl_check("test1", 1, "RED")) { send_reply(487, "Request Terminated: CPS limit exceeded"); } I tried to make few calls simultaneously but rl_check return is always FALSE. Here is the log I got : 2023-10-27T16:52:19.792337 SBC /usr/sbin/opensips[137782]: DBG:ratelimit:w_rl_check: Pipe test1 counter:1 load:0 limit:1 should NOT be blocked (0x7fcae1504888) 2023-10-27T16:52:19.804064 SBC /usr/sbin/opensips[137781]: DBG:ratelimit:w_rl_check: Pipe test1 counter:2 load:0 limit:1 should NOT be blocked (0x7fcae1504888) 2023-10-27T16:52:22.872991 SBC /usr/sbin/opensips[137782]: DBG:ratelimit:w_rl_check: Pipe test1 counter:3 load:0 limit:1 should NOT be blocked (0x7fcae1504888) 2023-10-27T16:52:22.918123 SBC /usr/sbin/opensips[137781]: DBG:ratelimit:w_rl_check: Pipe test1 counter:4 load:0 limit:1 should NOT be blocked (0x7fcae1504888) Shouldn't the module block calls when the counter goes to 2 ? Or is he checking the load value to block ? If yes, why the load value isn't incremented ? Regards, Adrien LACOMME ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch .
Just wanted to add that with the solution I recommended below, you would want to make sure you properly handle the case where all branches were dropped because none matched. The proper handling in that case for your system would be defined by your requirements. Ben Newlin From: Users on behalf of Ben Newlin Date: Friday, October 27, 2023 at 9:33 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . Without seeing the specific exact code, I can’t say what is causing that error. It seems like it may be a syntax issue. For example, in your email you are missing the semicolon after the line setting the count. I don’t know if it is that way in your config script. I recommend double checking all your syntax, and if you still get the error please provide the exact code from your script for review. For #2, I can’t really be very specific there because I don’t know all of your logic, nor am I very knowledgeable about the registrar module. My first thought is to not do any filtering/checking in the request route. Just allow the registrar module to load all contacts in branches, but arm a branch_route. Then perform the check in the branch route for each branch. If the Contact for the branch doesn’t match what you want, you can drop the branch [1]. [1] https://www.opensips.org/Documentation/Script-Routes-3-2#toc2<https://www.opensips.org/Documentation/Script-Routes-3-2#toc2> Ben Newlin From: Users on behalf of Sasmita Panda Date: Friday, October 27, 2023 at 6:17 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . Ahhh , Ok . Now it's very complicated . When you said a loop that's looping in my mind . Sorry for the bad joke . In case , the number of elements in each Invite won't be fixed . So the number of loops will vary from one Invite to another . I was thinking of counting the number of elements first , then as the index starts from 0 I will loop till count-1 to fetch every element properly . Example : $var(count) = $(hdr(Call-Info){csv.count})## if the number is 3 then loop will be for 3 times starting from 0 to 2 $var(i) = 0; while($var(i) < $var(count) ) { xlog("counter: $var(i)\n"); $var(i) = $var(i) + 1; } This was my initial thought . But while finding the count it gave me an error . $var(count) = $(hdr(Call-Info){csv.count}) Is this not in the correct format ? parse error in /usr/local/etc/opensips/opensips-p2p.cfg:267:26-55: unknown script variable As I have earlier mentioned my header will look like . Call-Info: sales,en,level20,en (this can be anything but format will be like this . ) . How do I count the number of values ? 2. As I am doing this matching to filter out contacts, where should I do this ? If I am doing this while giving a call to the contacts , for the 1st transaction it is doing the comparison , after that for the next branch it processes the call without matching . Which is not right . For every contact this comparison should loop Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 On Thu, Oct 26, 2023 at 7:19 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: Sasmita, Apologies, I replied yesterday but the message is being held by the list as the quoted replies have made it too large. I’ve removed some of the quoted replies and I’m copying my response below: Yes, a substring match means the exact complete string exists somewhere in the string being searched . In your example, the $avp(attr) does not contain any substring that matches $hdr(Call-Info), so it is correctly failing. If you want to check for the presence of each element, you need to loop through the elements in $hdr(Call-Info) and check for each one in the $avp(attr) using the s.index mechanism. The best options for looping on the header are probably s.select [1] or the csv tranformations [2]. [1] https://www.opensips.org/Documentation/Script-Tran-3-2#toc7<https://www.opensips.org/Documentation/Script-Tran-3-2#toc7> [2] https://www.opensips.org/Documentation/Script-Tran-3-2#toc82<https://www.opensips.org/Documentation/Script-Tran-3-2#toc82> Ben Newlin ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch .
Without seeing the specific exact code, I can’t say what is causing that error. It seems like it may be a syntax issue. For example, in your email you are missing the semicolon after the line setting the count. I don’t know if it is that way in your config script. I recommend double checking all your syntax, and if you still get the error please provide the exact code from your script for review. For #2, I can’t really be very specific there because I don’t know all of your logic, nor am I very knowledgeable about the registrar module. My first thought is to not do any filtering/checking in the request route. Just allow the registrar module to load all contacts in branches, but arm a branch_route. Then perform the check in the branch route for each branch. If the Contact for the branch doesn’t match what you want, you can drop the branch [1]. [1] https://www.opensips.org/Documentation/Script-Routes-3-2#toc2 Ben Newlin From: Users on behalf of Sasmita Panda Date: Friday, October 27, 2023 at 6:17 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . EXTERNAL EMAIL - Please use caution with links and attachments Ahhh , Ok . Now it's very complicated . When you said a loop that's looping in my mind . Sorry for the bad joke . In case , the number of elements in each Invite won't be fixed . So the number of loops will vary from one Invite to another . I was thinking of counting the number of elements first , then as the index starts from 0 I will loop till count-1 to fetch every element properly . Example : $var(count) = $(hdr(Call-Info){csv.count})## if the number is 3 then loop will be for 3 times starting from 0 to 2 $var(i) = 0; while($var(i) < $var(count) ) { xlog("counter: $var(i)\n"); $var(i) = $var(i) + 1; } This was my initial thought . But while finding the count it gave me an error . $var(count) = $(hdr(Call-Info){csv.count}) Is this not in the correct format ? parse error in /usr/local/etc/opensips/opensips-p2p.cfg:267:26-55: unknown script variable As I have earlier mentioned my header will look like . Call-Info: sales,en,level20,en (this can be anything but format will be like this . ) . How do I count the number of values ? 2. As I am doing this matching to filter out contacts, where should I do this ? If I am doing this while giving a call to the contacts , for the 1st transaction it is doing the comparison , after that for the next branch it processes the call without matching . Which is not right . For every contact this comparison should loop Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 On Thu, Oct 26, 2023 at 7:19 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: Sasmita, Apologies, I replied yesterday but the message is being held by the list as the quoted replies have made it too large. I’ve removed some of the quoted replies and I’m copying my response below: Yes, a substring match means the exact complete string exists somewhere in the string being searched . In your example, the $avp(attr) does not contain any substring that matches $hdr(Call-Info), so it is correctly failing. If you want to check for the presence of each element, you need to loop through the elements in $hdr(Call-Info) and check for each one in the $avp(attr) using the s.index mechanism. The best options for looping on the header are probably s.select [1] or the csv tranformations [2]. [1] https://www.opensips.org/Documentation/Script-Tran-3-2#toc7<https://www.opensips.org/Documentation/Script-Tran-3-2#toc7> [2] https://www.opensips.org/Documentation/Script-Tran-3-2#toc82<https://www.opensips.org/Documentation/Script-Tran-3-2#toc82> Ben Newlin ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch .
Sasmita, Apologies, I replied yesterday but the message is being held by the list as the quoted replies have made it too large. I’ve removed some of the quoted replies and I’m copying my response below: Yes, a substring match means the exact complete string exists somewhere in the string being searched . In your example, the $avp(attr) does not contain any substring that matches $hdr(Call-Info), so it is correctly failing. If you want to check for the presence of each element, you need to loop through the elements in $hdr(Call-Info) and check for each one in the $avp(attr) using the s.index mechanism. The best options for looping on the header are probably s.select [1] or the csv tranformations [2]. [1] https://www.opensips.org/Documentation/Script-Tran-3-2#toc7 [2] https://www.opensips.org/Documentation/Script-Tran-3-2#toc82 Ben Newlin From: Users on behalf of Sasmita Panda Date: Thursday, October 26, 2023 at 8:46 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . EXTERNAL EMAIL - Please use caution with links and attachments Is there any update on this ? On Wed, 25 Oct 2023, 19:27 Sasmita Panda, mailto:spa...@3clogic.com>> wrote: Hi Ben , Please correct me if I am wrong . $avp(attr) : sales,level20,en,true $hdr(Call-Info) : sales,en if ($(avp(attr){s.index, $hdr(Call-Info)}) != NULL) { xlog("found $hdr(Call-Info) in $avp(attr) \n"); if (next_branches()){ t_on_failure("1"); } } else { sl_send_reply(500,"Unable to load contacts"); exit; } In this case , although $hdr(Call-Info) is a substring of $avp(attr) still it's going in the else block and giving me 500 Unable to load contacts . Does the substring must contain continuous values ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch .
Yes, based on your description of the problem that transformation should work. We use that transformation to test a comma-separated list for the existence of a value in the same way. Ben Newlin From: Users on behalf of Sasmita Panda Date: Monday, October 23, 2023 at 2:13 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . EXTERNAL EMAIL - Please use caution with links and attachments There are some changes in the requirements now . Although I appreciate your suggestion, I will go with script transformation . But not in a different way . In the register I will get set of comma separated values in Call-Info header and will save that in attr column . Agent1: call-info : en,galileo,level1,true Agent2 : call-info : en,spanish,lenovo,true Agent3: call-info : en,galileo,sales,level1,true 1st Invite : call-info : en,galileo,true (I have to match the contact in which this the substring of Registered contacts Attr . ex : Agent1 and Agent3 will the matching agents here ) 2nd Invite : call-info : en,true (All there agents are matching this critaria ) 3rd Invite : call-info : spanish,lenovo,true (Agent2 will match the criteria ) This is kind of substring matching . Here the challenge for me is , the number of values in the Invite header is not fixed , That can be 2 , that can be 4 that can be 7 . If every comma separated value is present in the Attr field then that contact will get call else not . #Test for existence of string in another if ($(var(strtosearch){s.index, $var(str)}) != NULL) xlog("found $var(sstr) in $var(strtosearch)\n"); So will this help me in this case ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 On Wed, Oct 18, 2023 at 7:10 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: Sasmita, Your examples all contain mixed use of semicolons and commas. Without any description or context, it’s very difficult to tell what or how you expect these to match. Having said that, I recommend making use of OpenSIPS transformations [1]. The parameters list transformations [2] specifically, as they operate on semicolon separated “key=value” pairs, just like you have. Depending on what operation you are expecting with respect to the commas, you may be able to combine that with the string select transformation [3] to get your desired outcome. [1] https://www.opensips.org/Documentation/Script-Tran-3-2<https://www.opensips.org/Documentation/Script-Tran-3-2> [2] https://www.opensips.org/Documentation/Script-Tran-3-2#toc60<https://www.opensips.org/Documentation/Script-Tran-3-2#toc60> [3] https://www.opensips.org/Documentation/Script-Tran-3-2#toc7<https://www.opensips.org/Documentation/Script-Tran-3-2#toc7> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Sasmita Panda mailto:spa...@3clogic.com>> Date: Wednesday, October 18, 2023 at 6:34 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . EXTERNAL EMAIL - Please use caution with links and attachments Hi All , Any help on this ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 On Tue, Oct 17, 2023 at 7:54 PM Sasmita Panda mailto:spa...@3clogic.com>> wrote: Hi All , My requirements seem complicated to me. I dont know whether I am right or wrong . I am using opensips 1.11 (I have opensips 3.2 as well ) scenario 1: 989898 - is registered from 3 different contact with different call-info header . and I saved the call-info header in attr column while saving data . 1 contact : call-info : x=hr,network;y=sales,z=marketing 2nd contact : call-info : x=hr;y=sales,z=marketing 3rd contact : call-info : x=hr,network;y=sales,z=marketing INVITE : call-info : x=hr;y=sales Now while forming a branch for this INVITE , how do I compare this call-info with attr to get all the contact and then do serial forking on this ? scenario 2: 989898 - is registered from 3 different contact with different call-info header . and I saved the call-info header in attr column while saving data . 1 contact : call-info : x=hr,network;y=sales,z=marketing 2nd contact : call-info : x=hr;y=sales,z=marketing 3rd contact : call-info : x=hr,network;y=sales,z=marketing INVITE : call-info : call-info : x=hr,network;y=sales,z=marketing In this I am getting only 1 contact where there is exact match . And I am able to gove call to that contact . I am stuck on the 1st scenario . I am thinking of exec module to use on this . But not getting any better examples of how I do this . Please anybody help me out . Any kind of help is appreciated . thank you in advance . Thanks & Rega
Re: [OpenSIPS-Users] RLC in 200 OK after BYE
Just to clarify, that is not a global reply route. It is a named reply route that just happens to be named “global”. This would still need to be armed by calling t_on_reply(“global”) during processing of the BYE request. A true global onreply_route does not have a name at all. It is defined like: onreply_route { # do some stuff here } This type of reply route will be called for every reply received in the system and does not require any special arming during request processing. Ben Newlin From: Users on behalf of Rodrigo R Passos Date: Wednesday, October 18, 2023 at 6:28 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] RLC in 200 OK after BYE EXTERNAL EMAIL - Please use caution with links and attachments Ben, Thank you. Now, we put RLC The code: onreply_route[global] { if (t_check_status("200")) { xlog("L_INFO","[$ci] - Reply Global - $fU - O: $si - D: $rr - RM: $rm - Code: $T_reply_code - RS: $rs\n"); if ($rm == "BYE") { if ($si == "xxx.xxx.xxx.xxx") { add_isup_part("Release complete"); } } } } SIP/2.0 200 OK CSeq: 342021 BYE P-RTP-Stat: PS=4611,OS=737760,PR=4618,OR=736108,PL=0 Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO Content-Length: 2 Content-Type: application/ISUP;base=itu-t92+;version=itu-t Content-Disposition:signal;handling=optional Em qua., 18 de out. de 2023 às 17:08, Ben Newlin mailto:ben.new...@genesys.com>> escreveu: Are you using the global onreply_route? All replies should end up there. If you are using a named reply route, you will need to “arm” the route during processing of the BYE using t_on_reply. https://www.opensips.org/Documentation/Script-Routes-3-2#toc4<https://www.opensips.org/Documentation/Script-Routes-3-2#toc4> https://opensips.org/docs/modules/3.2.x/tm.html#func_t_on_reply<https://opensips.org/docs/modules/3.2.x/tm.html#func_t_on_reply> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Rodrigo R Passos mailto:rodrigopas...@gmail.com>> Date: Wednesday, October 18, 2023 at 3:56 PM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] RLC in 200 OK after BYE EXTERNAL EMAIL - Please use caution with links and attachments Hi Karsten, We couldn't see 200 OK after BYE in onreply_route. BR, Rodrigo Em qua., 18 de out. de 2023 às 14:41, Karsten Wemheuer mailto:k...@gmx.de>> escreveu: Hi Rodrigo, Am Mittwoch, dem 18.10.2023 um 13:40 -0300 schrieb Rodrigo R Passos: > Hi, > > How can i capture 200 OK after BYE (REL) from Interconnection to send > RLC on reply message? > > I'm trying to get the message on loose_route, but without success. > Anyone could help me or share with us an example of a route script? I think, You should use on_reply_route to get response to the BYE request. Than check status and method with equal to "BYE". HTH, Karsten ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] RLC in 200 OK after BYE
Are you using the global onreply_route? All replies should end up there. If you are using a named reply route, you will need to “arm” the route during processing of the BYE using t_on_reply. https://www.opensips.org/Documentation/Script-Routes-3-2#toc4 https://opensips.org/docs/modules/3.2.x/tm.html#func_t_on_reply Ben Newlin From: Users on behalf of Rodrigo R Passos Date: Wednesday, October 18, 2023 at 3:56 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] RLC in 200 OK after BYE EXTERNAL EMAIL - Please use caution with links and attachments Hi Karsten, We couldn't see 200 OK after BYE in onreply_route. BR, Rodrigo Em qua., 18 de out. de 2023 às 14:41, Karsten Wemheuer mailto:k...@gmx.de>> escreveu: Hi Rodrigo, Am Mittwoch, dem 18.10.2023 um 13:40 -0300 schrieb Rodrigo R Passos: > Hi, > > How can i capture 200 OK after BYE (REL) from Interconnection to send > RLC on reply message? > > I'm trying to get the message on loose_route, but without success. > Anyone could help me or share with us an example of a route script? I think, You should use on_reply_route to get response to the BYE request. Than check status and method with equal to "BYE". HTH, Karsten ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] I need some help in attr matching while forming the Branch .
Sasmita, Your examples all contain mixed use of semicolons and commas. Without any description or context, it’s very difficult to tell what or how you expect these to match. Having said that, I recommend making use of OpenSIPS transformations [1]. The parameters list transformations [2] specifically, as they operate on semicolon separated “key=value” pairs, just like you have. Depending on what operation you are expecting with respect to the commas, you may be able to combine that with the string select transformation [3] to get your desired outcome. [1] https://www.opensips.org/Documentation/Script-Tran-3-2 [2] https://www.opensips.org/Documentation/Script-Tran-3-2#toc60 [3] https://www.opensips.org/Documentation/Script-Tran-3-2#toc7 Ben Newlin From: Users on behalf of Sasmita Panda Date: Wednesday, October 18, 2023 at 6:34 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . EXTERNAL EMAIL - Please use caution with links and attachments Hi All , Any help on this ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 On Tue, Oct 17, 2023 at 7:54 PM Sasmita Panda mailto:spa...@3clogic.com>> wrote: Hi All , My requirements seem complicated to me. I dont know whether I am right or wrong . I am using opensips 1.11 (I have opensips 3.2 as well ) scenario 1: 989898 - is registered from 3 different contact with different call-info header . and I saved the call-info header in attr column while saving data . 1 contact : call-info : x=hr,network;y=sales,z=marketing 2nd contact : call-info : x=hr;y=sales,z=marketing 3rd contact : call-info : x=hr,network;y=sales,z=marketing INVITE : call-info : x=hr;y=sales Now while forming a branch for this INVITE , how do I compare this call-info with attr to get all the contact and then do serial forking on this ? scenario 2: 989898 - is registered from 3 different contact with different call-info header . and I saved the call-info header in attr column while saving data . 1 contact : call-info : x=hr,network;y=sales,z=marketing 2nd contact : call-info : x=hr;y=sales,z=marketing 3rd contact : call-info : x=hr,network;y=sales,z=marketing INVITE : call-info : call-info : x=hr,network;y=sales,z=marketing In this I am getting only 1 contact where there is exact match . And I am able to gove call to that contact . I am stuck on the 1st scenario . I am thinking of exec module to use on this . But not getting any better examples of how I do this . Please anybody help me out . Any kind of help is appreciated . thank you in advance . Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] OpenSiips Docker/kubernates configuration
Any sort of templating framework will work for this. We use m4 and do the templating ourselves using Ansible, but as of 3.1 OpenSIPS supports doing the templating for you, with a number of templating engines [1]. [1] - https://www.opensips.org/Documentation/Templating-Config-Files-3-4 Ben Newlin From: Users on behalf of junkmail Date: Monday, October 16, 2023 at 5:46 PM To: users@lists.opensips.org Subject: [OpenSIPS-Users] OpenSiips Docker/kubernates configuration EXTERNAL EMAIL - Please use caution with links and attachments Hello. I was working on getting some of my openSips systems running in docker/kubernates. I think I am good except to the point of binding to IP addresses. I am trying to find a good way to have the pod either be passed the Public IP via an Environment variable or using a simple call to get the IP address from within the starting pod. This I can do, but I am not sure how I can get it to dynamically be usable for the Opensips Socket binding or advertised_address configuration variable.I see there is the -l option for the binding but it doesn't seem to allow you to provide the "as" line to specify the public IP address. I tried searching the documentation on how I might be able to use an Environment variable, but didn't find anything that seemed like it would work. Please let me know if there is something I over looked or another way to accomplish getting the advertised address configured. thank you. ___ 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] t_new_request and X-headers
Ah I hadn’t even thought of using the context in that way. That’s an excellent solution! Ben Newlin From: Users on behalf of Mickael Hubert Date: Tuesday, October 10, 2023 at 5:37 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] t_new_request and X-headers EXTERNAL EMAIL - Please use caution with links and attachments Hi, it's perfect, thanks a lot ! I use json to catch and send my data to t_new_request t_new_request("INFO","$tu","$fu","$tu", , "$json(data)"); local_route { if (is_method("INFO")) { $json(data) := $avp(uac_ctx); #xlog("$json(data)\n"); append_hf("X-call-id: $json(data/X-call-id)\r\n"); append_hf("X-rtp-a: $json(data/X-rtp-a)\r\n"); append_hf("X-rtp-b: $json(data/X-rtp-b)\r\n"); } } Le lun. 9 oct. 2023 à 17:13, Ben Newlin mailto:ben.new...@genesys.com>> a écrit : Do you have the Call-ID from the first leg when you create the second leg with t_new_request? If os, you can use the ctx parameter from that function to make it visible in the new transaction. https://opensips.org/docs/modules/3.4.x/tm.html#func_t_new_request<https://opensips.org/docs/modules/3.4.x/tm.html#func_t_new_request> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Mickael Hubert mailto:mick...@winlux.fr>> Date: Monday, October 9, 2023 at 11:00 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] t_new_request and X-headers EXTERNAL EMAIL - Please use caution with links and attachments Thanks for your help, I already tested avp, but the main issue now is, how can I catch call_id (or other id) from my second request (created by t_new_request) to get my variables from the first leg. Le lun. 9 oct. 2023 à 16:33, Johan De Clercq mailto:jo...@democon.be>> a écrit : avp_dbquery if I am not wrong. Op ma 9 okt 2023 om 16:31 schreef Johan De Clercq mailto:jo...@democon.be>>: write the info to a custom table and fetch it from there ? Op ma 9 okt 2023 om 16:03 schreef Mickael Hubert mailto:mick...@winlux.fr>>: Hi all, I need to send an INFO message with X-headers from other dialog. I use t_new_request to send my request (apart from first dialog): OK I use local_route to add fixed X-header: OK But I want to copy some information from the first dialog to the new dialog (created by t_new_request). How can I do that please ? Thanks in advance ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] t_new_request and X-headers
Do you have the Call-ID from the first leg when you create the second leg with t_new_request? If os, you can use the ctx parameter from that function to make it visible in the new transaction. https://opensips.org/docs/modules/3.4.x/tm.html#func_t_new_request Ben Newlin From: Users on behalf of Mickael Hubert Date: Monday, October 9, 2023 at 11:00 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] t_new_request and X-headers EXTERNAL EMAIL - Please use caution with links and attachments Thanks for your help, I already tested avp, but the main issue now is, how can I catch call_id (or other id) from my second request (created by t_new_request) to get my variables from the first leg. Le lun. 9 oct. 2023 à 16:33, Johan De Clercq mailto:jo...@democon.be>> a écrit : avp_dbquery if I am not wrong. Op ma 9 okt 2023 om 16:31 schreef Johan De Clercq mailto:jo...@democon.be>>: write the info to a custom table and fetch it from there ? Op ma 9 okt 2023 om 16:03 schreef Mickael Hubert mailto:mick...@winlux.fr>>: Hi all, I need to send an INFO message with X-headers from other dialog. I use t_new_request to send my request (apart from first dialog): OK I use local_route to add fixed X-header: OK But I want to copy some information from the first dialog to the new dialog (created by t_new_request). How can I do that please ? Thanks in advance ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] t_new_request and X-headers
Mickael, There are a few functions provided by the dialog module that allow you to get values from a dialog that isn’t already loaded, depending on where is the information you need. I recommend load_dialog_ctx as it is the easiest to use. https://opensips.org/docs/modules/3.2.x/dialog.html#func_get_dialog_info https://opensips.org/docs/modules/3.2.x/dialog.html#func_get_dialog_vals https://opensips.org/docs/modules/3.2.x/dialog.html#func_get_dialog_by_val https://opensips.org/docs/modules/3.2.x/dialog.html#func_get_dialog_by_profile https://opensips.org/docs/modules/3.2.x/dialog.html#func_load_dialog_ctx Ben Newlin From: Users on behalf of Mickael Hubert Date: Monday, October 9, 2023 at 10:00 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] t_new_request and X-headers EXTERNAL EMAIL - Please use caution with links and attachments Hi all, I need to send an INFO message with X-headers from other dialog. I use t_new_request to send my request (apart from first dialog): OK I use local_route to add fixed X-header: OK But I want to copy some information from the first dialog to the new dialog (created by t_new_request). How can I do that please ? Thanks in advance ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] on routing invite's in a trunk context.
Johan, I think you must have left some pieces out of your initial description then. You stated that node A is sending directly to your OpenSIPS node, so the source IP and Via would both point to node A. As I mentioned, changes to Contact and Record-Route headers will only affect the routing of sequential requests for the dialog. They will not impact the routing of responses. I don’t think that OpenSIPS provides any mechanism to change the destination of responses it proxies, since as you said this is outside of the RFC. Ben Newlin From: Users on behalf of Johan De Clercq Date: Saturday, October 7, 2023 at 1:40 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] on routing invite's in a trunk context. EXTERNAL EMAIL - Please use caution with links and attachments It’s a very non rfc scenario. Source ip and via are the ip of a loadbalancer that I need to skip …. ;-(. The contact does have the correct ip. Anyway, you gave me a good hint. I will add the contact ip as record route and see what that gives. Verzonden vanuit Outlook voor iOS<https://aka.ms/o0ukef> Van: Users namens Ben Newlin Verzonden: Friday, October 6, 2023 5:35:40 PM Aan: OpenSIPS users mailling list Onderwerp: Re: [OpenSIPS-Users] on routing invite's in a trunk context. Johan, This is actually a pretty standard SIP flow that we use all the time. I recommend this article [1] for an overview of how routing works in SIP. In short, the Contact and Record-Route headers are only used for routing of requests not responses, and mostly only sequential requests which are requests within a dialog. The topology_hiding_match and loose_route functions both operate on requests only, so they can both only be called from a request_route [1] [2]. The 200 OK is a response within the initial INVITE transaction. Responses within a SIP transaction are routed based on the source IP of request and/or the Via headers. OpenSIPS should just handle that for you, unless you have some strange routing. [1] https://kb.smartvox.co.uk/opensips/contact-and-record-route-headers-explained/<https://kb.smartvox.co.uk/opensips/contact-and-record-route-headers-explained/> [2] https://opensips.org/docs/modules/3.2.x/topology_hiding.html#func_topology_hiding_match<https://opensips.org/docs/modules/3.2.x/topology_hiding.html#func_topology_hiding_match> [3] https://opensips.org/docs/modules/3.2.x/rr.html#func_loose_route<https://opensips.org/docs/modules/3.2.x/rr.html#func_loose_route> Ben Newlin From: Users on behalf of johan Date: Friday, October 6, 2023 at 10:30 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] on routing invite's in a trunk context. EXTERNAL EMAIL - Please use caution with links and attachments This is a general question on routing (to be honest: it is a really strange case). A has a sip trunk to B (opensips), B has a sip trunk to C A sends an invite to B with contact header A' and record-route header to A'' B string the record_route header , calls topology hiding and droutes the call to C C sends 200 OK back but it needs to be routed on the content of the contact header. Now how does this route to A ? Is this the default topology_hiding_match() case ? Or do I need to do something special ? ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Need to understand the seral forking logic of opensips .
Sasmita, I think the relevant piece here is not the call to “serialize_branches”, but how the branches are being created to begin with. Are you using drouting, dispatcher, registrar, etc? It seems like what is happening is that whatever mechanism you are using to track the contacts is considering the 486 response to mean that URI should not be tried again and it is removed from routing. This behavior is likely configurable in that module. Ben Newlin From: Users on behalf of Sasmita Panda Date: Monday, October 9, 2023 at 8:47 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Need to understand the seral forking logic of opensips . EXTERNAL EMAIL - Please use caution with links and attachments Hi , I know this is a very basic question . Still I need some clarification . I have 2 contact for same number , When I place a call Openips give that to 1st if 1st contact reject the call with 486 busy , then opensips try the same call to the 2nd contact without rejecting the call . In the next call for same number , opensips tries to 2nd contact if that rejects the call with 486 it wont try to the 1st contact again . Why is this happening ? route{ if (!serialize_branches(1)){ sl_send_reply("500","Unable to load contacts"); exit; }else{ if (next_branches()){ t_on_failure("1"); } } } failure_route[1] { if ( t_check_status("404|477|480|481|408|486|50[234]")){ if (next_branches()) { t_on_failure("1"); route(1); } } } This is in my config file . i have gone through the doc https://www.opensips.org/Documentation/Script-CoreFunctions-1-11#toc44<https://www.opensips.org/Documentation/Script-CoreFunctions-1-11#toc44> but not able to understand properly . How can I print the internally stored branches on avp ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] on routing invite's in a trunk context.
Johan, This is actually a pretty standard SIP flow that we use all the time. I recommend this article [1] for an overview of how routing works in SIP. In short, the Contact and Record-Route headers are only used for routing of requests not responses, and mostly only sequential requests which are requests within a dialog. The topology_hiding_match and loose_route functions both operate on requests only, so they can both only be called from a request_route [1] [2]. The 200 OK is a response within the initial INVITE transaction. Responses within a SIP transaction are routed based on the source IP of request and/or the Via headers. OpenSIPS should just handle that for you, unless you have some strange routing. [1] https://kb.smartvox.co.uk/opensips/contact-and-record-route-headers-explained/ [2] https://opensips.org/docs/modules/3.2.x/topology_hiding.html#func_topology_hiding_match [3] https://opensips.org/docs/modules/3.2.x/rr.html#func_loose_route Ben Newlin From: Users on behalf of johan Date: Friday, October 6, 2023 at 10:30 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] on routing invite's in a trunk context. EXTERNAL EMAIL - Please use caution with links and attachments This is a general question on routing (to be honest: it is a really strange case). A has a sip trunk to B (opensips), B has a sip trunk to C A sends an invite to B with contact header A' and record-route header to A'' B string the record_route header , calls topology hiding and droutes the call to C C sends 200 OK back but it needs to be routed on the content of the contact header. Now how does this route to A ? Is this the default topology_hiding_match() case ? Or do I need to do something special ? ___ 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] ERROR:tls_mgm:load_tls_library: No TLS library module loaded
The error is quite clear in the logs you provided: ERROR:tls_mgm:load_tls_library: No TLS library module loaded You must load a TLS library in order to use the tls_mgm module. https://opensips.org/docs/modules/3.4.x/tls_mgm.html#idp5522064 https://opensips.org/docs/modules/3.4.x/tls_openssl.html https://opensips.org/docs/modules/3.4.x/tls_wolfssl.html Ben Newlin From: Users on behalf of Prathibha B Date: Friday, September 1, 2023 at 8:12 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] ERROR:tls_mgm:load_tls_library: No TLS library module loaded EXTERNAL EMAIL - Please use caution with links and attachments I've loaded tls_mgm module in /lib64/opensips/modules. Still getting this error. NOTICE:core:main: version: opensips 3.5.0-dev (x86_64/linux) Sep 01 10:45:49 ip-172-31-34-24 opensips[363797]: Sep 1 10:45:49 [363797] NOTICE:core:main: using 128 MB of shared memory, allocator: Q_MALLOC_DBG Sep 01 10:45:49 ip-172-31-34-24 opensips[363797]: Sep 1 10:45:49 [363797] NOTICE:core:main: using 4 MB of private process memory, allocator: Q_MALLOC_DBG Sep 01 10:45:49 ip-172-31-34-24 opensips[363797]: Sep 1 10:45:49 [363797] NOTICE:signaling:mod_init: initializing module ... Sep 01 10:45:49 ip-172-31-34-24 opensips[363797]: Sep 1 10:45:49 [363797] ERROR:tls_mgm:load_tls_library: No TLS library module loaded Sep 01 10:45:49 ip-172-31-34-24 opensips[363797]: Sep 1 10:45:49 [363797] ERROR:core:init_mod: failed to initialize module tls_mgm Sep 01 10:45:49 ip-172-31-34-24 opensips[363797]: Sep 1 10:45:49 [363797] ERROR:core:main: failed to initialize modules! Sep 01 10:45:49 ip-172-31-34-24 opensips[363797]: Sep 1 10:45:49 [363797] NOTICE:core:main: Exiting... -- Regards, B.Prathibha ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] PAID not in resent INVITE from Failure Block
Richard, Are you by chance adding the PAID/RPID headers in a branch route? Changes to a SIP message made in a branch route exist only in that branch, and will not be present in the failure route. Ben Newlin From: Users on behalf of Richard Robson Date: Friday, February 24, 2023 at 6:58 AM To: users@lists.opensips.org Subject: [OpenSIPS-Users] PAID not in resent INVITE from Failure Block EXTERNAL EMAIL - Please use caution with links and attachments I have an OpenSIPS 2.3 instance, where we are sending a call to the next hop and are receiving a 403 forbidden. This is expected and we need to update the from or to header and resend the call to the same destination whish will accept this. we do not make any other changed in the failure route, nor want to. This is working, however, the additional PAID and RPID headers, which were added by OpenSIPs before the INVITE was t_relayed are missing from the updated INVITE, ( the from header is modified.) The documentation implies that the headers should be there: Processing : the original SIP request (that was sent out) There is nothing in the failure route to cause the headers to be dropped. Therefore is this by design? i.e. additional headers are dropped and need to be re-applied, they are missing because the 403 did not contain them or is this a bug and the headers should be there? INVITE (with PAID & RPID headers) -> <- 403 forbidden (no PAID or RPID) INVITE (no PAID & RPID headers) -> (this just has the from header modified) Regards, Richard ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Carrier_ID not writing on DRouting when using partitions
Daniel, I haven’t used the drouting module with partitions, but it looks like when you do that the name of the AVP no longer comes from the modparam setting but from the dr_partitions table. Do you have the carrier_id_avp value set for this partition in that table? https://opensips.org/docs/modules/3.2.x/drouting.html#param_db_partitions_table https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-PARTITIONS Ben Newlin From: Users on behalf of Daniel Zanutti Date: Tuesday, February 21, 2023 at 9:47 PM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Carrier_ID not writing on DRouting when using partitions EXTERNAL EMAIL - Please use caution with links and attachments Hey I'm having a weird issue, possibly a BUG, using opensips 3.2.8. The carrier_id_avp is not being written, when I enabled partitions or drouting module. Everything else works, just this value is not written to the AVP setted. Routing works fine using carriers, just the AVP is not written. When I disable partitions, it works fine writting to carrier_id_avp. =| Configuration: modparam("drouting", "carrier_id_avp", "$avp(carrier_id)") Example of call My dr_rule has gwlist = #651 Carrier 651 carrierid=651 gwlist=651 (yes, same id) Applied routing with partition: do_routing(,"F",,,$avp(gw_attrs),,"partition1") Log: Feb 22 01:14:51 sbc4 /usr/local/sbin/opensips[856]: DBG:drouting:push_gw_for_usage: adding gw [651] as "sip:x...@yy.yy.yy.yy" in order 0 Feb 22 01:14:51 sbc4 /usr/local/sbin/opensips[856]: DBG:drouting:push_gw_for_usage: setting GW id [651] as avp Feb 22 01:14:51 sbc4 /usr/local/sbin/opensips[856]: DBG:drouting:push_gw_for_usage: setting GW attr [1] as avp The gateway 651 does exist, it's the same name of Carrier but it shouldn't be a problem. Checking logs, $avp(carrier_id) is null: Carrier:yy.yy.yy.yy() Do you guys have any clues on how to solve it? Maybe a bug? This works fine when not using partitions. Thanks ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Openisps 3.2 is crashing randomly .
Also, more information on troubleshooting and reporting crashes is available here: https://www.opensips.org/Documentation/TroubleShooting-Crash Ben Newlin From: Users on behalf of Pavel Eremin Date: Friday, February 10, 2023 at 7:35 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Openisps 3.2 is crashing randomly . EXTERNAL EMAIL - Please use caution with links and attachments Hi 1. Try to run with default config - it will give you a way to understand if crash depends on configuration If it will start successfully then just check config again params specific for new VM. пт, 10 февр. 2023 г. в 15:45, Sasmita Panda mailto:spa...@3clogic.com>>: Hi All , I have been using opensips 3.2 for the last 1 year . But it suddenly crashed when I created a new machine from an image and started opensips . opensips -V version: opensips 3.2.3 (x86_64/linux) flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535 poll method support: poll, epoll, sigio_rt, select. svn revision: 3831:3864 main.c compiled on 07:29:49 Jun 21 2022 with gcc 10 https://pastebin.com/4RQNCzGW<https://pastebin.com/4RQNCzGW> Can anyone help me with this please ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] dialog termination
I recommend using the E_DLG_STATE_CHANGED event. https://opensips.org/docs/modules/3.3.x/dialog.html#event_E_DLG_STATE_CHANGED Ben Newlin From: Users on behalf of M S Date: Monday, November 7, 2022 at 6:07 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] dialog termination EXTERNAL EMAIL - Please use caution with links and attachments Hi list, How do we get notified if an unacknowledged dialog is terminated? apparently dlg_on_hangup only works for state=4 dialog, when ACK is received. What if INVITE is sent, dialog created, then RINGING is received, then DECLINED is received? Thank you! ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Problem proxying a SIP connection with t_relay
Our servers also use double Record-Route headers and we have always used SIPp in our testing with no issues. There are no inherent faults in the most recent version of SIPp with Record-Route/Route handling as far as I know. As long as you are properly setting “rrs=true” on the received INVITE, and including the “” variable in your replies it all works perfectly. https://sipp.sourceforge.net/doc/reference.html#Actions Ben Newlin From: Users on behalf of Thomas Pircher via Users Date: Thursday, October 13, 2022 at 4:26 AM To: users@lists.opensips.org Cc: John Quick Subject: Re: [OpenSIPS-Users] Problem proxying a SIP connection with t_relay EXTERNAL EMAIL - Please use caution with links and attachments John Quick wrote: >The UAS at 10.30.9.11 has failed to process the two Record-Route headers >sent in the INVITE. It should send the Route Set back as part of the >Response - i.e. within the 200 OK. But it hasn't. It has just absorbed the >Record-Route headers and ignored them. I would say that is faulty UAS >behaviour, but maybe Bogdan could confirm. Hi John, thanks for the reply. Your explanation makes sense to me; I can see that in the packet capture file, in the replies from the UAS in packets 4 and 6. Also, your article explains why OpenSIPS adds two RR headers in this scenario. >Consequently, the ACK has no Route headers. That means OpenSIPS is treated >as the final destination - it doesn't know that it is meant to relay the ACK >to 10.30.9.11 Now I have the right keywords to search for some more information; it looks like there was an attempt to fix this in 2006: https://sourceforge.net/p/sipp/mailman/sipp-users/thread/200606071744.k57HiPJ4002550%40mail.zserv.tuwien.ac.at/#msg9012298 But then there is http://yuminstallgit.blogspot.com/2011/03/record-route-and-route-fun-in-sipp.html and the comment from 2021 at the end suggests others have seen the same issue relatively recently. >If you can't fix the UAS, you could try using the Topology hiding module in >OpenSIPS. That would probably overcome the problem because Topology hiding >doesn't send Record-Route headers downstream. That gives me a few options; I'll try replacing the SIPp UAS with FreeSWITCH. This may sound a bit over-engineered, as all I need is a machine that automatically answers calls to a bunch of usernames and plays an audio file. But it gives me a scenario that vaguely resembles a real-world setup, to test against. Thanks, Thomas ___ 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] dynamic routing failover ONLY ONCE on the provider and continue
Sorry, forgot the link for my reference. [1] - https://opensips.org/docs/modules/2.4.x/drouting.html#param_carrier_id_avp Ben Newlin From: Users on behalf of Ben Newlin Date: Tuesday, September 6, 2022 at 12:24 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue EXTERNAL EMAIL - Please use caution with links and attachments Ah, I see now in my response I did misunderstand the problem. There is no use_next_carrier function, however the AVP that contains the carrier list is accessible to you [1]. Our implementation has a similar requirement that we should skip to the next carrier rather than next gateway on certain response codes. What we do is after calling do_routing, we copy the carrier_id_avp contents into our own AVP and then we call route_to_carrier on each carrier in that list. So then use_next_gw will only failover on the gateways on a specific carrier. When there are no more gateways, or whenever we decide based on our needs, then we can skip to the next carrier by calling route_to_carrier with the next carrier in our list. A use_next_carrier function does seem like a very useful feature enhancement though. Ben Newlin From: Users on behalf of David Villasmil Date: Tuesday, September 6, 2022 at 12:09 PM To: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue EXTERNAL EMAIL - Please use caution with links and attachments Is there anything like “use_next_carrier”? I.e.: decide when I want to stop trying gws for the current carrier. On Tue, 6 Sep 2022 at 18:04, David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: I may not have been clear, I want to try the first _two_ (2) gws for each carrier. Is this possible? On Tue, 6 Sep 2022 at 17:14, David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Hey Bodgan, Sorry for the caps, was just trying to illustrate a very important point. That was a typo: it's provider. So what i mean is: - Provier1 - gw1 - gw2 - Provider2 - gw1 - gw2 and so on. The providers could have more than 2 gws, but i only want it to attempt the first 2. Is this possible? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu mailto:bog...@opensips.org>> wrote: David, Define the "provide" as carrier and set the "use only first gw from cr" flag for it, see https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS<https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS> PS: no need for caps ;) Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> OpenSIPS Summit 27-30 Sept 2022, Athens https://www.opensips.org/events/Summit-2022Athens/<https://www.opensips.org/events/Summit-2022Athens/> On 9/6/22 4:57 PM, David Villasmil wrote: Hello folks, I'm trying to route to the first provider and if the first gw attempted fails, try the next gw on that provider, and if that fails THEN failover to the next provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws. Is this possible on 2.4.7? I really appreciate your help! David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> -- Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 -- Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue
Ah, I see now in my response I did misunderstand the problem. There is no use_next_carrier function, however the AVP that contains the carrier list is accessible to you [1]. Our implementation has a similar requirement that we should skip to the next carrier rather than next gateway on certain response codes. What we do is after calling do_routing, we copy the carrier_id_avp contents into our own AVP and then we call route_to_carrier on each carrier in that list. So then use_next_gw will only failover on the gateways on a specific carrier. When there are no more gateways, or whenever we decide based on our needs, then we can skip to the next carrier by calling route_to_carrier with the next carrier in our list. A use_next_carrier function does seem like a very useful feature enhancement though. Ben Newlin From: Users on behalf of David Villasmil Date: Tuesday, September 6, 2022 at 12:09 PM To: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue EXTERNAL EMAIL - Please use caution with links and attachments Is there anything like “use_next_carrier”? I.e.: decide when I want to stop trying gws for the current carrier. On Tue, 6 Sep 2022 at 18:04, David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: I may not have been clear, I want to try the first _two_ (2) gws for each carrier. Is this possible? On Tue, 6 Sep 2022 at 17:14, David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Hey Bodgan, Sorry for the caps, was just trying to illustrate a very important point. That was a typo: it's provider. So what i mean is: - Provier1 - gw1 - gw2 - Provider2 - gw1 - gw2 and so on. The providers could have more than 2 gws, but i only want it to attempt the first 2. Is this possible? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu mailto:bog...@opensips.org>> wrote: David, Define the "provide" as carrier and set the "use only first gw from cr" flag for it, see https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS<https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS> PS: no need for caps ;) Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> OpenSIPS Summit 27-30 Sept 2022, Athens https://www.opensips.org/events/Summit-2022Athens/<https://www.opensips.org/events/Summit-2022Athens/> On 9/6/22 4:57 PM, David Villasmil wrote: Hello folks, I'm trying to route to the first provider and if the first gw attempted fails, try the next gw on that provider, and if that fails THEN failover to the next provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws. Is this possible on 2.4.7? I really appreciate your help! David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> -- Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 -- Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue
If I’m not mistaken, the functionality David is describing is the default behavior of the module and the use_next_gw function. All carriers are loaded on the call to do_routing, and use_next_gw will go through each gateway of each carrier in order, unless the flag Bogdan referenced below is set. Ben Newlin From: Users on behalf of Bogdan-Andrei Iancu Date: Tuesday, September 6, 2022 at 10:06 AM To: OpenSIPS users mailling list , David Villasmil Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue EXTERNAL EMAIL - Please use caution with links and attachments David, Define the "provide" as carrier and set the "use only first gw from cr" flag for it, see https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS<https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS> PS: no need for caps ;) Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> OpenSIPS Summit 27-30 Sept 2022, Athens https://www.opensips.org/events/Summit-2022Athens/<https://www.opensips.org/events/Summit-2022Athens/> On 9/6/22 4:57 PM, David Villasmil wrote: Hello folks, I'm trying to route to the first provider and if the first gw attempted fails, try the next gw on that provider, and if that fails THEN failover to the next provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws. Is this possible on 2.4.7? I really appreciate your help! David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Dispatcher within a K8s environment
The drouting module has a parameter that allows you to disable the DNS lookup. https://opensips.org/docs/modules/3.2.x/drouting.html#param_force_dns Ben Newlin From: Users on behalf of Jonathan Hunter Date: Thursday, August 25, 2022 at 4:54 AM To: Bogdan-Andrei Iancu , OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Dispatcher within a K8s environment EXTERNAL EMAIL - Please use caution with links and attachments Hi Bogdan, Yes it would appear K8s implementations would be a very good topic at the Summit that is for sure! I understand your comments on dispatcher, its unfortunate as everything else is working fine. There was a suggestion to add a loopback address for example and then update when DNS has updated and records resolve? Is there any benefit in using dr_routing instead or will this behaviour be the same in the event of a dns lookup failure? Thanks for the response! Jon Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows From: Bogdan-Andrei Iancu<mailto:bog...@opensips.org> Sent: 24 August 2022 12:29 To: OpenSIPS users mailling list<mailto:users@lists.opensips.org>; Jonathan Hunter<mailto:hunter...@hotmail.com> Subject: Re: [OpenSIPS-Users] Dispatcher within a K8s environment Hi Jonathan, I guess this will be a good topic (DS and K8S) for the OpenSIPS Summit in Athens - I think this is the 3rd time in the last week coming across it :) Unfortunately there is no way to skip at the moment that DNS failure when loading the destinations :(even more, there some code that relies on the fact that there is an "IP" attached to any destination.And I just checked, a local error in sending the ping (like the DNS err) does not results in marking the destination as failed or so. so it is not so straight as ignoring the DNS error. Best regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.opensips-solutions.com%2F=05%7C01%7C%7C84ee92014c7c4c0ea33e08da85c3dd19%7C84df9e7fe9f640afb435%7C1%7C0%7C637969373523562738%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=vMcA8Ti1ZgupioV7%2BV%2Fn6MxoklfjuxJ8BGcqWEWDHmE%3D=0> OpenSIPS Summit 27-30 Sept 2022, Athens https://www.opensips.org/events/Summit-2022Athens/<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.opensips.org%2Fevents%2FSummit-2022Athens%2F=05%7C01%7C%7C84ee92014c7c4c0ea33e08da85c3dd19%7C84df9e7fe9f640afb435%7C1%7C0%7C637969373523562738%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=9VF4udkoaGT%2FBFooWi8eyPaFOzq3c7yeYoxJDXgL5C4%3D=0> On 8/24/22 12:24 AM, Jonathan Hunter wrote: Hi All, I have a query around dispatcher behaviour, I am running 3.2 in a k8s environment. I have 2 freeswitch instances defined in a destination set, both of which are pods. As people may be aware its fun implementing in k8s as pods can restart and disappear at times so I ideally want this reflected in the cache and output of opensips-cli -x mi ds_list where I was hoping the freeswitch entries would be defined but with a state of probing or inactive. With my current setup, when restarting opensips for example, I have the dispatcher table populated in postgres db , and if opensips cant resolve the URI it wont load it into cache, like wise if opensips is running and freeswitch pod drops, I see this in the logs; Aug 23 21:22:01 [55] ERROR:dispatcher:add_dest2list: could not resolve freeswitch-opensips-deployment-1.freeswitch-opensips, skipping it Aug 23 21:22:01 [55] WARNING:dispatcher:ds_load_data: failed to add destination in group 10 I therefore don’t see it listed in cache when I run ds_list. Does anyone know if its possible to tweak dispatcher to always load the database entries into cache at startup, and also set their status to probing/inactive if not reachable due to a resolving issue as above? My dispatcher settings are; Dynamic routing loadmodule "dispatcher.so" modparam("dispatcher", "db_url", "postgres://x.x.x.x/opensips") modparam("dispatcher", "ds_probing_mode", 1) modparam("dispatcher", "ds_probing_threshhold", 1) modparam("dispatcher", "persistent_state", 0) modparam("dispatcher", "ds_ping_interval", 5) modparam("dispatcher", "table_name", "dispatcher") modparam("dispatcher", "cluster_id", 1) Hope that makes sense! Many thanks Jon ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<https:/
Re: [OpenSIPS-Users] $param?
It is used to access parameters that were passed to a custom route. $param(1) is the first passed parameter. https://www.opensips.org/Documentation/Script-CoreVar-3-3#toc60 Ben Newlin From: Users on behalf of David Villasmil Date: Thursday, August 4, 2022 at 1:54 PM To: users@lists.opensips.org Subject: [OpenSIPS-Users] $param? EXTERNAL EMAIL - Please use caution with links and attachments Hello folks, It's been a while since i've worked with OpenSIPS, and I'm seeing a script using $var(addPrefix) = $param(1); I don't really know what that $param does, can anyone help me out here? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Drop the call from onreply_route with cause code
Yes, there is that one, I hadn’t thought of that. But you will not be able to control the response code sent back upstream from there. You still need to do that in the failure_route. Ben Newlin Lead Voice Network Engineer Genesys Cloud Voice [X+8ADXwmpWwBJRU5ErkJggg==]<http://www.genesys.com/> [eJAO5L8CpOPwG+vPB9q3Mq3SAElFTkSuQmCC]<https://twitter.com/Genesys>[NZOfBSD5zhNaRvrLBVF2igBJRU5ErkJggg==]<http://www.linkedin.com/company/601919?trk=tyah>[xf4wOBtofx3lYAElFTkSuQmCC]<https://www.instagram.com/genesyscx>[L5hfZJ73LJyNk7ABJRU5ErkJggg==]<https://www.facebook.com/Genesys>[aX4aUWQBJRU5ErkJggg==]<https://www.youtube.com/Genesys>[wFxOBHaJBbmQQBJRU5ErkJggg==]<http://blog.genesys.com/> From: Users on behalf of Mehdi Shirazi Date: Saturday, June 18, 2022 at 1:44 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Drop the call from onreply_route with cause code EXTERNAL EMAIL - Please use caution with links and attachments Thanks Ben for your reply. It seems there is one way to cancel initiated call from reply_route: onreply_route[3] { ... if ($hdr(User-Agent)=~"Snom") { # drop calls involving snom UA t_cancel_branch(); } ... } Regards M.Shirazi ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Drop the call from onreply_route with cause code
Mehdi, That would be done in a failure_route, using the methods Alexey mentioned, or the corresponding stateful ones from the TM module. Since OpenSIPS is a proxy, you cannot drop a successful reply, only a failure one. It may be helpful to review the documentation on the types of routes in OpenSIPS and their purposes and capabilities: https://www.opensips.org/Documentation/Script-Routes-3-3 Ben Newlin From: Users on behalf of Mehdi Shirazi Date: Friday, June 17, 2022 at 1:50 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Drop the call from onreply_route with cause code EXTERNAL EMAIL - Please use caution with links and attachments Hi Alexey Thanks for the reply, so how can we read a reply message(even outside reply_route) and based on the information in it, decide to send a reply with special cause code and terminate the initiated call ? Regards M.Shirazi >Hi Mehdi, >onreply_route [1] is used not for generating replies by your OpenSIPS, >it it used for actions to be taken for SIP replies which are going towards >OpenSIPS >from other VoIP entities. >To drop a call with some code you may use these functions: >sl_send_reply();[2] >send_reply(); [3] >but according to the documentation neither of them can be used from >onreply_route. >>Hi >>How can we disconnect a call from on reply_route with a cause value ? ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] OpenSIPS : no 407 retransmission
I see. Apologies, I misunderstood the problem scenario. Ben Newlin From: Users on behalf of Yannick LE COENT Date: Saturday, April 30, 2022 at 5:46 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] OpenSIPS : no 407 retransmission EXTERNAL EMAIL - Please use caution with links and attachments Hello Ben, The 407 is sent upstream, but when it is lost, it is not retransmitted by OpenSIPS. I do not have this problem with other negative status codes (e.g. 486). This is clearly explained in https://opensips.org/pub/opensips/1.8.6/src/ChangeLog<https://opensips.org/pub/opensips/1.8.6/src/ChangeLog> 2012-03-21 18:36:58 Bogdan-Andrei Iancu, * [8811] : TM will no longer do retransmission for the 407/401 replies (if no ACK is received) for both local or proxied replies. According to RFC 3261, retransmitting 407s/401s is probably a bad idea: 26.3.2.4 DoS Protection At the moment, my only solution is to use forward() instead of t_relay() in order to use the stateless mode. Yannick Yannick, The default behavior of OpenSIPS is to relay any received responses back upstream. If it is not doing that it would have to be because you are stopping it in the script. Take a look at the documentation for failure_route [1] which explains this. Check your own failure_route in your script; you must be doing something there that is telling OpenSIPS not to relay the 401/407 back upstream. [1] https://www.opensips.org/Documentation/Script-Routes-2-4#toc3<https://www.opensips.org/Documentation/Script-Routes-2-4#toc3> Ben Newlin From: Users <mailto:users-boun...@lists.opensips.org> on behalf of Yannick LE COENT <mailto:yannick.leco...@nexcom.fr> Date: Friday, April 29, 2022 at 6:44 PM To: users@lists.opensips.org<mailto:users@lists.opensips.org> <mailto:users@lists.opensips.org> Subject: [OpenSIPS-Users] OpenSIPS : no 407 retransmission EXTERNAL EMAIL - Please use caution with links and attachments Hello, I'm using OpenSIPS as a proxy in front of another proxy. The 2nd proxy is in charge of authenticating the request. This is the callflow: Alice OpenSIPS Proxy#2 | INVITE || |--->| INVITE | | 100 Tring |--->| |<---|407 | ||<---| || ACK| ||--->| |407 || | X<-|| ||| Since OpenSIPS does not retransmit 401/407, the call setup gets stuck. What can I do ? If I set auto_100trying=1, that works, but this increases the number of INVITE retransmissions since 180Ringing are not received instantly. Do you have any suggestion ? Thanks, Yannick ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] OpenSIPS : no 407 retransmission
Yannick, The default behavior of OpenSIPS is to relay any received responses back upstream. If it is not doing that it would have to be because you are stopping it in the script. Take a look at the documentation for failure_route [1] which explains this. Check your own failure_route in your script; you must be doing something there that is telling OpenSIPS not to relay the 401/407 back upstream. [1] https://www.opensips.org/Documentation/Script-Routes-2-4#toc3 Ben Newlin From: Users on behalf of Yannick LE COENT Date: Friday, April 29, 2022 at 6:44 PM To: users@lists.opensips.org Subject: [OpenSIPS-Users] OpenSIPS : no 407 retransmission EXTERNAL EMAIL - Please use caution with links and attachments Hello, I'm using OpenSIPS as a proxy in front of another proxy. The 2nd proxy is in charge of authenticating the request. This is the callflow: Alice OpenSIPS Proxy#2 | INVITE || |--->| INVITE | | 100 Tring |--->| |<---|407 | ||<---| || ACK| ||--->| |407 || | X<-|| ||| Since OpenSIPS does not retransmit 401/407, the call setup gets stuck. What can I do ? If I set auto_100trying=1, that works, but this increases the number of INVITE retransmissions since 180Ringing are not received instantly. Do you have any suggestion ? Thanks, Yannick ___ 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] simple way to see if a call is established.
If you are using the dialog module the ACK status is reflected in the dialog status [1]. [1] - https://opensips.org/docs/modules/3.2.x/dialog.html#pv_DLG_status Ben Newlin From: Users on behalf of Karsten Wemheuer Date: Thursday, March 31, 2022 at 6:43 AM To: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] simple way to see if a call is established. EXTERNAL EMAIL - Please use caution with links and attachments Hi Johan, Am Donnerstag, dem 31.03.2022 um 10:23 +0200 schrieb johan: > Hello, > > is there a simple way to check in the script if a call has received > it's > ACK ? > > or where exactly does ACK enter the script ? > I don't know how to check this, but as AFAIK the ACK enters the main routing block as a request. HTH, Karsten ___ 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] CDR not generated on 302 redirect
CDRs are generated for calls based on the dialogs. A call receiving a 302 Redirect does not establish a dialog so there will be no CDR. OpenSIPS will generate an accounting record for any transaction if you want it to. Please review the documentation of the ACC module [1]. “failed - flag which indicates if the transaction should also be accounted in case of failure (status>=300);” [1] - https://opensips.org/docs/modules/3.2.x/acc.html#func_do_accounting Ben Newlin From: Users on behalf of Saint Michael Date: Tuesday, March 15, 2022 at 10:15 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] CDR not generated on 302 redirect EXTERNAL EMAIL - Please use caution with links and attachments My new business is to provide 302 Redirect services and Opensips does not genrate a CDR for those calls. Other type of calls do generate a record. Is this by design or is it a bug? Every call that goes through Opensips should generate a record. Any idea about what is going on? ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Users Digest, Vol 164, Issue 6
My guess is the lack of quoting is due to the SIP stack and not anything you are doing with your commands. The Name portion of a Name-Addr spec is only required to be quoted if certain special characters (most notably spaces) are present. Otherwise the quotes are not required. I’m guessing OpenSIPS’ SIP stack is just being efficient and only adding quotes when required. I’m not sure if that is configurable, but I’m not aware of any setting for it. My guess is that if you were to try this: $avp(ds)="a b c"; uac_replace_from($avp(ds),""); You would find that the resulting output name would have quotes as required. However, it should not matter as if quotes are not required then the receiving SIP agent should be fine with them not being present. May I ask why it is important to you that the quotes be present? Is it causing an issue with some non-compliant device? Ben Newlin From: Users on behalf of Kevin Wormington Date: Wednesday, March 9, 2022 at 1:26 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Users Digest, Vol 164, Issue 6 AVP is for sure supported on 3.1.x and up. We use the following: uac_replace_from($avp(caller_cnam),"”); > On Mar 8, 2022, at 8:12 AM, Alain Bieuzent wrote: > > Hmm , not sure $avp is supported can you try with $var > > $var(ds)="abc"; > uac_replace_from($var(ds),""); > > > De : Users au nom de Vinayak Makwana > > Répondre à : OpenSIPS users mailling list > Date : mardi 8 mars 2022 à 14:01 > À : > Objet : Re: [OpenSIPS-Users] Users Digest, Vol 164, Issue 6 > > Hello Alain Bieuzent > > I tried with the uac_replace_from() function also but not getting the proper > result. > > Here's my input & output result: > INPUT: From:"abc";tag=6a8eda3f > OUTPUT: From:abc;tag=6a8eda3f > > Here's my logic: > $avp(ds)="abc"; > uac_replace_from($avp(ds),""); > > So Can you please tell me what is an issue why not getting quotes > > Thanks in advance > Vinayak Makwana > > On Tue, Mar 8, 2022 at 5:30 PM wrote: >> Send Users mailing list submissions to >> users@lists.opensips.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >> or, via email, send a message with subject or body 'help' to >> users-requ...@lists.opensips.org >> >> You can reach the person managing the list at >> users-ow...@lists.opensips.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of Users digest..." >> >> >> Today's Topics: >> >>1. Header manipulation (Vinayak Makwana) >>2. Re: Header manipulation (Alain Bieuzent) >> >> >> -- >> >> Message: 1 >> Date: Tue, 8 Mar 2022 16:11:12 +0530 >> From: Vinayak Makwana >> To: users@lists.opensips.org >> Subject: [OpenSIPS-Users] Header manipulation >> Message-ID: >> >> Content-Type: text/plain; charset="utf-8" >> >> Hello All, >> >> I want to replace uri-display in the FROM header using the avp_subst >> function. So, can anyone suggest a solution ? >> >> Here's My scenario: >> Main:-> From:"abc";tag=6a8eda3f >> After Changes -> From:"pqrs"> ;transport=UDP>;tag=6a8eda3f >> >> Many Thanks >> Vinayak Makwana >> >> -- >> *Disclaimer* >> In addition to generic Disclaimer which you have agreed on our >> website, any views or opinions presented in this email are solely those of >> the originator and do not necessarily represent those of the Company or its >> sister concerns. Any liability (in negligence, contract or otherwise) >> arising from any third party taking any action, or refraining from taking >> any action on the basis of any of the information contained in this email >> is hereby excluded. >> >> >> >> *Confidentiality* >> This communication (including any >> attachment/s) is intended only for the use of the addressee(s) and contains >> information that is PRIVILEGED AND CONFIDENTIAL. Unauthorized reading, >> dissemination, distribution, or copying of this communication is >> prohibited. Please inform originator if you have received it in error. >> >> >> *Caution for viruses, malware etc.* >> This communication, including any >> attachments, may not be free of viruses, trojans, similar or new >> contaminan
Re: [OpenSIPS-Users] Facing some issue while running opensips 3.2 latest branch with openssl-1.1.1
Saurabh, You had originally mentioned you were using openssl 1.1.1, and my workaround was concerning that. I see now that you are trying to use openssl 3. I will defer to the OpenSIPS team on this, but as it is 2 major versions newer I would expect that openssl version would need explicit support from OpenSIPS, as many of the interfaces and APIs are likely very different from openssl 1, which is what OpenSIPS currently supports. I would not expect it to just work out of the box. Since OpenSIPS has started moving to a different crypto library, I’m not sure whether openssl 3 support is planned. Ben Newlin From: Users on behalf of Saurabh Chopra Date: Monday, January 17, 2022 at 8:58 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Facing some issue while running opensips 3.2 latest branch with openssl-1.1.1 Hi All, Workaround given by Ben has done some part. Opensips 3.2.3 is compiled with latest openssl version 3.0.1 but still I am not able to run my configuration file. Errors coming like below:- Jan 17 13:30:05 ip-192-168-0-56 opensips: ERROR:core:sr_load_module: could not open module : /usr/local/lib64/opensips/modules/tls_openssl.so: undefined symbol: OPENSSL_sk_num Jan 17 13:30:05 ip-192-168-0-56 opensips: ERROR:core:load_module: failed to load module Jan 17 13:30:05 ip-192-168-0-56 opensips: Traceback (last included file at the bottom): Jan 17 13:30:05 ip-192-168-0-56 opensips: 0. /usr/local/etc/opensips/opensips_webrtc_proxy.cfg Jan 17 13:30:05 ip-192-168-0-56 opensips: CRITICAL:core:yyerror: parse error in /usr/local/etc/opensips/opensips_webrtc_proxy.cfg:74:13-14: failed to load module tls_openssl.so Could you please help us resolve this? Best Regards Saurabh Chopra +918861979979 On Sat, Jan 15, 2022 at 9:27 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: Apologies, I misspoke. It is not due to any change in OpenSIPS. It is caused by the change to openssl-1.1.1. We actually encountered the issue using OpenSIPS 2.4, which still uses the shared libraries Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Ben Newlin mailto:ben.new...@genesys.com>> Date: Saturday, January 15, 2022 at 10:54 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>>, Răzvan Crainea mailto:raz...@opensips.org>>, li...@opensips.org<mailto:li...@opensips.org> mailto:li...@opensips.org>> Subject: Re: [OpenSIPS-Users] Facing some issue while running opensips 3.2 latest branch with openssl-1.1.1 We ran into this too. I assume it is due to the change from using openssl as a shared library to a statically linked one. We were able to resolve by setting the environment variable “LDFLAGS” to a value of “-pthread” before the make command. $ LDFLAGS=-pthread make … or $ export LDFLAGS=-pthread $ make … I’m not a C expert, but that could possibly be added to the standard OpenSIPS build configuration. Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of Saurabh Chopra mailto:saura...@3clogic.com>> Date: Saturday, January 15, 2022 at 2:48 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>>, Răzvan Crainea mailto:raz...@opensips.org>>, li...@opensips.org<mailto:li...@opensips.org> mailto:li...@opensips.org>> Subject: Re: [OpenSIPS-Users] Facing some issue while running opensips 3.2 latest branch with openssl-1.1.1 Hi Opensips Team/ Razvan, Thanks for the response, but when i tried to compile opensips version (3.2.3) with latest openssl version (3.0.1 14 Dec 2021) on Centos 7 machine, it throws me erros, Linking opensips main.o: In function `pthread_mutex_init': /opt/opensips-codechanged-3.2/ssl_tweaks.h:32: undefined reference to `pthread_mutexattr_setpshared' /opt/opensips-codechanged-3.2/ssl_tweaks.h:38: undefined reference to `pthread_mutexattr_destroy' /opt/opensips-codechanged-3.2/ssl_tweaks.h:26: undefined reference to `pthread_mutexattr_init' main.o: In function `pthread_rwlock_init': /opt/opensips-codechanged-3.2/ssl_tweaks.h:64: undefined reference to `pthread_rwlockattr_setpshared' /opt/opensips-codechanged-3.2/ssl_tweaks.h:70: undefined reference to `pthread_rwlockattr_destroy' /opt/opensips-codechanged-3.2/ssl_tweaks.h:58: undefined reference to `pthread_rwlockattr_init' collect2: error: ld returned 1 exit status make: *** [opensips] Error 1 Same errors found on the GITHUB ticket https://github.com/OpenSIPS/opensips/issues/2088<https://github.com/OpenSIPS/opensips/issues/2088> but the machine was Debian. And the package dependencies in the answer given by Liviu let us install openssl version 1.0.2, which we don't want to, because if we do, it will compile the opensips with 1.0.2 openssl version. Kindly help us in this matter, we are stuck here. Best Regards Saurabh Chopra +918861979979 On Mon, Jan 3, 2022 at 2:06 PM Răzvan Crainea mailto:raz...@opensips.org>&g
Re: [OpenSIPS-Users] Facing some issue while running opensips 3.2 latest branch with openssl-1.1.1
Apologies, I misspoke. It is not due to any change in OpenSIPS. It is caused by the change to openssl-1.1.1. We actually encountered the issue using OpenSIPS 2.4, which still uses the shared libraries Ben Newlin From: Users on behalf of Ben Newlin Date: Saturday, January 15, 2022 at 10:54 AM To: OpenSIPS users mailling list , Răzvan Crainea , li...@opensips.org Subject: Re: [OpenSIPS-Users] Facing some issue while running opensips 3.2 latest branch with openssl-1.1.1 We ran into this too. I assume it is due to the change from using openssl as a shared library to a statically linked one. We were able to resolve by setting the environment variable “LDFLAGS” to a value of “-pthread” before the make command. $ LDFLAGS=-pthread make … or $ export LDFLAGS=-pthread $ make … I’m not a C expert, but that could possibly be added to the standard OpenSIPS build configuration. Ben Newlin From: Users on behalf of Saurabh Chopra Date: Saturday, January 15, 2022 at 2:48 AM To: OpenSIPS users mailling list , Răzvan Crainea , li...@opensips.org Subject: Re: [OpenSIPS-Users] Facing some issue while running opensips 3.2 latest branch with openssl-1.1.1 Hi Opensips Team/ Razvan, Thanks for the response, but when i tried to compile opensips version (3.2.3) with latest openssl version (3.0.1 14 Dec 2021) on Centos 7 machine, it throws me erros, Linking opensips main.o: In function `pthread_mutex_init': /opt/opensips-codechanged-3.2/ssl_tweaks.h:32: undefined reference to `pthread_mutexattr_setpshared' /opt/opensips-codechanged-3.2/ssl_tweaks.h:38: undefined reference to `pthread_mutexattr_destroy' /opt/opensips-codechanged-3.2/ssl_tweaks.h:26: undefined reference to `pthread_mutexattr_init' main.o: In function `pthread_rwlock_init': /opt/opensips-codechanged-3.2/ssl_tweaks.h:64: undefined reference to `pthread_rwlockattr_setpshared' /opt/opensips-codechanged-3.2/ssl_tweaks.h:70: undefined reference to `pthread_rwlockattr_destroy' /opt/opensips-codechanged-3.2/ssl_tweaks.h:58: undefined reference to `pthread_rwlockattr_init' collect2: error: ld returned 1 exit status make: *** [opensips] Error 1 Same errors found on the GITHUB ticket https://github.com/OpenSIPS/opensips/issues/2088<https://github.com/OpenSIPS/opensips/issues/2088> but the machine was Debian. And the package dependencies in the answer given by Liviu let us install openssl version 1.0.2, which we don't want to, because if we do, it will compile the opensips with 1.0.2 openssl version. Kindly help us in this matter, we are stuck here. Best Regards Saurabh Chopra +918861979979 On Mon, Jan 3, 2022 at 2:06 PM Răzvan Crainea mailto:raz...@opensips.org>> wrote: Hi, Sasmita! You probably compiled opensips 3.2 with a previous openssl version, then replaced it with the new one. You need to re-compile tls_openssl with the new version to get this fixed. Best regards, Răzvan Crainea OpenSIPS Core Developer http://www.opensips-solutions.com<http://www.opensips-solutions.com> On 12/21/21 12:30, Sasmita Panda wrote: > Hi All , > > I have taken opensips 3.2 latest code and configure with tls_openssl to > support proto_tls proto_wss and tls_gm . > I have installed openssl-1.1.1 . (Rtpeninge latest branch is not > suported with older version of openssl , so I have taken the newer > version here ) > > > Installation is successful . While running the opensips process I am > getting the below error . > *ERROR:core:sr_load_module: could not open module > : > /usr/local/lib64/opensips/modules/auth.so: undefined symbol: EVP_MD_CTX_free > ERROR:core:load_module: failed to load module > Traceback (last included file at the bottom): > 0. /usr/local/etc/opensips/opensips_webrtc_reg.cfg > CRITICAL:core:yyerror: parse error in > /usr/local/etc/opensips/opensips_webrtc_reg.cfg:134:13-14: failed to > load module auth.so > * > > * ERROR:core:sr_load_module: could not open module > : > /usr/local/lib64/opensips/modules/tls_openssl.so: undefined symbol: > OPENSSL_sk_num > ERROR:core:load_module: failed to load module > Traceback (last included file at the bottom): > 0. /usr/local/etc/opensips/opensips_webrtc_proxy.cfg > CRITICAL:core:yyerror: parse error in > /usr/local/etc/opensips/opensips_webrtc_proxy.cfg:77:13-14: failed to > load module tls_openssl.so* > > Can anyone help me how to resolve this please ? > > */Thanks & Regards/* > /Sasmita Panda/ > /Senior Network Testing and Software Engineer/ > /3CLogic , ph:07827611765/ > > ___ > Users mailing list > Users@lists.opensips.org<mailto:Users@lists.opensips.org> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users
Re: [OpenSIPS-Users] Facing some issue while running opensips 3.2 latest branch with openssl-1.1.1
We ran into this too. I assume it is due to the change from using openssl as a shared library to a statically linked one. We were able to resolve by setting the environment variable “LDFLAGS” to a value of “-pthread” before the make command. $ LDFLAGS=-pthread make … or $ export LDFLAGS=-pthread $ make … I’m not a C expert, but that could possibly be added to the standard OpenSIPS build configuration. Ben Newlin From: Users on behalf of Saurabh Chopra Date: Saturday, January 15, 2022 at 2:48 AM To: OpenSIPS users mailling list , Răzvan Crainea , li...@opensips.org Subject: Re: [OpenSIPS-Users] Facing some issue while running opensips 3.2 latest branch with openssl-1.1.1 Hi Opensips Team/ Razvan, Thanks for the response, but when i tried to compile opensips version (3.2.3) with latest openssl version (3.0.1 14 Dec 2021) on Centos 7 machine, it throws me erros, Linking opensips main.o: In function `pthread_mutex_init': /opt/opensips-codechanged-3.2/ssl_tweaks.h:32: undefined reference to `pthread_mutexattr_setpshared' /opt/opensips-codechanged-3.2/ssl_tweaks.h:38: undefined reference to `pthread_mutexattr_destroy' /opt/opensips-codechanged-3.2/ssl_tweaks.h:26: undefined reference to `pthread_mutexattr_init' main.o: In function `pthread_rwlock_init': /opt/opensips-codechanged-3.2/ssl_tweaks.h:64: undefined reference to `pthread_rwlockattr_setpshared' /opt/opensips-codechanged-3.2/ssl_tweaks.h:70: undefined reference to `pthread_rwlockattr_destroy' /opt/opensips-codechanged-3.2/ssl_tweaks.h:58: undefined reference to `pthread_rwlockattr_init' collect2: error: ld returned 1 exit status make: *** [opensips] Error 1 Same errors found on the GITHUB ticket https://github.com/OpenSIPS/opensips/issues/2088<https://github.com/OpenSIPS/opensips/issues/2088> but the machine was Debian. And the package dependencies in the answer given by Liviu let us install openssl version 1.0.2, which we don't want to, because if we do, it will compile the opensips with 1.0.2 openssl version. Kindly help us in this matter, we are stuck here. Best Regards Saurabh Chopra +918861979979 On Mon, Jan 3, 2022 at 2:06 PM Răzvan Crainea mailto:raz...@opensips.org>> wrote: Hi, Sasmita! You probably compiled opensips 3.2 with a previous openssl version, then replaced it with the new one. You need to re-compile tls_openssl with the new version to get this fixed. Best regards, Răzvan Crainea OpenSIPS Core Developer http://www.opensips-solutions.com<http://www.opensips-solutions.com> On 12/21/21 12:30, Sasmita Panda wrote: > Hi All , > > I have taken opensips 3.2 latest code and configure with tls_openssl to > support proto_tls proto_wss and tls_gm . > I have installed openssl-1.1.1 . (Rtpeninge latest branch is not > suported with older version of openssl , so I have taken the newer > version here ) > > > Installation is successful . While running the opensips process I am > getting the below error . > *ERROR:core:sr_load_module: could not open module > : > /usr/local/lib64/opensips/modules/auth.so: undefined symbol: EVP_MD_CTX_free > ERROR:core:load_module: failed to load module > Traceback (last included file at the bottom): > 0. /usr/local/etc/opensips/opensips_webrtc_reg.cfg > CRITICAL:core:yyerror: parse error in > /usr/local/etc/opensips/opensips_webrtc_reg.cfg:134:13-14: failed to > load module auth.so > * > > * ERROR:core:sr_load_module: could not open module > : > /usr/local/lib64/opensips/modules/tls_openssl.so: undefined symbol: > OPENSSL_sk_num > ERROR:core:load_module: failed to load module > Traceback (last included file at the bottom): > 0. /usr/local/etc/opensips/opensips_webrtc_proxy.cfg > CRITICAL:core:yyerror: parse error in > /usr/local/etc/opensips/opensips_webrtc_proxy.cfg:77:13-14: failed to > load module tls_openssl.so* > > Can anyone help me how to resolve this please ? > > */Thanks & Regards/* > /Sasmita Panda/ > /Senior Network Testing and Software Engineer/ > /3CLogic , ph:07827611765/ > > ___ > Users mailing list > Users@lists.opensips.org<mailto:Users@lists.opensips.org> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] TCP-related errors
We are just migrating to OpenSIPS 3.2 and I also have seen these errors, though I saw them under significant load. I opened a Github issue for it here: https://github.com/OpenSIPS/opensips/issues/2724 Ben Newlin From: Users on behalf of Jeff Pyle Date: Tuesday, January 11, 2022 at 7:25 PM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] TCP-related errors Hello, I have two similarly configured systems running a recent OpenSIPS 3.2 with may errors like this: CRITICAL:core:io_watch_add: >>> fd_array idx 1 (fd=193) points to bogus map >>> (fd=-1,type=0,flags=2000,data=(nil)) It seems you have hit a programming bug. Please help us make OpenSIPS better by reporting it at https://github.com/OpenSIPS/opensips/issues<https://github.com/OpenSIPS/opensips/issues> and ERROR:tls_openssl:openssl_tls_async_connect: failed to retrieve SO_ERROR [server=52.114.76.76:5061<http://52.114.76.76:5061>] (3) No such process ERROR:proto_tls:tls_async_write: failed to do pre-tls handshake! ERROR:tls_openssl:openssl_tls_accept: SSL_ERROR_SYSCALL err=Success(0) ERROR:tls_openssl:openssl_tls_accept: New TLS connection from 52.114.32.169:6912<http://52.114.32.169:6912> failed to accept ERROR:proto_tls:tls_read_req: failed to do pre-tls handshake! ERROR:tls_openssl:openssl_tls_accept: SSL_ERROR_SYSCALL err=Success(0) ERROR:tls_openssl:openssl_tls_accept: New TLS connection from 52.114.132.46:3008<http://52.114.132.46:3008> failed to accept ERROR:proto_tls:tls_read_req: failed to do pre-tls handshake! ERROR:tls_openssl:openssl_tls_accept: SSL_ERROR_SYSCALL err=Success(0) ERROR:tls_openssl:openssl_tls_accept: New TLS connection from 52.114.32.169:3072<http://52.114.32.169:3072> failed to accept I'm wondering if this is truly a bug as the text suggests, or if I have a misconfiguration. I increased the number of file descriptors available to opensips in /etc/security/limits.conf on one of the systems about 10 minutes ago, and so far, no more errors. Normally I would have seen them by now. Both systems have low traffic, less than 1 cps. I don't have a lot of experience using OpenSIPS with TCP. It wouldn't surprise me if I've missed something. - Jeff ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Check IP Prefix
Ali, You can use the regex operator [1]. For example, If (src_ip =~ “^192*”) [1] https://www.opensips.org/Documentation/Script-Statements-3-2#toc1 Ben Newlin From: Users on behalf of Ali Alawi Date: Friday, December 10, 2021 at 2:00 PM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Check IP Prefix Hello everyone, Is there a way to conditionally check only the first byte of the IP? for example, can I have something like if(src_ip==192.x.x.x) Regards, Ali ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Parse P-Asserted-Identity
Mickael, The PAI header is not just a parameter list, so you can’t use that transformation directly. The PAI header follows the name-addr spec and the params are part of the URI. So it would be something like one of the following. $(ai{uri.param,privacy}) [1] $(ai{nameaddr.param, privacy}) [2] You may even have to combine the two if the parameters are associated with the uri in the name-addr: $(ai{nameaddr.uri}{uri.param,privacy}) You should try printing out things like $(ai{nameaddr.uri}) or $(ai{uri.params}) to see what you get and help narrow down where the parameters are located. I always get confused by uri params vs host params vs name-addr params. I will point out that the P-Asserted-Identity spec doesn’t actually define a privacy parameter like this. Privacy for PAI is indicated by the Privacy header, which is a separate header. For indicating privacy of the PAI header contents, the Privacy header should have a value of “id”. In fact, these parameters all seem to be ones typically used with the Remote-Party-ID (RPID) header, not the PAI header. [3] [4] [5] You can check the presence and value of the Privacy header with something like this: if (is_present_hf("Privacy") && ($hdr(Privacy) =~ "id|user")) { // do stuff } [1] https://www.opensips.org/Documentation/Script-Tran-3-2#toc38 [2] https://www.opensips.org/Documentation/Script-Tran-3-2#toc70 [3] https://datatracker.ietf.org/doc/html/rfc3325 [4] https://datatracker.ietf.org/doc/html/rfc3323 [5] https://datatracker.ietf.org/doc/html/draft-ietf-sip-privacy-04 Ben Newlin From: Users on behalf of Mickael MONSIEUR Date: Monday, November 29, 2021 at 9:32 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Parse P-Asserted-Identity No more result with: xlog("L_NOTICE","P-Asserted-Identity param = $(hdr(P-Asserted-Identity){param.value,privacy})\n"); Nov 29 14:17:13 [16103] P-Asserted-Identity param = Le lun. 29 nov. 2021 à 13:44, Mickael MONSIEUR a écrit : > > Hello, > > xlog("L_NOTICE","P-Asserted-Identity params = $(ai{param.value,privacy})\n"); > > Nov 29 13:43:34 [15988] P-Asserted-Identity params = > > Le lun. 29 nov. 2021 à 13:32, David Villasmil > a écrit : > > > > https://www.opensips.org/Documentation/Script-Tran-2-4#toc60 > > > > Regards, > > > > David Villasmil > > email: david.villasmil.w...@gmail.com > > phone: +34669448337 > > > > > > On Mon, Nov 29, 2021 at 12:22 PM Mickael MONSIEUR > > wrote: > >> > >> Hello, > >> > >> My provider add to my INVITE's : > >> > >> P-Asserted-Identity: "Anonymous" > >> ;party=calling;privacy=yes;screen=no > >> > >> Whether the call should be Anonymized to end-users. > >> > >> How to get the value of "privacy" ? > >> > >> I try: > >> > >> if( $(ai{privacy}) == "yes" ) > >> > >> But it does not work. (error when starting opensips) > >> > >> 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 ___ 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] Drouting /timerec documentation for 3.2 vs 3.1
No, I think that was the only place. Thank you! Ben Newlin From: Bogdan-Andrei Iancu Date: Friday, November 19, 2021 at 2:39 AM To: OpenSIPS users mailling list , Ben Newlin , pke...@gmail.com Subject: Re: [OpenSIPS-Users] Drouting /timerec documentation for 3.2 vs 3.1 Hi Ben, Fixes what I found on this matter, see [1]. Do you see any of these leftovers left in the current doc ? [1] https://github.com/OpenSIPS/opensips/commit/394ba080486f97f44afaf794fa82aba1f630b186<https://github.com/OpenSIPS/opensips/commit/394ba080486f97f44afaf794fa82aba1f630b186> Thanks and regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> OpenSIPS eBootcamp 2021 https://opensips.org/training/OpenSIPS_eBootcamp_2021/<https://opensips.org/training/OpenSIPS_eBootcamp_2021> On 11/18/21 4:04 PM, Ben Newlin wrote: While you are in the drouting module docs, there are multiple places in there where the changes from flags to sort_alg were not documented, especially for dr_carriers routing. Ben Newlin From: Users <mailto:users-boun...@lists.opensips.org> on behalf of Liviu Chircu <mailto:li...@opensips.org> Date: Thursday, November 18, 2021 at 5:14 AM To: pke...@gmail.com<mailto:pke...@gmail.com> <mailto:pke...@gmail.com> Cc: OpenSIPS users mailling list <mailto:users@lists.opensips.org> Subject: Re: [OpenSIPS-Users] Drouting /timerec documentation for 3.2 vs 3.1 On 18.11.2021 12:09, Pete Kelly wrote: > It looks like there are quite a few inconsistencies on the drouting > documentation page versus the docs here > https://opensips.org/docs/modules/3.2.x/cfgutils.html#func_check_time_rec<https://opensips.org/docs/modules/3.2.x/cfgutils.html#func_check_time_rec> > <https://opensips.org/docs/modules/3.2.x/cfgutils.html#func_check_time_rec<https://opensips.org/docs/modules/3.2.x/cfgutils.html#func_check_time_rec>> > - so maybe just a link or reference to check_time_rec would work for > consistency? Most likely, any timerec-related info on that page is outdated. Will double-check all the content when I get to this task. I like the idea to link to check_time_rec(), as it will future-proof the drouting docs against changes to the core, common function. -- Liviu Chircu www.twitter.com/liviuchircu<http://www.twitter.com/liviuchircu> | www.opensips-solutions.com<http://www.opensips-solutions.com> OpenSIPS eBootcamp 2021: www.opensips.org/training<http://www.opensips.org/training> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Drouting /timerec documentation for 3.2 vs 3.1
While you are in the drouting module docs, there are multiple places in there where the changes from flags to sort_alg were not documented, especially for dr_carriers routing. Ben Newlin From: Users on behalf of Liviu Chircu Date: Thursday, November 18, 2021 at 5:14 AM To: pke...@gmail.com Cc: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Drouting /timerec documentation for 3.2 vs 3.1 On 18.11.2021 12:09, Pete Kelly wrote: > It looks like there are quite a few inconsistencies on the drouting > documentation page versus the docs here > https://opensips.org/docs/modules/3.2.x/cfgutils.html#func_check_time_rec > <https://opensips.org/docs/modules/3.2.x/cfgutils.html#func_check_time_rec> > - so maybe just a link or reference to check_time_rec would work for > consistency? Most likely, any timerec-related info on that page is outdated. Will double-check all the content when I get to this task. I like the idea to link to check_time_rec(), as it will future-proof the drouting docs against changes to the core, common function. -- Liviu Chircu www.twitter.com/liviuchircu<http://www.twitter.com/liviuchircu> | www.opensips-solutions.com<http://www.opensips-solutions.com> OpenSIPS eBootcamp 2021: www.opensips.org/training<http://www.opensips.org/training> ___ 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] drouting gw list
Yes, the default behavior without any flags is to use the GWs in the order they are defined in the DB. So if they are in the DB as primaryGW,secondaryGW then the primaryGW will always be selected first, and secondaryGW will only be used if you perform failover in the script, with something like use_next_gw(). Ben Newlin From: Users on behalf of David Villasmil Date: Wednesday, November 10, 2021 at 11:14 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] drouting gw list Thanks again Ben, I'm still not understanding: Setting it to (as is, nothing) would then only send to the first gw, and only to the second on failure? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Wed, Nov 10, 2021 at 2:06 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: Yes, in 2.4 it is controlled by the flags. If you set it to 2 it will only ever use the first gateway and there will be no failover. If you want to allow for failover and use the gateways in the order they are defined you should not set any flags. https://opensips.org/docs/modules/2.4.x/drouting.html#idp163040<https://opensips.org/docs/modules/2.4.x/drouting.html#idp163040> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of David Villasmil mailto:david.villasmil.w...@gmail.com>> Date: Wednesday, November 10, 2021 at 7:50 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] drouting gw list Sorry, it's defined in cr_carriers, that's the list of gws which are then defined on dr_gateways. The "flags" field is "1", which i take to mean weight-based (this is opensips 2.4) So i would need to set the flags to "2"? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Wed, Nov 10, 2021 at 2:56 AM Ben Newlin mailto:ben.new...@genesys.com>> wrote: David, Is this gw_list defined on a dr_rule or a dr_carrier? What is the value of the sort_alg column for that dr_rule/dr_carrier? If the sort_alg is set to W, then the assigned values are interpreted as weights. So with this configuration it would send 100 out of 110 calls to PrimaryGW and 10 out of 110 calls to SecondaryGW. If you don’t want to use the SecondaryGW except for failover you should not use weighted routing, so you should set the sort_alg column to N. https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-RULES<https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-RULES> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of David Villasmil mailto:david.villasmil.w...@gmail.com>> Date: Tuesday, November 9, 2021 at 7:37 PM To: users@lists.opensips.org<mailto:users@lists.opensips.org> mailto:users@lists.opensips.org>> Subject: [OpenSIPS-Users] drouting gw list Hello folks, i have the following gw_list PrimaryGW=100,SecondaryGW=10 I'm seeing calls going to the SecondaryGW. How should i set this if i only want the SecondaryGW to be used for failover? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] drouting gw list
Yes, in 2.4 it is controlled by the flags. If you set it to 2 it will only ever use the first gateway and there will be no failover. If you want to allow for failover and use the gateways in the order they are defined you should not set any flags. https://opensips.org/docs/modules/2.4.x/drouting.html#idp163040 Ben Newlin From: Users on behalf of David Villasmil Date: Wednesday, November 10, 2021 at 7:50 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] drouting gw list Sorry, it's defined in cr_carriers, that's the list of gws which are then defined on dr_gateways. The "flags" field is "1", which i take to mean weight-based (this is opensips 2.4) So i would need to set the flags to "2"? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Wed, Nov 10, 2021 at 2:56 AM Ben Newlin mailto:ben.new...@genesys.com>> wrote: David, Is this gw_list defined on a dr_rule or a dr_carrier? What is the value of the sort_alg column for that dr_rule/dr_carrier? If the sort_alg is set to W, then the assigned values are interpreted as weights. So with this configuration it would send 100 out of 110 calls to PrimaryGW and 10 out of 110 calls to SecondaryGW. If you don’t want to use the SecondaryGW except for failover you should not use weighted routing, so you should set the sort_alg column to N. https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-RULES<https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-RULES> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of David Villasmil mailto:david.villasmil.w...@gmail.com>> Date: Tuesday, November 9, 2021 at 7:37 PM To: users@lists.opensips.org<mailto:users@lists.opensips.org> mailto:users@lists.opensips.org>> Subject: [OpenSIPS-Users] drouting gw list Hello folks, i have the following gw_list PrimaryGW=100,SecondaryGW=10 I'm seeing calls going to the SecondaryGW. How should i set this if i only want the SecondaryGW to be used for failover? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] drouting gw list
David, Is this gw_list defined on a dr_rule or a dr_carrier? What is the value of the sort_alg column for that dr_rule/dr_carrier? If the sort_alg is set to W, then the assigned values are interpreted as weights. So with this configuration it would send 100 out of 110 calls to PrimaryGW and 10 out of 110 calls to SecondaryGW. If you don’t want to use the SecondaryGW except for failover you should not use weighted routing, so you should set the sort_alg column to N. https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-RULES Ben Newlin From: Users on behalf of David Villasmil Date: Tuesday, November 9, 2021 at 7:37 PM To: users@lists.opensips.org Subject: [OpenSIPS-Users] drouting gw list Hello folks, i have the following gw_list PrimaryGW=100,SecondaryGW=10 I'm seeing calls going to the SecondaryGW. How should i set this if i only want the SecondaryGW to be used for failover? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] question on call handling.
Bogdan, Actually I was referring to these parts: If the initial offer is in an INVITE, the answer MUST be in a reliable non-failure message from UAS back to UAC which is correlated to that INVITE. For this specification, that is only the final 2xx response to that INVITE. That same exact answer MAY also be placed in any provisional responses sent prior to the answer. The UAC MUST treat the first session description it receives as the answer, and MUST ignore any session descriptions in subsequent responses to the initial INVITE. … Concretely, the above rules specify two exchanges for UAs compliant to this specification alone - the offer is in the INVITE, and the answer in the 2xx (and possibly in a 1xx as well, with the same value), or the offer is in the 2xx, and the answer is in the ACK. All user agents that support INVITE MUST support these two exchanges. Ben Newlin From: Bogdan-Andrei Iancu Date: Wednesday, October 6, 2021 at 2:37 AM To: OpenSIPS users mailling list , Ben Newlin Subject: Re: [OpenSIPS-Users] question on call handling. Hi Ben, The paragraph you refer to is this one : o After having sent or received an answer to the first offer, the UAC MAY generate subsequent offers in requests based on rules specified for that method, but only if it has received answers to any previous offers, and has not sent any offers to which it hasn't gotten an answer. So the 200 must contain the same SDP as the 180 because there is no SDP replied back between the 180 and 200 ? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com<https://www.opensips-solutions.com> OpenSIPS eBootcamp 2021 https://opensips.org/training/OpenSIPS_eBootcamp_2021/<https://opensips.org/training/OpenSIPS_eBootcamp_2021> On 10/1/21 5:41 PM, Ben Newlin wrote: No, this is not allowed by the specification, though some devices do handle it. https://datatracker.ietf.org/doc/html/rfc3261#section-13.2.1<https://datatracker.ietf.org/doc/html/rfc3261#section-13.2.1> Ben Newlin From: Users <mailto:users-boun...@lists.opensips.org> on behalf of johan <mailto:jo...@democon.be> Date: Friday, October 1, 2021 at 10:35 AM To: OpenSIPS users mailling list <mailto:users@lists.opensips.org> Subject: [OpenSIPS-Users] question on call handling. Dears, this is more a general sip question. when establishing a dialog is it then allowed to change the sdp that you have sent in 183 to somehting else in 200 Ok ? wkr, ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] DROUTING module flag changes
After digging into it further, I’d just like to point out that this is a significant breaking change that seems wholly unnecessary. The existing weight flag (0x01) could have just been deprecated by itself with no impact. There was no need to shift the other flags. On closed systems running both OpenSIPS and the DB locally, in which the whole system is upgraded at once, this breaking change is not really an issue. However, in this era of cloud computing that is rarely the case anymore. In any distributed system where the DB is running separately from OpenSIPS, a breaking change like this requires a lot more work. Since it is not possible for OpenSIPS and the DB to upgrade at the exact same moment (a major point of distributed systems is to remove exactly these types of dependencies), the only recourse is a long process wherein we will have to: * create a new table for the new format * maintain both tables with double write until they are in sync * upgrade opensips * deprecate the old table I understand that this is a fairly standard upgrade path for a lot of DB changes, and I also understand that breaking changes are sometimes necessary to facilitate new functionality. But in this particular case, it does not seem justified to incur this extra cost on developers in order to recover that one bit flag for future use. In my opinion, the best practice in this case would have been to deprecate the weight flag only, without modifying the meaning of the other flags and causing the breaking change. After sufficient time the 0x01 flag could have been used for something else if needed, and in the meantime there were many bits left unused that should have been sufficient for future development, especially considering the relative lack of change in this area. What’s done is done in this case, but something to think about for future breaking changes, especially relating to the DB. Ben Newlin From: Users on behalf of Ben Newlin Date: Friday, October 1, 2021 at 3:39 PM To: Liviu Chircu , OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] DROUTING module flag changes Liviu, Thank you, I do see it there. So it is confirmed the flags have shifted. It appears the module documentation is still in need of some updates to reflect this change for carriers. Ben Newlin From: Liviu Chircu Date: Friday, October 1, 2021 at 3:35 PM To: OpenSIPS users mailling list , Ben Newlin Subject: Re: [OpenSIPS-Users] DROUTING module flag changes On 01.10.2021 21:34, Ben Newlin wrote: Can anyone clarify the expected behavior here? Were the values for the flags column changed as part of removing the weight flag? Hey Ben, I believe you're referring to a change from 3.1, where the carrier "W" flag was removed & all other flags were shifted. This change in behavior is documented in the migration page [1]. [1]: https://opensips.org/Documentation/Migration-3-0-0-to-3-1-0#toc9<https://opensips.org/Documentation/Migration-3-0-0-to-3-1-0#toc9> -- Liviu Chircu www.twitter.com/liviuchircu<http://www.twitter.com/liviuchircu> | www.opensips-solutions.com<http://www.opensips-solutions.com> OpenSIPS eBootcamp 2021: www.opensips.org/training<http://www.opensips.org/training> ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] DROUTING module flag changes
Liviu, Thank you, I do see it there. So it is confirmed the flags have shifted. It appears the module documentation is still in need of some updates to reflect this change for carriers. Ben Newlin From: Liviu Chircu Date: Friday, October 1, 2021 at 3:35 PM To: OpenSIPS users mailling list , Ben Newlin Subject: Re: [OpenSIPS-Users] DROUTING module flag changes On 01.10.2021 21:34, Ben Newlin wrote: Can anyone clarify the expected behavior here? Were the values for the flags column changed as part of removing the weight flag? Hey Ben, I believe you're referring to a change from 3.1, where the carrier "W" flag was removed & all other flags were shifted. This change in behavior is documented in the migration page [1]. [1]: https://opensips.org/Documentation/Migration-3-0-0-to-3-1-0#toc9<https://opensips.org/Documentation/Migration-3-0-0-to-3-1-0#toc9> -- Liviu Chircu www.twitter.com/liviuchircu<http://www.twitter.com/liviuchircu> | www.opensips-solutions.com<http://www.opensips-solutions.com> OpenSIPS eBootcamp 2021: www.opensips.org/training<http://www.opensips.org/training> ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] DROUTING module flag changes
Hello, I need some clarification on the new “sort_alg” columns added to the DROUTING module tables in 3.x. The column was added to the DrRules table, and the documentation has been updated to reflect that the “W” flag passed to do_routing is now deprecated and has been replaced by the value in the table column. That is clear. However, the sort_alg column was also added to the DrCarriers table. Previously this was specified using the flags column in the table. The Database Schema [1] description for the flags column has been updated to include the flags (they were not listed here before), and the weight flag is not listed. However, the description states that the remaining flags are the first and second bits, where previously the weighting flag was the first bit. Have these bits really been shifted when the weighting flag was removed? It is not clear because the module documentation [2] has not been updated for the DrCarrier change. It still lists all flags, including the weight flag as the first bit, and does not mention the new sort_alg column at all. Can anyone clarify the expected behavior here? Were the values for the flags column changed as part of removing the weight flag? [1] https://www.opensips.org/Documentation/Install-DBSchema-3-2#AEN5138 [2] https://opensips.org/docs/modules/3.2.x/drouting.html#idp170896 Ben Newlin ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] question on call handling.
No, this is not allowed by the specification, though some devices do handle it. https://datatracker.ietf.org/doc/html/rfc3261#section-13.2.1 Ben Newlin From: Users on behalf of johan Date: Friday, October 1, 2021 at 10:35 AM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] question on call handling. Dears, this is more a general sip question. when establishing a dialog is it then allowed to change the sdp that you have sent in 183 to somehting else in 200 Ok ? wkr, ___ 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] opensips_port_change
https://www.opensips.org/Documentation/Script-CoreParameters-3-2#toc67 Ben Newlin From: Users on behalf of murat bal Date: Thursday, July 29, 2021 at 11:53 AM To: users@lists.opensips.org Subject: [OpenSIPS-Users] opensips_port_change hello, can the port of opensips server 5060 be changed? I tried with opensips.cfg, it didn't work. Can you help me? Thanks. Murat ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Double record-route trouble
Alex, Without seeing the INVITE I can’t be sure, but it seems like your problem is in your setting of the Contact header on the outbound INVITE to 3CX. The value of the Contact header is what dictates the RURI of sequential requests. The BYE from 3CX is being sent to your OpenSIPS public interface, not to the Softphone IP. Because the RURI address matches the top Route header, OpenSIPS assumes that loose routing is not supported, which is per the RFC I believe, and that is why you see this behavior. Replacing the URI with the contents of the route header is the old RFC 2543 routing mechanism. If you are going to act as a proxy and use Record-Routing, you need to leave the Contact header URI pointing to the original UAC (the phone), not OpenSIPS. If you are going to change the Contact header to point to OpenSIPS, then Record-Routing is not necessary. You should instead be using either Topology Hiding or B2BUA to handle that. Ben Newlin From: Users on behalf of Alex Crow Date: Friday, July 23, 2021 at 11:02 AM To: users@lists.opensips.org Subject: [OpenSIPS-Users] Double record-route trouble Hi all, I am setting up a proxy to route calls between a cloud 3CX instance and MS Teams Direct Routing. At the moment I'm just trying to get the OpenSIPS to 3CX connection working, testing with a softphone pointed at the proxy and attempting to make calls to extensions on the 3CX. Opensips is behind NAT with two sockets configured, one TCP with an "as" setting for the public address of the NAT, one UDP which is where the softphone connects. Outbound calls from the softphone as UAC to 3CX extensions as UAS ring, show established when answered, and I get audio at least one way (I think the one way audio may be a firewall issue). There are no registrations being used by any endpoint. Opensips adds a double record-route header as expected for both the receiving and sending interface. The problem I am having is that a BYE from one of the extensions on the 3CX (being a callee/UAS) arrives at OpenSIPs on the public-facing socket, with a double route header, in the order of public, private, with lr and r2=on set, but loose_route() does not behave according to the RFCs. I believe it should remote both route headers and then send the BYE to the destination in the RURI, spiralling back into the proxy via the sip address in the last Route: header and then being routed to the softphone/UAC. Instead, it seems to replace the RURI with the sip address of the last Route header, and sends the message via TCP to the internal socket (which I therefore had to add TCP to - if I dont have both UDP and TCP on the internal socket, we get a failed TCP connection here), thus causing a loop and an eventual Too Many Hops. My openSIPS config is here: https://pastebin.com/4t006vfn<https://pastebin.com/4t006vfn> A packet capture of the BYE and subsequent problem, the public facing private ip is 10.20.12.124 (TCP socket), advertised as 195.196.197.198, and the internal private IP (facing the softphone) is 10.20.12.125 with a TCP and a UDP socket. 3CX is 62.63.64.65. Softphone (UAC) uses UDP, 3CX uses TCP. SIP Domain of the proxy and softphone is 195.196.197.198, the softphone's SIP username is 1838, I'm calling extension 5760 on the 3CX. BYE from 3XC (from UAS) Session Initiation Protocol (BYE) Request-Line: BYE sip:1838@195.196.197.198:5060;transport=tcp SIP/2.0 Message Header Via: SIP/2.0/TCP 62.63.64.65:5060;branch=z9hG4bK-524287-1---77636e709985902e;rport Max-Forwards: 70 Route: Route: Contact: To: "Alex" ;tag=lihnv From: ;tag=f6ce187d Call-ID: mpytwgabkcpnkef@ryzing [Generated Call-ID: mpytwgabkcpnkef@ryzing] CSeq: 2 BYE User-Agent: 3CXPhoneSystem 16.0.8.9 (9) Content-Length: 0 BYE after loose_route(): Session Initiation Protocol (BYE) Request-Line: BYE sip:10.20.12.125;r2=on;lr;ftag=lihnv;nat=yes SIP/2.0 Message Header Via: SIP/2.0/TCP 195.196.197.198:5060;branch=z9hG4bKcd21.3682afa6.0;i=a10f2936 Via: SIP/2.0/TCP 62.63.64.65:5060;received=62.63.64.65;branch=z9hG4bK-524287-1---77636e709985902e;rport=44953 Max-Forwards: 69 Contact: To: "Alex" ;tag=lihnv From: ;tag=f6ce187d Call-ID: mpytwgabkcpnkef@ryzing [Generated Call-ID: mpytwgabkcpnkef@ryzing] CSeq: 2 BYE User-Agent: 3CXPhoneSystem 16.0.8.9 (9) Content-Length: 0 Then this just loops around as expected due to the RURI in the above message: Session Initiation Protocol (BYE) Request-Line: BYE sip:10.20.12.125;r2=on;lr;ftag=lihnv;nat=yes SIP/2.0 Message Header Via: SIP/2.0/UDP 10.20.12.125:5060;branch=z9hG4bKcd21.4682afa6.0;i=c10f2936 Via: SIP/2.0/TCP 195.196.197.198:5060;rport=47455;received=10.20.12.124;branch=z9hG4bKcd21.3682afa6.0;i=a10f2936 Via: SIP/2.0/TCP 6
Re: [OpenSIPS-Users] fr_timeout CANCEL message sent to timed out dispatcher endpoint IP
I’m pretty sure the RFCs state that a CANCEL should only be sent if some response, usually 100 Trying, has been received. This is to avoid the possibility of the INVITE and CANCEL being received out of order at the destination. Ben Newlin From: Users on behalf of John Quick Date: Wednesday, June 30, 2021 at 11:19 AM To: users@lists.opensips.org Cc: solar...@one-n.co.uk Subject: Re: [OpenSIPS-Users] fr_timeout CANCEL message sent to timed out dispatcher endpoint IP That sounds like reasonable behaviour to me, at least for UDP. OpenSIPS sent an INVITE but got no response within the preset time, so it decides to cancel that branch and try a new one. The INVITE may have reached its destination - perhaps it was the response that failed to get back to us. So it would be correct to send the CANCEL to the same address as the INVITE - after all, what is there to lose? It might be going into a black hole just like the INVITE, but that will do no harm. On the other hand it might be helpful to the target equipment to know that you are no longer interested in processing the request. I think this would be correct behaviour according to the RFC's too. John Quick Smartvox Limited ___ 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] Remove previously added header
David, There is a difference between sequential branches and parallel branches. Just because you only have one branch at a time, does not mean that you aren’t creating multiple branches, as you’ve seen from your working script. This solution is almost the best way to do it, except that removing the header in the second branch route is not necessary. Message changes made in branch route only exist in that branch, see the note here [1]. So after the 302 reply the header will already be gone from the next branch. [1] - https://opensips.org/docs/modules/3.2.x/sipmsgops.html#func_append_hf Ben Newlin From: Users on behalf of David Villasmil Date: Monday, June 14, 2021 at 7:43 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Remove previously added header Ok i stumbled on to your email from back 2009 asking just about the same thing (https://users.opensips.narkive.com/W78SWsO9/opensips-users-remove-hf-doesn-t-always-work<https://users.opensips.narkive.com/W78SWsO9/opensips-users-remove-hf-doesn-t-always-work>) I ended up doing t_on_branch("1") # Add the header before sending it out the parameter server branch_route[1] { append_hf("X-MyHeader: 1\r\n"); } then when actually sending it out to the termination provider: t_on_branch("2"); # Remove the header before seding it out to the termination branch_route[2] { remove_hf("X-MyHeader"); } That's working perfectly! Is this right or is there a more efficient/easier way to do it? Thanks! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 15, 2021 at 12:10 AM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Thanks Jeff, That's not going to work for me, I don't want to add new branches. What I'm doing is forwarding the call to a sip server that replies with a 302 and some extra headers. I then need to get these headers and continue routing normally, one single branch. Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Mon, Jun 14, 2021 at 11:12 PM Jeff Pyle mailto:j...@ugnd.org>> wrote: Add it in a branch_route. That way if you have to route advance, it'll already be gone because you'll be on a new branch. - Jeff On Mon, Jun 14, 2021 at 5:52 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Hello guys, So, I'm appending a header (append_hf("header")) to a forward. That forward fails and I'm trying to remove it with remove_hf("header"), but it's not getting removed for some reason, what am I doing wrong? Thanks everyone! David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Set flag at runtime?
Per the documentation [1], the CLI command wants the value as an integer, not quoted. Have you tried # opensipsctl fifo set_gflag 1 [1] - https://opensips.org/docs/modules/2.4.x/gflags.html#exported_mi_functions Ben Newlin From: Users on behalf of David Villasmil Date: Wednesday, June 9, 2021 at 6:34 PM To: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] Set flag at runtime? So I'm trying to use gflags.so in 2.4.7 I set the module as: loadmodule "gflags.so" modparam("gflags", "initial", 0) then i'm doing: if (is_gflag("1")) { xlog("L_ERR", "[$ci][$rm]: gflag(1) is set\n"); } else { xlog("L_ERR", "[$ci][$rm]: gflag(1) is not set\n"); } Then, via CLI I'm setting the flag like so: # opensipsctl fifo is_gflag "1" FALSE And is set it with: # opensipsctl fifo set_gflag "1" and check it is actually set: # opensipsctl fifo is_gflag "1" TRUE But no matter what i do, the script always sees the flag as not set. Did I misunderstand the purpose of the module? I want to be able to set the flag dynamically from the CLI to enable/disable a feature at runtime... is this not possible? thanks guys. Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Wed, Jun 9, 2021 at 8:55 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: gflags! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Wed, Jun 9, 2021 at 5:05 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Hello guys, On 2.4 is it possible to set a flag at runtime? I want to set a feature toggle based on that. Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
Yes, if a reply route is armed or the global reply route exists, they are triggered first for any reply. Failure route, if armed, is triggered after that for any >=300 response codes. Ben Newlin From: Users on behalf of David Villasmil Date: Thursday, June 3, 2021 at 8:10 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Getting header from 302 Oh I didn’t register that param. I’ll try with that. On the other hand, I may be confused about how opensips processes >299 replies. Does it process them on onreply route and then goes to the failure route? I mean that’s what I’m doing right now, but is this intended by design? I would’ve though it’d go straight to the failure route, but actually going to the onreply route sounds smart. On Wed, 2 Jun 2021 at 22:08, Jeff Pyle mailto:j...@ugnd.org>> wrote: I've been working on a proxy to sit between MS Teams and "normal" SIP stacks. Teams sends way too many 180s and RTP-less 183s so I sanitize them like this: onreply_route[relay_reply] { if (t_check_status("180")) { if (isflagset("GOT_180")) { drop; } else { setflag("GOT_180"); } } if (isflagset("GOT_180") && t_check_status("183")) { drop; } } With this I stop superfluous 18x messages from being relayed downstream. The 'drop' here kills the message completely. You could include the drop if you want to stop the message from being relayed (which you probably do) and are finished processing it in the script (which you are probably not). If I understand your application correctly, I'd populate the AVP in the reply route and do everything else in the failure route. Or, try Liviu's suggestion of using $(hdr(Identity)) in the failure_route directly. Either way, then continue in the failure_route to do whatever else needs to happen. - Jeff On Wed, Jun 2, 2021 at 2:10 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Hello Jeff, That's exactly what I'm doing: # Relay to REDIRECT server route[relay_to_REDIRECT] { t_on_reply("reply_from_REDIRECT"); t_on_failure("failure_from_REDIRECT"); xlog("L_ERR", "[$ci][$rm]: Relaying to REDIRECT"); if (!t_relay()) { xlog("L_ERR", "[$ci][$rm]: unable to relay request $ru to $tU -- replying with error"); sl_reply_error(); } exit; } # Response from REDIRECT will come in here. failure_route[failure_from_REDIRECT] { xlog("L_ERR", "[$ci][$rm]: I'm in failure_route[failover_from_REDIRECT]"); if (t_was_cancelled()) { exit; } if(is_avp_set("$avp(myheader)")) { xlog("L_ERR", "[$ci][$rm]: Got Identity Header: $(hdr(myheader))"); setflag(100); route(invite); } } # Response 302 from REDIRECT will come in here. onreply_route[reply_from_REDIRECT] { xlog("L_ERR", "[$ci][$rm]: I'm in onreply_route[reply_from_REDIRECT]"); if (t_was_cancelled()) { exit; } # detect redirect, store the header and send to "invite" as normally if (t_check_status("302") && is_present_hf("myheader")) { $avp(identity_header) = $(hdr(myheader)); setflag(100); drop(); } } So I suppose i don't need the drop()? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
You still don’t need to call drop() as long as you are handling the request in failure_route. The 302 will not be sent back upstream as long as failure_route either creates a new branch request or sends back a different reply code. Only if failure_route exits without doing either of these things would the downstream 302 be sent back upstream as-is. In fact, as far as I know drop() has no functionality for responses >= 200. Ben Newlin From: Users on behalf of Jeff Pyle Date: Tuesday, June 1, 2021 at 2:48 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Getting header from 302 Oh! Understood. - Jeff On Tue, Jun 1, 2021 at 2:42 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: The thing is I _want_ to drop the 302, I don't want to do anything else with it. Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 6:46 PM Jeff Pyle mailto:j...@ugnd.org>> wrote: In my experience you don't need drop() in the reply route. Just store the AVP and move on. Something like this: onreply_route[collect_identity] { if (is_present_hf("Identity")) { $avp(identity) := $hdr(Identity); setflag("GOT_IDENTITY"); } } If you've armed both the reply and failure routes with t_on_reply() and t_on_failure(), the $avp(identity) variable set here will be available in the failure_route. The GOT_IDENTITY flag, too. - Jeff - Jeff On Tue, Jun 1, 2021 at 11:20 AM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Yes, I see it is documented. So the reply header is only availanble on the "onreply" route, not on the "failure" route. That was my problem. I do indeed use an avp to store the header. I ended up getting the header on the "onreply" and storing it in an avp, set a flag and then drop(). I noticed the "failure" route is then executed. >From there I can send the processing to the invite route and by checking the >flag, adding the header from the avp. Thanks for your help! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 3:52 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: It’s documented that it works this way. The message being processed in failure_route is the original request; in reply_route it’s the reply. [1] You can use variable context to access the reply from failure_route [2]. Another option would be to extract the header value into and AVP in reply_route and then reference the AVP from failure_route. [1] - https://www.opensips.org/Documentation/Script-Routes-3-2<https://www.opensips.org/Documentation/Script-Routes-3-2> [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2<https://www.opensips.org/Documentation/Script-CoreVar-3-2> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of David Villasmil mailto:david.villasmil.w...@gmail.com>> Date: Tuesday, June 1, 2021 at 10:43 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] Getting header from 302 Yeah, my thing is when i use the failure route i can in theory grab the response header and ignore the 302 and send to the invite route again to actually send the call out via do_routing. What I'm trying to do is: - On receiving an invite: forward to an endpoint. - This endpoint will simply reply with 302 including a header. - I want to grab that header and continue routing normally (do_routing) I could do that with the failure route, but not so sure about the onreply route. Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle mailto:j...@ugnd.org>> wrote: I don't think you're doing anything wrong. I think I found the same thing, that headers on the reply were available only in a reply route and not in a failure route. If you know where to look for them to populate the AVP, I suppose it doesn't matter much. I haven't looked at the code but I suspect all the routes other than an onreply_route give you access to the requests headers, and onreply_route gives you access to the reply headers. Makes sense I guess. - Jeff On Tue, Jun 1, 2021 at 9:31 AM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Thanks Jeff, MMM, that's strange, I was using it on failure route and the route was being executed, but the data wasn't there. I put it on the onreply route and that one is now executed with the data correctly there... I probably did something wrong. Thanks again Jeff! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337
Re: [OpenSIPS-Users] Getting header from 302
It’s documented that it works this way. The message being processed in failure_route is the original request; in reply_route it’s the reply. [1] You can use variable context to access the reply from failure_route [2]. Another option would be to extract the header value into and AVP in reply_route and then reference the AVP from failure_route. [1] - https://www.opensips.org/Documentation/Script-Routes-3-2 [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2 Ben Newlin From: Users on behalf of David Villasmil Date: Tuesday, June 1, 2021 at 10:43 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Getting header from 302 Yeah, my thing is when i use the failure route i can in theory grab the response header and ignore the 302 and send to the invite route again to actually send the call out via do_routing. What I'm trying to do is: - On receiving an invite: forward to an endpoint. - This endpoint will simply reply with 302 including a header. - I want to grab that header and continue routing normally (do_routing) I could do that with the failure route, but not so sure about the onreply route. Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle mailto:j...@ugnd.org>> wrote: I don't think you're doing anything wrong. I think I found the same thing, that headers on the reply were available only in a reply route and not in a failure route. If you know where to look for them to populate the AVP, I suppose it doesn't matter much. I haven't looked at the code but I suspect all the routes other than an onreply_route give you access to the requests headers, and onreply_route gives you access to the reply headers. Makes sense I guess. - Jeff On Tue, Jun 1, 2021 at 9:31 AM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Thanks Jeff, MMM, that's strange, I was using it on failure route and the route was being executed, but the data wasn't there. I put it on the onreply route and that one is now executed with the data correctly there... I probably did something wrong. Thanks again Jeff! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 12:37 PM Jeff Pyle mailto:j...@ugnd.org>> wrote: In which route are you trying to use if (is_present_hf("Identity"))? Since the 302 is both a reply and a "failure", I suggest seeing if it appears in either the armed onreply_route or failure_route. I think From is available because it was present in the original request route. - Jeff On Tue, Jun 1, 2021 at 5:39 AM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Anyone has any idea about this? Appreciate your help. On Mon, 31 May 2021 at 21:11, David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: So weird, I can get the From header, but not "Identity"... Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Mon, May 31, 2021 at 8:22 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: This is really weird, if (is_present_hf("Identity")) says it is not present, but it is! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Mon, May 31, 2021 at 7:47 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Hello Guys, I'm getting a header on a 302 which i'm trying to get, but for some reason I can't. This is an example 302: 2021/05/31 18:42:36.499157 10.231.32.237:5060<http://10.231.32.237:5060> -> 10.231.57.11:6075<http://10.231.57.11:6075> SIP/2.0 302 Redirect Via: SIP/2.0/UDP 1.2.3.4<http://1.2.3.4>:6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 Via: SIP/2.0/UDP 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 v:SIP/2.0/UDP 10.231.49.211:6060;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa f:"+1888333"mailto:sip%3A%2B1888333@10.231.49.211>>;tag=ZBQ713X9pgD5S t:mailto:sip%3a1999...@domain.com>>;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c i:cf649a38-3ce2-123a-eaad-122eaa5d9655 CSeq:36689486 INVITE Identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=<https://somedomain.com/stir-shaken/ec256-public.pem<https://somedomain.com/stir-shaken/ec256-publi
Re: [OpenSIPS-Users] routing function variable scope
Kingsley, I think the issue here is the nested variable name references. I think within route csv_filter, you are actually setting a variable called “$var(N11_resultvar_name)”, not a variable with the name of the contents of that variable. I believe you can easily confirm this with two things: * Remove (or ignore) the parameter providing the variable name and hardcode it to “N9_hdrval” in csv_filter for a test. You should see the variable is now set when printed after. and/or * Add another log after csv_filter that prints the contents of $var($var(N11_resultvar_name)). I think you will find it also contains the correct value. Ben Newlin From: Users on behalf of Kingsley Tart Date: Friday, May 7, 2021 at 1:08 PM To: Liviu Chircu , OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] routing function variable scope On Wed, 2021-04-28 at 15:27 +0300, Liviu Chircu wrote: > On 28.04.2021 15:19, Kingsley Tart wrote: > > Is there a better way, apart from trying to make sure that > > variables in > > each function don't share names with variables in other functions? > > No, you have to manage those iterator names and make sure the logic > still holds during nested calls. Hi, I have now ran into the opposite problem! Given that values seem to be globally shared, I am now trying to use a sub-function to set the value of a $var() variable from a parent function, but the changed value gets lost when the sub function quits. Here is the code: route[bhah] { xlog("ALLOW BEFORE=\"$var(N9_hdrval)\"\n"); route(csv_filter, $var(N9_hdrval), "(?i)^ *(OPTIONS|INVITE|ACK|BYE|CANCEL|UPDATE|PRACK|MESSAGE) *$", "N9_hdrval"); xlog("ALLOW AFTER=\"$var(N9_hdrval)\"\n"); } route[csv_filter] { $var(N11_srcCSV) = $param(1); $var(N11_filter_regex) = $param(2); $var(N11_resultvar_name) = $param(3); $var(N11_result) = ""; $var(N11_pos) = $(var(N11_srcCSV){csv.count}) - 1; while ($var(N11_pos) >= 0) { $var(N11_element) = $(var(N11_srcCSV){csv.value,$var(N11_pos)}); if (pcre_match($var(N11_element), $var(N11_filter_regex))) { $var(N11_result) = $var(N11_element) + "," + $var(N11_result); } $var(N11_pos) = $var(N11_pos) - 1; } $var(N11_resultLen) = $(var(N11_result){s.len}) - 1; $var($var(N11_resultvar_name)) = $(var(N11_result){s.substr,0,$var(N11_resultLen)}); xlog("FILTERED var($var(N11_resultvar_name))=\"$var($var(N11_resultvar_name))\"\n"); } But this is what gets logged: opensips[21955]: ALLOW BEFORE="OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE" opensips[21955]: FILTERED var(N9_hdrval)="OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE" opensips[21955]: ALLOW AFTER="OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE" This is what I was hoping to get: opensips[21955]: ALLOW BEFORE="OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, REFER, MESSAGE" opensips[21955]: FILTERED var(N9_hdrval)="OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE" opensips[21955]: ALLOW AFTER="OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE" Have I done something silly here? Cheers, Kingsley. ___ 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] dialplan module - dpid - could it be a string?
This sounds like it might be a good feature request [1] and I agree it sounds nice. I can’t offer any assistance in that direction at this time, but I wanted to say that we use M4 in our config scripts to allow us to define string constants like this and make the script more readable, among other reasons. Could be a good short-term workaround. We specifically use it to define string-based dialplan IDs for use in the script, just like this. [1] https://github.com/OpenSIPS/opensips/issues/new?assignees===feature_request.md=%5BFEATURE%5D Ben Newlin From: Users on behalf of Kingsley Tart Date: Tuesday, April 20, 2021 at 12:22 PM To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] dialplan module - dpid - could it be a string? I love the dialplan module and how the rules can be reloaded from a DB. However, is there any reason why the dpid can't be a string instead of an integer? (ie the value that's stored in the dialplan.dpid field). I think it would be handy to be able to apply names to dialplan rulesets as it would be more intuitive. If dpid could be a string, then I could for example create a ruleset that I could refer to as "uk_local_to_e164" instead of "7". Could this be a thing? -- Cheers, Kingsley. ___ 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] Timestamp in date format
That function only uses the current time. As far as I know there are no generic time string format functions in OpenSIPS. The only options are to manipulate the current time only. You could use exec or one of the language modules like python to do this. Or you could write to the XML as a timestamp and convert it outside of OpenSIPS. The latter would be my recommendation if possible. Ben Newlin From: Users on behalf of xa...@web.de Date: Monday, February 22, 2021 at 5:25 PM To: 'OpenSIPS users mailling list' Subject: Re: [OpenSIPS-Users] Timestamp in date format Hi Ben, found that as well, thank you. Is there a way to add for example a week to the current datetime to have a datetime that can be used to say that something is valid until one week in the future? If 2013-08-01T12:00:00Z is now then to have 2013-08-08T12:00:00Z Thanks, Xaled From: Users On Behalf Of Ben Newlin Sent: Monday, February 22, 2021 10:09 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Timestamp in date format > I know that there is a get_timestamp function but I need the result to be > formatted as date. You can use the $time variable. https://www.opensips.org/Documentation/Script-CoreVar-3-1#toc93<https://www.opensips.org/Documentation/Script-CoreVar-3-1#toc93> $time("%Y-%m-%dT%TZ") Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of xa...@web.de<mailto:xa...@web.de> mailto:xa...@web.de>> Date: Monday, February 22, 2021 at 4:01 PM To: 'OpenSIPS users mailling list' mailto:users@lists.opensips.org>> Subject: [OpenSIPS-Users] Timestamp in date format Hi, I need to create a timestamp node in an XML body like shown below 2013-08-01T12:00:00Z I know that there is a get_timestamp function but I need the result to be formatted as date. BTW, is there a way to directly define XML item value using variable Something like: $xml(my_doc/doc/list) = "$var(value)"; Unfortunately it does not work like this Thanks, Xaled ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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] Timestamp in date format
> I know that there is a get_timestamp function but I need the result to be > formatted as date. You can use the $time variable. https://www.opensips.org/Documentation/Script-CoreVar-3-1#toc93 $time("%Y-%m-%dT%TZ") Ben Newlin From: Users on behalf of xa...@web.de Date: Monday, February 22, 2021 at 4:01 PM To: 'OpenSIPS users mailling list' Subject: [OpenSIPS-Users] Timestamp in date format Hi, I need to create a timestamp node in an XML body like shown below 2013-08-01T12:00:00Z I know that there is a get_timestamp function but I need the result to be formatted as date. BTW, is there a way to directly define XML item value using variable Something like: $xml(my_doc/doc/list) = "$var(value)"; Unfortunately it does not work like this Thanks, Xaled ___ 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] To-tag value in ACK
Yes, this is compliant as it occurs in cases of forked SIP messages. Each forked destination will respond with their own To tag. The client must be able to handle this. The UAC in your case is not compliant by using the original To tag value instead of the value in the 200 OK. Ben Newlin From: Users on behalf of John Quick Date: Wednesday, February 17, 2021 at 9:58 AM To: 'OpenSIPS users mailling list' Subject: Re: [OpenSIPS-Users] To-tag value in ACK I took a fresh look at this case and found that the To-tag used in the ACK matches the To-tag that was in the first 180 Ringing. However, Teams has returned different To-tags in the 180 Ringing and in the 183 Session Progress and 200 OK. This appears to be common behaviour for Teams as I can see the same thing in the SIP trace for a completely different customer. Teams uses different To-tags when it responds to an INVITE as follows: SBC <--> Teams INVITE --> <-- 100 Tryingno To-tag <-- 180 RingingTo-tag A <-- 180 RingingTo-tag B <-- 180 RingingTo-tag C <-- 183 Sess.Prog. To-tag D <-- 200 OK To-tag D Is this compliant with the RFC's? Unfortunately, the UAC used by my customer is responding to the 200 OK with an ACK that has To-tag A instead of To-tag D. John Quick Smartvox Limited ___ 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] feasablity / interest in a feature request.
Johan, Unfortunately, the server on which I am tracing is only transaction-aware and does not have Dialog, so I cannot verify this. I will say that we call trace() very early in message processing, almost first thing, and we do still see all changes on the outbound message. Ben Newlin From: Users on behalf of johan Date: Friday, January 22, 2021 at 9:38 AM To: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] feasablity / interest in a feature request. I use this for invite based dialogs. trace("hep_id","d","sip"); I call it just before topology_hiding() I don't see from/to header changes. Can you check on your side Ben ? wkr, On 22/01/2021 15:28, Ben Newlin wrote: We are using siptrace and we get both the incoming and outbound message captured, with all changes. I think it depends on the scope you provide [1]. We use scope T for transactions and we get both. Although, we are using OpenSIPS 2.4. It’s possible the functionality has changed in 3.x. In which case, I would agree that it is not good. [1] - https://opensips.org/docs/modules/3.1.x/tracer.html#func_trace<https://opensips.org/docs/modules/3.1.x/tracer.html#func_trace> Ben Newlin From: Users <mailto:users-boun...@lists.opensips.org> on behalf of Andy Dierlam <mailto:adier...@ptgi-ics.com> Date: Friday, January 22, 2021 at 9:13 AM To: OpenSIPS users mailling list <mailto:users@lists.opensips.org> Subject: Re: [OpenSIPS-Users] feasablity / interest in a feature request. How about running a continuous tshark/pcap/ngrep on interfaces of interest. you can run every 10min. putting in 10min files. On Fri, Jan 22, 2021 at 6:36 AM johan mailto:jo...@democon.be>> wrote: yeah me too. but I want also to see the forwarded packet with all changes. On 22/01/2021 12:13, Nick Altmann wrote: It depends on purpose. For example, I need an initial (untouched) packet there. -- Nick пт, 22 нв. 2021 г. в 09:18, johan mailto:jo...@democon.be>>: Hi, when you use the siptrace module and you go to homer from opensips (hence without a port mirror/span port on a switch), when you change from /to header, then the homer trace doesnot reflect the real packet that exits opensips (as we all know, from to header changes are only active when the packet is send out). I find this annoying as the purpose of having a tracer is defeated by this : we want to see the real packets with the changes applied. Therefore : are there more people on the list who are ennoyed by this ? If yes, then I will open a feature request for it. wkr, ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users> ___ Users mailing list Users@lists.opensips.org<mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<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