Re: [OpenSIPS-Users] Generate CANCEL on 180

2021-04-21 Thread Vlad Paiu

Hello,

In 3.1, create_dialog [1] supports passing it the 'E' flag which will 
lead to the call termination if a dialog race condition occurs.


The dialog will be ended after race_condition_timeout [2] seconds.

Some of the most frequent race conditions are documented in RFC 5407 
[3], and the dialog module currently supports terminating the call in 
case races 3.1.2 and 3.1.3 from the RFC occur.


[1] 
https://opensips.org/html/docs/modules/3.1.x/dialog.html#func_create_dialog 



[2] 
https://opensips.org/html/docs/modules/3.1.x/dialog.html#race_condition_timeout 



[3] https://tools.ietf.org/html/rfc5407 



On 21.04.2021 15:52, Antonis Psaras wrote:

Hello Vlad

I am using 2.4 so race_condition_timeout is not available but I can upgrade if 
required.

Actually is not very clear to me what that parameter does. Can you explain a 
bit more?

Regards


Antonis Psaras / Managing Director
   


-Original Message-
From: Users  On Behalf Of Vlad Paiu
Sent: Τετάρτη, 21 Απριλίου 2021 15:45
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

Hello,

Try using the race_condition_timeout dialog param along with the 'E'
flag when creating the dialog.

https://opensips.org/html/docs/modules/3.1.x/dialog.html#race_condition_timeout


Best Regards,
Vlad
On 21.04.2021 12:46, Antonis Psaras wrote:

Hello Bogdan

The flow is the following

INVITE
Trying (instantly)
(after 2sec)
183
(after 3sec)
180
(here I do the process but during that I receive)
200 (instantly)
(here the CANCEL is sent)
CANCEL

And the call is keep going, hence the CANCEL was ignored by the carrier by the 
carrier because the call was answered.

Regards


Antonis Psaras

-Original Message-
From: Bogdan-Andrei Iancu 
Sent: Τετάρτη, 21 Απριλίου 2021 12:32
To: apsa...@microbase.gr; OpenSIPS users mailling list

Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

Hi Antonis,

What exactly does not work ? sending the CANCEL out? or the callee "refuses" to 
cancel and sends a 200 OK ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
 https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
 https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/20/21 11:13 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


Re: [OpenSIPS-Users] Generate CANCEL on 180

2021-04-21 Thread Antonis Psaras
Hello Vlad

I am using 2.4 so race_condition_timeout is not available but I can upgrade if 
required.

Actually is not very clear to me what that parameter does. Can you explain a 
bit more?

Regards


Antonis Psaras / Managing Director
  

-Original Message-
From: Users  On Behalf Of Vlad Paiu
Sent: Τετάρτη, 21 Απριλίου 2021 15:45
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

Hello,

Try using the race_condition_timeout dialog param along with the 'E' 
flag when creating the dialog.

https://opensips.org/html/docs/modules/3.1.x/dialog.html#race_condition_timeout


Best Regards,
Vlad
On 21.04.2021 12:46, Antonis Psaras wrote:
> Hello Bogdan
>
> The flow is the following
>
> INVITE
> Trying (instantly)
> (after 2sec)
> 183
> (after 3sec)
> 180
> (here I do the process but during that I receive)
> 200 (instantly)
> (here the CANCEL is sent)
> CANCEL
>
> And the call is keep going, hence the CANCEL was ignored by the carrier by 
> the carrier because the call was answered.
>
> Regards
>
>
> Antonis Psaras
>
> -Original Message-
> From: Bogdan-Andrei Iancu 
> Sent: Τετάρτη, 21 Απριλίου 2021 12:32
> To: apsa...@microbase.gr; OpenSIPS users mailling list 
> 
> Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180
>
> Hi Antonis,
>
> What exactly does not work ? sending the CANCEL out? or the callee "refuses" 
> to cancel and sends a 200 OK ?
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
> https://www.opensips-solutions.com
> OpenSIPS Bootcamp 2021 online
> https://opensips.org/training/OpenSIPS_eBootcamp_2021/
>
> On 4/20/21 11:13 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

___
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-21 Thread Vlad Paiu

Hello,

Try using the race_condition_timeout dialog param along with the 'E' 
flag when creating the dialog.


