Re: [OpenSIPS-Users] Generate CANCEL on 180

2021-04-20 Thread Calvin Ellison
Once you receive 200 it is too late to CANCEL. You will need to ACK the 200
and then BYE the call.


Regards,

*Calvin Ellison*
Systems Architect
calvin.elli...@voxox.com
+1 (213) 285-0555

---
*voxox.com  *
5825 Oberlin Drive, Suite 5
San Diego, CA 92121
[image: Voxox]


On Tue, Apr 20, 2021 at 1:14 PM Antonis Psaras  wrote:

> I did the following
>
> if (t_check_status("180"))
> {
> t_cancel_branch();
>drop;
> }
>
> But there is an issue.
>
> When 180 is followed by 200 instantly, the CANCEL is not working as
> expected.
>
> When I add a delay on Answer ie 1sec then CANCEL works.
>
> Any suggestion?
>
> Antonis Psaras
>
> -Original Message-
> From: Users  On Behalf Of Kingsley Tart
> Sent: Τρίτη, 20 Απριλίου 2021 20:10
> To: OpenSIPS users mailling list 
> Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180
>
> Firstly, I'm new to OpenSIPS so treat my comments accordingly.
>
> But, can you do something in an onreply route?
>
> eg, in a test setup I have, when I get an INVITE I do this:
>
> create_dialog("pPB");
> t_on_reply("doodle");
>
> (I can't remember whether the dialog is needed for this)
>
> and then I have this:
>
> onreply_route[doodle] {
> # expect $T_reply_code to likely first be 100
> # then 180 or 183 for a progressing call
> # 200 when call is answered
> # or failure code (eg 4xx) or whatever
> if (t_check_status("^1[0-9][0-9]$")) {
> switch ($T_reply_code) {
> case 180: $acc_extra(t_ringing) = $Ts; break;
> case 183: $acc_extra(t_progress) = $Ts; break;
> }
> } else if (t_check_status("^2[0-9][0-9]$")) {
> $acc_extra(t_answer) = $Ts;
> } else {
> xlog("Something else\n");
> }
> }
>
> so when a 180 is received, it calls the above route function. Could you
> send a CANCEL from there?
>
> Cheers,
> Kingsley.
>
> On Tue, 2021-04-20 at 16:55 +0300, Antonis Psaras wrote:
> > Dear all
> >
> > I am trying to create a service which will generate missed calls. In
> > order to be more accurate, I want to CANCEL the request when 180 is
> > received.
> >
> > The scenario is the following
> >
> > Asterisk Invite -> OpenSIPs -> Carrier
> >
> > Carrier 183 -> OpenSIPs -> Asterisk
> >
> > Carrier 180 -> OpenSIPs
> >
> > OpenSIPs Cancel -> Carrier
> >
> >
> > Is that possible to be done from script without external app?
> >
> > Regards
> >
> > ___
> > 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] Generate CANCEL on 180

2021-04-20 Thread Antonis Psaras
I did the following

if (t_check_status("180"))
{
t_cancel_branch();
   drop;
}

But there is an issue.

When 180 is followed by 200 instantly, the CANCEL is not working as expected.

When I add a delay on Answer ie 1sec then CANCEL works.

Any suggestion?

Antonis Psaras 

-Original Message-
From: Users  On Behalf Of Kingsley Tart
Sent: Τρίτη, 20 Απριλίου 2021 20:10
To: OpenSIPS users mailling list 
Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

Firstly, I'm new to OpenSIPS so treat my comments accordingly.

But, can you do something in an onreply route?

eg, in a test setup I have, when I get an INVITE I do this:

create_dialog("pPB");
t_on_reply("doodle");

(I can't remember whether the dialog is needed for this)

and then I have this:

onreply_route[doodle] {
# expect $T_reply_code to likely first be 100
# then 180 or 183 for a progressing call
# 200 when call is answered
# or failure code (eg 4xx) or whatever
if (t_check_status("^1[0-9][0-9]$")) {
switch ($T_reply_code) {
case 180: $acc_extra(t_ringing) = $Ts; break;
case 183: $acc_extra(t_progress) = $Ts; break;
}
} else if (t_check_status("^2[0-9][0-9]$")) {
$acc_extra(t_answer) = $Ts;
} else {
xlog("Something else\n");
}
}

so when a 180 is received, it calls the above route function. Could you send a 
CANCEL from there?

Cheers,
Kingsley.

On Tue, 2021-04-20 at 16:55 +0300, Antonis Psaras wrote:
> Dear all
> 
> I am trying to create a service which will generate missed calls. In 
> order to be more accurate, I want to CANCEL the request when 180 is 
> received.
> 
> The scenario is the following
> 
> Asterisk Invite -> OpenSIPs -> Carrier
> 
> Carrier 183 -> OpenSIPs -> Asterisk
> 
> Carrier 180 -> OpenSIPs
> 
> OpenSIPs Cancel -> Carrier
> 
>  
> Is that possible to be done from script without external app?
>  
> Regards
>  
> ___
> 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] dialplan module - dpid - could it be a string?

2021-04-20 Thread Ben Newlin
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


[OpenSIPS-Users] dialplan module - ensuring a substring exists in URI

2021-04-20 Thread Kingsley Tart
Hi,

I want a DP ruleset to ensure that ";user=phone" is in the SIP URI, ie
if it is not there, add it, but if it is already there, do nothing.

I've managed to do this with two lines, but is there a more efficient
way?

This is what I have in the dialplan table in this ruleset?

++--+-+-+---+---+
| pr | match_op | match_exp   | match_flags | subst_exp | repl_exp  |
++--+-+-+---+---+
|  1 |1 | ;user=phone |   1 | (.+)  | \1|
|  2 |1 | .   |   1 | (.+)  | \1;user=phone |
++--+-+-+---+---+