https://opensips.org/html/docs/modules/3.1.x/dialog.html#race_condition_timeout 



Best Regards,
Vlad
On 21.04.2021 12:46, Antonis Psaras wrote:

Hello Bogdan

The flow is the following

INVITE
Trying (instantly)
(after 2sec)
183
(after 3sec)
180
(here I do the process but during that I receive)
200 (instantly)
(here the CANCEL is sent)
CANCEL

And the call is keep going, hence the CANCEL was ignored by the carrier by the 
carrier because the call was answered.

Regards


Antonis Psaras

-Original Message-
From: Bogdan-Andrei Iancu 
Sent: Τετάρτη, 21 Απριλίου 2021 12:32
To: apsa...@microbase.gr; OpenSIPS users mailling list 

Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

Hi Antonis,

What exactly does not work ? sending the CANCEL out? or the callee "refuses" to 
cancel and sends a 200 OK ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/20/21 11:13 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


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


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

2021-04-21 Thread Kingsley Tart
Hi,

Thanks but I tried that and whatever I tried I could not get it to
work. I don't know whether I have misunderstood what you meant?


With this setup:
+--++--++-+-+-+
| dpid | pr | match_op | match_exp  | match_flags | subst_exp   | repl_exp  
  |
+--++--++-+-+-+
|  100 |  1 |1 | (;user=phone)? |   1 | ;user=phone | 
;user=phone |
+--++--++-+-+-+

I got this:

# opensips-cli -x mi dp_reload
"OK"
# opensips-cli -x mi dp_translate 100 "+12...@sip.com;food=beans"
ERROR: command 'dp_translate' returned: 404: No translation
# opensips-cli -x mi dp_translate 100 "+12...@sip.com;user=phone"
{
"Output": ";user=phone",
"ATTRIBUTES": ""
}


and with this setup:

+--++--++-++-+
| dpid | pr | match_op | match_exp  | match_flags | subst_exp  | 
repl_exp|
+--++--++-++-+
|  100 |  1 |1 | (;user=phone)? |   1 | (;user=phone)? | 
;user=phone |
+--++--++-++-+

I got this:

# opensips-cli -x mi dp_reload
"OK"
# opensips-cli -x mi dp_translate 100 "+12...@sip.com;food=beans"
{
"Output": ";user=phone",
"ATTRIBUTES": ""
}
# opensips-cli -x mi dp_translate 100 "+12...@sip.com;user=phone"
{
"Output": ";user=phone",
"ATTRIBUTES": ""
}

but also realised that if it had matched, I would have no control over
where in the URI it would have added the extra text, so I'm wondering
that my two rule approach is perhaps the best way for what I'm doing
anyway.

Cheers,
Kingsley.

On Wed, 2021-04-21 at 12:47 +0300, Bogdan-Andrei Iancu wrote:
> Hi Kingsley,
> 
> You could try with a single rule, like optional matching the param (like 
> "(;user=phone)?") and in subst + repl part do not include the param 
> inside the \1 parenthesis, having it added all the time in the repl part.
> 
> Still you need a more complex matching if you have multiple params, not 
> only the "user" one.
> 
> Regards,
> 
> Bogdan-Andrei Iancu
> 
> OpenSIPS Founder and Developer
>https://www.opensips-solutions.com
> OpenSIPS Bootcamp 2021 online
>https://opensips.org/training/OpenSIPS_eBootcamp_2021/
> 
> On 4/20/21 8:16 PM, Kingsley Tart wrote:
> > 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 |
> > 
> > ++--+-+-+---+
> > ---+
> > 
> 
> 


___
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-21 Thread Antonis Psaras
Thank you.

I will. Thank you for your support


Antonis Psaras
 

-Original Message-
From: Bogdan-Andrei Iancu  
Sent: Τετάρτη, 21 Απριλίου 2021 13:50
To: apsa...@microbase.gr; 'OpenSIPS users mailling list' 

Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

Well, you should bring that to the carrier :(

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
   https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/21/21 1:47 PM, Antonis Psaras wrote:
> No. there is no reply. Just ignored.
>
>
> Antonis Psaras / Managing Director
>
> -Original Message-
> From: Bogdan-Andrei Iancu 
> Sent: Τετάρτη, 21 Απριλίου 2021 13:20
> To: apsa...@microbase.gr; 'OpenSIPS users mailling list' 
> 
> Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180
>
> So there is a race between the CANCEL you send and the incoming 200 OK, right 
> ? And does the carrier even reply to that CANCEL? the RFC3261 says it is a 
> must to provide a reply to any incoming request.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
> https://www.opensips-solutions.com
> OpenSIPS Bootcamp 2021 online
> https://opensips.org/training/OpenSIPS_eBootcamp_2021/
>
> On 4/21/21 12:46 PM, Antonis Psaras wrote:
>> Hello Bogdan
>>
>> The flow is the following
>>
>> INVITE
>> Trying (instantly)
>> (after 2sec)
>> 183
>> (after 3sec)
>> 180
>> (here I do the process but during that I receive)
>> 200 (instantly)
>> (here the CANCEL is sent)
>> CANCEL
>>
>> And the call is keep going, hence the CANCEL was ignored by the carrier by 
>> the carrier because the call was answered.
>>
>> Regards
>>
>>
>> Antonis Psaras
>>
>> -Original Message-
>> From: Bogdan-Andrei Iancu 
>> Sent: Τετάρτη, 21 Απριλίου 2021 12:32
>> To: apsa...@microbase.gr; OpenSIPS users mailling list 
>> 
>> Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180
>>
>> Hi Antonis,
>>
>> What exactly does not work ? sending the CANCEL out? or the callee "refuses" 
>> to cancel and sends a 200 OK ?
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>  https://www.opensips-solutions.com
>> OpenSIPS Bootcamp 2021 online
>>  https://opensips.org/training/OpenSIPS_eBootcamp_2021/
>>
>> On 4/20/21 11:13 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
>>>
>>>
>>> 

Re: [OpenSIPS-Users] Generate CANCEL on 180

2021-04-21 Thread Bogdan-Andrei Iancu

Well, you should bring that to the carrier :(

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
  https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/21/21 1:47 PM, Antonis Psaras wrote:

No. there is no reply. Just ignored.


Antonis Psaras / Managing Director

-Original Message-
From: Bogdan-Andrei Iancu 
Sent: Τετάρτη, 21 Απριλίου 2021 13:20
To: apsa...@microbase.gr; 'OpenSIPS users mailling list' 

Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

So there is a race between the CANCEL you send and the incoming 200 OK, right ? 
And does the carrier even reply to that CANCEL? the RFC3261 says it is a must 
to provide a reply to any incoming request.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/21/21 12:46 PM, Antonis Psaras wrote:

Hello Bogdan

The flow is the following

INVITE
Trying (instantly)
(after 2sec)
183
(after 3sec)
180
(here I do the process but during that I receive)
200 (instantly)
(here the CANCEL is sent)
CANCEL

And the call is keep going, hence the CANCEL was ignored by the carrier by the 
carrier because the call was answered.

Regards


Antonis Psaras

-Original Message-
From: Bogdan-Andrei Iancu 
Sent: Τετάρτη, 21 Απριλίου 2021 12:32
To: apsa...@microbase.gr; OpenSIPS users mailling list

Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

Hi Antonis,

What exactly does not work ? sending the CANCEL out? or the callee "refuses" to 
cancel and sends a 200 OK ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
 https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
 https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/20/21 11:13 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-21 Thread Antonis Psaras
No. there is no reply. Just ignored.


Antonis Psaras / Managing Director

-Original Message-
From: Bogdan-Andrei Iancu  
Sent: Τετάρτη, 21 Απριλίου 2021 13:20
To: apsa...@microbase.gr; 'OpenSIPS users mailling list' 

Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

So there is a race between the CANCEL you send and the incoming 200 OK, right ? 
And does the carrier even reply to that CANCEL? the RFC3261 says it is a must 
to provide a reply to any incoming request.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
   https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/21/21 12:46 PM, Antonis Psaras wrote:
> Hello Bogdan
>
> The flow is the following
>
> INVITE
> Trying (instantly)
> (after 2sec)
> 183
> (after 3sec)
> 180
> (here I do the process but during that I receive)
> 200 (instantly)
> (here the CANCEL is sent)
> CANCEL
>
> And the call is keep going, hence the CANCEL was ignored by the carrier by 
> the carrier because the call was answered.
>
> Regards
>
>
> Antonis Psaras
>
> -Original Message-
> From: Bogdan-Andrei Iancu 
> Sent: Τετάρτη, 21 Απριλίου 2021 12:32
> To: apsa...@microbase.gr; OpenSIPS users mailling list 
> 
> Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180
>
> Hi Antonis,
>
> What exactly does not work ? sending the CANCEL out? or the callee "refuses" 
> to cancel and sends a 200 OK ?
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
> https://www.opensips-solutions.com
> OpenSIPS Bootcamp 2021 online
> https://opensips.org/training/OpenSIPS_eBootcamp_2021/
>
> On 4/20/21 11:13 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-21 Thread Bogdan-Andrei Iancu
So there is a race between the CANCEL you send and the incoming 200 OK, 
right ? And does the carrier even reply to that CANCEL? the RFC3261 says 
it is a must to provide a reply to any incoming request.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
  https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/21/21 12:46 PM, Antonis Psaras wrote:

Hello Bogdan

The flow is the following

INVITE
Trying (instantly)
(after 2sec)
183
(after 3sec)
180
(here I do the process but during that I receive)
200 (instantly)
(here the CANCEL is sent)
CANCEL

And the call is keep going, hence the CANCEL was ignored by the carrier by the 
carrier because the call was answered.

Regards


Antonis Psaras

-Original Message-
From: Bogdan-Andrei Iancu 
Sent: Τετάρτη, 21 Απριλίου 2021 12:32
To: apsa...@microbase.gr; OpenSIPS users mailling list 

Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

Hi Antonis,

What exactly does not work ? sending the CANCEL out? or the callee "refuses" to 
cancel and sends a 200 OK ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/20/21 11:13 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] [ANNOUNCE]: sipnagios, a Nagios Plugin to check Call Quality in SIP VoIP (compatible with checkmk, etc)

2021-04-21 Thread Bogdan-Andrei Iancu

Really nice Giovanni, thanks for the info !

Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
  https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/21/21 12:39 PM, Giovanni Maruzzelli wrote:

Hello fellow VoIPers and RTCers,

on GitHub there is an early release of sipnagios, opensource.

check it out: https://github.com/gmaruzz/sipnagios

sipnagios is a Nagios Plugin to check Call Quality in SIP VoIP 
(compatible with checkmk, etc)


sipnagios implements the Nagios plugin API for monitoring and 
performance data.


sipnagios.c is a modification of the original siprtp.c sample in 
pjproject distribution. Supposedly, it works on Linux, Windows, and 
anywhere you can compile pjproject on.


It makes a call, checks all the various resulting values (mos, rtt, 
pdd, tta, jitter, packet loss, bytes and packets transferred, and so 
on). It verifies these values are included into acceptable, warning, 
or critical ranges.


If the call has gone well, sipnagios print performance data for Nagios 
graphs, and returns 0.


If the call fails, or if its measured values are not inside acceptable 
ranges, it exits with Nagios conventional WARNING or CRITICAL values.


mos calculation is scraped from Julien Chavanton work (VoIP Patrol, on 
GitHub too) I can't even understand :) (merci Julien!)


Enjoy!
-giovanni


--
Sincerely,

Giovanni Maruzzelli
OpenTelecom.IT
cell: +39 347 266 56 18


___
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] how can i combine signaling and RTP from rtpproxy