-- 
Cheers,
Kingsley.


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


Re: [OpenSIPS-Users] Generate CANCEL on 180

2021-04-20 Thread Kingsley Tart
Firstly, I'm new to OpenSIPS so treat my comments accordingly.

But, can you do something in an onreply route?

eg, in a test setup I have, when I get an INVITE I do this:

create_dialog("pPB");
t_on_reply("doodle");

(I can't remember whether the dialog is needed for this)

and then I have this:

onreply_route[doodle] {
# expect $T_reply_code to likely first be 100
# then 180 or 183 for a progressing call
# 200 when call is answered
# or failure code (eg 4xx) or whatever
if (t_check_status("^1[0-9][0-9]$")) {
switch ($T_reply_code) {
case 180: $acc_extra(t_ringing) = $Ts; break;
case 183: $acc_extra(t_progress) = $Ts; break;
}
} else if (t_check_status("^2[0-9][0-9]$")) {
$acc_extra(t_answer) = $Ts;
} else {
xlog("Something else\n");
}
}

so when a 180 is received, it calls the above route function. Could you
send a CANCEL from there?

Cheers,
Kingsley.

On Tue, 2021-04-20 at 16:55 +0300, Antonis Psaras wrote:
> Dear all
> 
> I am trying to create a service which will generate missed calls. In
> order to be more accurate, I want to CANCEL the request when 180 is
> received.
> 
> The scenario is the following
> 
> Asterisk Invite -> OpenSIPs -> Carrier
> 
> Carrier 183 -> OpenSIPs -> Asterisk
> 
> Carrier 180 -> OpenSIPs
> 
> OpenSIPs Cancel -> Carrier
> 
>  
> Is that possible to be done from script without external app?
>  
> Regards
>  
> ___
> 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] Generate CANCEL on 180

2021-04-20 Thread Alain Bieuzent
Hi Antonis,

 

it seems possible ...: 
https://opensips.org/html/docs/modules/3.1.x/tm.html#func_t_cancel_branch.

 

Regards

 

De : Users  au nom de Antonis Psaras 

Organisation : Microbase
Répondre à : , OpenSIPS users mailling list 

Date : mardi 20 avril 2021 à 15:58
À : 
Objet : [OpenSIPS-Users] Generate CANCEL on 180

 

Dear all

I am trying to create a service which will generate missed calls. In order to 
be more accurate, I want to CANCEL the request when 180 is received.

The scenario is the following

Asterisk Invite -> OpenSIPs -> Carrier

Carrier 183 -> OpenSIPs -> Asterisk

Carrier 180 -> OpenSIPs

OpenSIPs Cancel -> Carrier

 

Is that possible to be done from script without external app?

 

Regards

 

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

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


[OpenSIPS-Users] dialplan module - dpid - could it be a string?

2021-04-20 Thread Kingsley Tart
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


[OpenSIPS-Users] Generate CANCEL on 180

2021-04-20 Thread Antonis Psaras
Dear all

I am trying to create a service which will generate missed calls. In order
to be more accurate, I want to CANCEL the request when 180 is received.

The scenario is the following

Asterisk Invite -> OpenSIPs -> Carrier

Carrier 183 -> OpenSIPs -> Asterisk

Carrier 180 -> OpenSIPs

OpenSIPs Cancel -> Carrier

 

Is that possible to be done from script without external app?

 

Regards

 

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


[OpenSIPS-Users] [Blog] OpenSIPIt ’01 – Testing the Trending SIP Security Enhancements

2021-04-20 Thread Liviu Chircu

Hi, folks!

Last week, there was quite a bit of buzz around the first official 
OpenSIPIt event.  Check out the below blog post to see how things went 
and what the status quo around the new SIP "Security RFCs" looks like.


https://blog.opensips.org/2021/04/20/opensipit-01-testing-the-trending-sip-security-enhancements/

Enjoy!

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com
OpenSIPS eBootcamp 2021 | www.opensips.org/training


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


[OpenSIPS-Users] how can i combine signaling and RTP from rtpproxy

2021-04-20 Thread Miha via Users

Hello

due to debugging i would like to combine cap from opensips and also cap 
from rtpproxy (they are on different servers) so that I can check if RTP 
is missing for certain call.



Can you help me with solving this issue :)

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


[OpenSIPS-Users] Removing INVITE Contact from Reply (2.1.5)

2021-04-20 Thread mwb via Users
Hello,I posed a questions a few months ago and received some helpful advice 
from a user here but I'm having an issue implementing it properly.
We have a redirect server using OpenSIPS 2.1.5 that does LNP dipping with a 
little bit of routing as well. 
There are two scenarios:
1. There is No RN/NPDI in the RURI (so the redirect server sends a LNP request 
to an external LNP server
2. The INVITE has RN/NPDI in the RURI so no LNP dip is dispatched.
In the second scenario we do a few operations and generate URIs to embed in a 
302 reply using the send_reply function in a . The issue we are running into is 
that it appears the $ds variable is being populated with the INVITE Request URI 
(RN and/or NPDI) info and it is being sent as the "top" Contact header in the 
302 response. 
I have tried a few different things, including "remove_branch(0)" but they 
don't seem to be able to clobber the value in the $ds variable. It also seems 
impossible to use $ds as an LVALUE to try and overwrite it (this is consistent 
with the documentation which says it is not r/w).
Is there a way to:
1. Clobber the $ds variable?2. Preclude the $ds variable from being inserted as 
a Contact header in the reply?3. Keep the $ds variable from being populated 
when the initial INVITE is received.
Thanks!___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users