2021-04-21 Thread Bogdan-Andrei Iancu

https://www.wireshark.org/docs/wsug_html_chunked/ChIOMergeSection.html ??

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
  https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/20/21 11:15 AM, Miha via Users wrote:

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


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


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

2021-04-21 Thread Bogdan-Andrei Iancu

Hi Kingsley,

You could try with a single rule, like optional matching the param (like 
"(;user=phone)?") and in subst + repl part do not include the param 
inside the \1 parenthesis, having it added all the time in the repl part.


Still you need a more complex matching if you have multiple params, not 
only the "user" one.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
  https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/20/21 8:16 PM, Kingsley Tart wrote:

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 |
++--+-+-+---+---+




___
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-21 Thread Antonis Psaras
Hello Bogdan

The flow is the following

INVITE
Trying (instantly)
(after 2sec)
183
(after 3sec)
180
(here I do the process but during that I receive)
200 (instantly)
(here the CANCEL is sent)
CANCEL

And the call is keep going, hence the CANCEL was ignored by the carrier by the 
carrier because the call was answered.

Regards


Antonis Psaras 

-Original Message-
From: Bogdan-Andrei Iancu  
Sent: Τετάρτη, 21 Απριλίου 2021 12:32
To: apsa...@microbase.gr; OpenSIPS users mailling list 

Subject: Re: [OpenSIPS-Users] Generate CANCEL on 180

Hi Antonis,

What exactly does not work ? sending the CANCEL out? or the callee "refuses" to 
cancel and sends a 200 OK ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
   https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/20/21 11:13 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


[OpenSIPS-Users] [ANNOUNCE]: sipnagios, a Nagios Plugin to check Call Quality in SIP VoIP (compatible with checkmk, etc)

2021-04-21 Thread Giovanni Maruzzelli
Hello fellow VoIPers and RTCers,

on GitHub there is an early release of sipnagios, opensource.

check it out: https://github.com/gmaruzz/sipnagios

sipnagios is a Nagios Plugin to check Call Quality in SIP VoIP (compatible
with checkmk, etc)

sipnagios implements the Nagios plugin API for monitoring and performance
data.

sipnagios.c is a modification of the original siprtp.c sample in pjproject
distribution. Supposedly, it works on Linux, Windows, and anywhere you can
compile pjproject on.

It makes a call, checks all the various resulting values (mos, rtt, pdd,
tta, jitter, packet loss, bytes and packets transferred, and so on). It
verifies these values are included into acceptable, warning, or critical
ranges.

If the call has gone well, sipnagios print performance data for Nagios
graphs, and returns 0.

If the call fails, or if its measured values are not inside acceptable
ranges, it exits with Nagios conventional WARNING or CRITICAL values.

mos calculation is scraped from Julien Chavanton work (VoIP Patrol, on
GitHub too) I can't even understand :) (merci Julien!)
Enjoy!
-giovanni


-- 
Sincerely,

Giovanni Maruzzelli
OpenTelecom.IT
cell: +39 347 266 56 18
___
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-21 Thread Bogdan-Andrei Iancu

Hi Antonis,

What exactly does not work ? sending the CANCEL out? or the callee 
"refuses" to cancel and sends a 200 OK ?


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
  https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/20/21 11:13 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


[OpenSIPS-Users] [RELEASE] OpenSIPS 3.1.2 and 2.4.10 minor releases planning

2021-04-21 Thread Răzvan Crainea

Hi, Everyone!

I am glad to announce you that we have scheduled two new minor releases 
of our OpenSIPS stable branches. Therefore, on 6th of May 2021 we will 
release OpenSIPS 3.1.2 and 2.4.10!
These new releases contain the latest bug fixes, and are fully 
compatible with previous versions.
In order to increase releases' stability, we decided to freeze the code 
for two weeks - during this period the community is encouraged to fully 
test the upcoming releases and report any urgent matters, that we can 
eventually get fixed by the time of the release. The freeze starts 
tomorrow, 22nd of April 2021 and will last till the time of release, 6th 
of May 2021.


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

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


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

2021-04-21 Thread Kingsley Tart
I've added it as a feature request:

https://github.com/OpenSIPS/opensips/issues/2477

Cheers,
Kingsley.

On Wed, 2021-04-21 at 10:58 +0300, Bogdan-Andrei Iancu wrote:
> Indeed, it may be an interesting one. And as Ben said, we are also
> using M4 for the scripting, nevertheless, if you want to integrate
> with OpenSIPS Control Panel, it may become tricky ;)
> 
> Regards,
> On 4/20/21 9:05 PM, Ben Newlin wrote:
> > 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
>  
> ___
> 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-21 Thread Bogdan-Andrei Iancu
Indeed, it may be an interesting one. And as Ben said, we are also using 
M4 for the scripting, nevertheless, if you want to integrate with 
OpenSIPS Control Panel, it may become tricky ;)


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 2021 online
  https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 4/20/21 9:05 PM, Ben Newlin wrote:


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


___
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-21 Thread Johan De Clercq
Certain providers do this all the time : they bill faulty numbers

So they give 180 followed by instant 200 and then they play : "the number
that you tried to reach ".

Actually, Antonis, you should try a few of those numbers manually, I bet
you that they are all faulty.

Op di 20 apr. 2021 om 23:02 schreef 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
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users