Re: [OpenSIPS-Users] Compare $fU to drouting prefix

2020-04-18 Thread Callum Guy
That'll do it..

On Fri, 17 Apr 2020 at 16:00, Mark Farmer  wrote:

> OK, fixed it.
>
> Turned out to be this breaking it by overwriting $acc_extra(customer_id)
> with a blank value.
>
> ...
> else $acc_extra(Call_Flow) = "Internal";
> $acc_extra(customer_id) = $var(rule_attrs);
> ...
>
> Changed it to:
>
> ...
> else if (isflagset(TPTY_PBX) || isflagset(PBX_TPTY)) {
> $acc_extra(Call_Flow) = "Internal";
> $acc_extra(customer_id) = $var(rule_attrs);
> ...
>
> And all works nicely :)
>
> Thanks for the help!
> Mark.
>
>
> On Fri, 17 Apr 2020 at 14:08, Mark Farmer  wrote:
>
>> Thats what I thought :)
>>
>> This is getting quite odd now.
>> I am adding 2 extra fields, Call_Flow & customer_id. The odd thing is
>> that Call_Flow is working perfectly in all cases.
>> customer_id works fine for the latter 2 scenarios but in the first
>> scenario the customer_id data is never added to the database.
>>
>> I have this configured for the acc module:
>> modparam("acc", "extra_fields", "db: from_usr; to_usr; customer_id;
>> Call_Flow")
>>
>> The variable is set earlier on:
>> ...
>> do_routing("3",,,"$var(custID)");
>> ...
>>
>> And I am doing all of the accounting in a dedicated route:
>>
>> route[ACCEXTRA] {
>> do_accounting("db","cdr");
>> xlog("CUSTOM_LOG: Adding extra accounting: from_usr: $fU
>> customer_id: $var(rule_attrs) $var(custID)"); *# variable is
>> visible here*
>> $acc_extra(from_usr) = $fU;
>> $acc_extra(to_usr) = $tU;
>> if (isflagset(PBX_PSTN) || isflagset(TPTY_PSTN)) {
>> xlog("CUSTOM_LOG: Customer ID = $var(custID)"); *#
>> variable is visible here*
>> $acc_extra(Call_Flow) = "Outbound";
>> $acc_extra(customer_id) = $var(custID);
>> xlog("CUSTOM_LOG: $$acc_extra(customer_id) =
>> $acc_extra(customer_id)"); *# variable is visible here*
>> } else if (isflagset(PSTN_TPTY) || isflagset(PSTN_PBX)) {
>> $acc_extra(Call_Flow) = "Inbound";
>> $acc_extra(customer_id) = $var(rule_attrs);
>> } else $acc_extra(Call_Flow) = "Internal";
>> $acc_extra(customer_id) = $var(rule_attrs);
>> }
>>
>>
>> On Fri, 17 Apr 2020 at 13:50, Bogdan-Andrei Iancu 
>> wrote:
>>
>>> Mark,
>>>
>>> You can populate the $acc_extra() from whatever other variable or string
>>> operations. Most probably your issue is in other place, in regards to the
>>> acc logic.
>>>
>>> Regards,
>>>
>>> Bogdan-Andrei Iancu
>>>
>>> OpenSIPS Founder and Developer
>>>   https://www.opensips-solutions.com
>>>
>>> On 4/17/20 1:40 PM, Mark Farmer wrote:
>>>
>>> Thanks Bogdan, that's mostly working now.
>>>
>>> My issue now is with passing that identifier into acc_extra() as a
>>> variable which does not seem to be working.
>>> Using xlog() I can see that the variable is populated right before
>>> calling acc_extra()
>>>
>>> ...
>>> if (isflagset(PBX_PSTN) || isflagset(TPTY_PSTN)) {
>>> xlog("CUSTOM_LOG: Customer ID = $var(custID)");
>>> $acc_extra(customer_id) = $var(custID);
>>> ...
>>> do_accounting("db","cdr");
>>> }
>>>
>>> Does acc_extra() not accept variables as input?
>>>
>>> Thanks again!
>>> Mark.
>>>
>>>
>>>
>>>
>>> On Fri, 17 Apr 2020 at 09:15, Bogdan-Andrei Iancu 
>>> wrote:
>>>
 Hey Mark,

 It is not nice, but you can do:

 $var(tmp) = $rU;
 $rU = $fU
 do_routing();
 $rU = $var(tmp);

 Regards,

 Bogdan-Andrei Iancu

 OpenSIPS Founder and Developer
   https://www.opensips-solutions.com

 On 4/17/20 11:13 AM, Mark Farmer wrote:

 Hi Bogdan, I will try to explain better.

 In rule_attrs I have a customer identifier which is used by acc to add
 the identifier into the CDR database.
 This works fine for calls from PSTN which are routed to another SIP
 gateway but calls from that gateway routed to PSTN can come from multiple
 customers and there is no way to identify which. So I'd like to match the
 incoming $fU to the rule that would match $rU in the from PSTN scenario in
 order to retrieve the rule_attrs (the customer identifier) from that rule.

 Does that make sense?

 Many thanks and regards
 Mark.




 On Thu, 16 Apr 2020 at 16:55, Bogdan-Andrei Iancu 
 wrote:

> Hi Mark,
>
> What kind of matching you want to do between $fU and the dr prefixes ?
> You want to do the same as what drouting() does with $rU ?
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
>
> On 4/16/20 6:14 PM, Mark Farmer wrote:
>
> Hi everyone
>
> I am looking for a way to compare $fU in INVITE to the matching
> drouting() prefix of another group and retrieve the rule_attrs from that
> rule.
>
> At the moment I am thinking I'll have to

Re: [OpenSIPS-Users] ms teams ACK

2020-04-18 Thread Johan De Clercq
Please find  the necessary manips in this doc.

https://www.oracle.com/webfolder/technetwork/acmepacket/Microsoft/SBC-MSFTTeams-NON-MB.pdf

https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/


Outlook voor iOS downloaden

Van: Users  namens volga629 via Users 

Verzonden: Saturday, April 18, 2020 3:38:33 AM
Aan: OpenSIPS users mailling list 
Onderwerp: [OpenSIPS-Users] ms teams ACK


Hello Everyone,

Is possible rewrite ACK contact header in dialog ?

My guess it expecting FQDN.

MS Teams disconnect the call after 20 sec

REASON: Q.850;cause=18;text="bc427610-edae-47b9-9daa-7ea74d40dcc7;Call 
Controller timed out while waiting for acknowledgement."

In this case ACK come from asterisk box.

Opensips Log:

/usr/sbin/opensips[3321]: [IN-DIALOG] [ACK] Contact header ~> 
[

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


Re: [OpenSIPS-Users] OpenSIPS as Teams SBC RTP->SRTP Question

2020-04-18 Thread John Quick
I have written a couple of articles which, between them, should help you
with this question.
The first article looks at WebRTC <--> SIP using rtpengine:
https://kb.smartvox.co.uk/opensips/webrtc-using-opensips-and-rtpengine/
The other one discusses how you configure OpenSIPS 2.2.x for TLS:
https://kb.smartvox.co.uk/opensips/using-tls-in-opensips-v2-2-x/
..in the third paragraph it mentions about SRTP-RTP transcoding with a cross
reference to the first article and with a note about how to adjust the
parameters sent to rtpengine so they will work for SRTP (SAVP) instead of
WebRTC (SAVPF). So together it should provide you with the examples and
explanations you seek.

I have been working on setting up a Teams SBC over the last 2 weeks. I have
it working with calls in both directions and it is using rtpengine exactly
as described in my two articles.
Have you read the blog/knowledgebase article on the opensips web site about
Teams SBC?
https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/

John Quick
Smartvox Limited
Web: www.smartvox.co.uk


>> I see that there is an rtpengine module for OpenSIPS but I could not find
a good example of how this could be used to encrypt the RTP packets as it
passes to teams?
>>
>> Anyone have a working example of this?  Or even better, something already
working with Teams?


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


Re: [OpenSIPS-Users] ms teams ACK

2020-04-18 Thread volga629 via Users

  
  
Thank you for reply,
I fixed Contact header in ACK, but Microsoft still unhappy call drops after 20 sec.
ACK debug

https://paste.centos.org/view/21b816d1
volga629

On 4/18/20 5:54 AM, Johan De Clercq
  wrote:


  
  

  Please find  the necessary manips
in this doc.
  
  
  https://www.oracle.com/webfolder/technetwork/acmepacket/Microsoft/SBC-MSFTTeams-NON-MB.pdf
  
  
  https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/
  
  



Outlook
voor iOS downloaden
  
  
  Van: Users
   namens volga629 via
  Users 
  Verzonden: Saturday, April 18, 2020 3:38:33 AM
  Aan: OpenSIPS users mailling list
  
  Onderwerp: [OpenSIPS-Users] ms teams ACK
 
  
  
Hello Everyone,
Is possible rewrite ACK contact header in dialog ?
My guess it expecting FQDN. 
MS Teams disconnect the call after 20 sec 

REASON: Q.850;cause=18;text="bc427610-edae-47b9-9daa-7ea74d40dcc7;Call Controller timed out while waiting for acknowledgement."

In this case ACK come from asterisk box.  
Opensips Log:
/usr/sbin/opensips[3321]: [IN-DIALOG] [ACK] Contact header ~> [

volga629 
  

  


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


Re: [OpenSIPS-Users] ms teams ACK

2020-04-18 Thread Ovidiu Sas
You don't need to mess with the Contact header (unless you are
connecting NATed endpoints with MS servers).
You need to populate proper Record-Route headers in the initial INVITE
as explained int the blog:
https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/

-ovidiu

On Sat, Apr 18, 2020 at 3:26 PM volga629 via Users
 wrote:
>
> Thank you for reply,
>
> I fixed Contact header in ACK, but Microsoft still unhappy call drops after 
> 20 sec.
>
> ACK debug
>
> https://paste.centos.org/view/21b816d1
>
> volga629
>
> On 4/18/20 5:54 AM, Johan De Clercq wrote:
>
> Please find  the necessary manips in this doc.
>
> https://www.oracle.com/webfolder/technetwork/acmepacket/Microsoft/SBC-MSFTTeams-NON-MB.pdf
>
> https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/
>
>
> Outlook voor iOS downloaden
> 
> Van: Users  namens volga629 via Users 
> 
> Verzonden: Saturday, April 18, 2020 3:38:33 AM
> Aan: OpenSIPS users mailling list 
> Onderwerp: [OpenSIPS-Users] ms teams ACK
>
>
> Hello Everyone,
>
> Is possible rewrite ACK contact header in dialog ?
>
> My guess it expecting FQDN.
>
> MS Teams disconnect the call after 20 sec
>
> REASON: Q.850;cause=18;text="bc427610-edae-47b9-9daa-7ea74d40dcc7;Call 
> Controller timed out while waiting for acknowledgement."
>
> In this case ACK come from asterisk box.
>
> Opensips Log:
>
> /usr/sbin/opensips[3321]: [IN-DIALOG] [ACK] Contact header ~> 
> [
>
> volga629
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



-- 
VoIP Embedded, Inc.
http://www.voipembedded.com

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


Re: [OpenSIPS-Users] ms teams ACK

2020-04-18 Thread volga629 via Users

  
  
Hello Ovidiu,
Thank you for reply
Call flow 

Asterisk <-> Opensips <-> MS Teams 

Call from MS Teams works 100 % include rtp, but to MS teams no. 

I am adding required record routes on INITIAL INVITE, but that
  not enough based on Johan posted docs.
I accommodated proper rewrite of From/To again based on spec doc
  in initial request.
All those parts based on debug doc.
Has to be something changed on Microsoft side.


volga629



volga629
  



On 4/18/20 4:33 PM, Ovidiu Sas wrote:


  You don't need to mess with the Contact header (unless you are
connecting NATed endpoints with MS servers).
You need to populate proper Record-Route headers in the initial INVITE
as explained int the blog:
https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/

-ovidiu

On Sat, Apr 18, 2020 at 3:26 PM volga629 via Users
 wrote:

  

Thank you for reply,

I fixed Contact header in ACK, but Microsoft still unhappy call drops after 20 sec.

ACK debug

https://paste.centos.org/view/21b816d1

volga629

On 4/18/20 5:54 AM, Johan De Clercq wrote:

Please find  the necessary manips in this doc.

https://www.oracle.com/webfolder/technetwork/acmepacket/Microsoft/SBC-MSFTTeams-NON-MB.pdf

https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/


Outlook voor iOS downloaden

Van: Users  namens volga629 via Users 
Verzonden: Saturday, April 18, 2020 3:38:33 AM
Aan: OpenSIPS users mailling list 
Onderwerp: [OpenSIPS-Users] ms teams ACK


Hello Everyone,

Is possible rewrite ACK contact header in dialog ?

My guess it expecting FQDN.

MS Teams disconnect the call after 20 sec

REASON: Q.850;cause=18;text="bc427610-edae-47b9-9daa-7ea74d40dcc7;Call Controller timed out while waiting for acknowledgement."

In this case ACK come from asterisk box.

Opensips Log:

/usr/sbin/opensips[3321]: [IN-DIALOG] [ACK] Contact header ~> [

volga629

___
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] ms teams ACK

2020-04-18 Thread Alexey Vasilyev
Hi volga629,

There were nothing special for ACK. You don't need to change
To/From/Contact. All the necessary steps were in the article
https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/ and for most
people it still works.
So I'm not sure, that MS changed anything, because all the hardware SBCs
should change behaviour, so they need new firmware. SBC vendors should
inform customers to update etc. So this is not so simple process. And it
definitely make no sense for anybody.
And in the test lab for the article I've used absolutely the same
architecture with asterisk, the only difference was RTPEngine to transcode
SRTP-RTP.
And within test lab I've tested not only calls, but transfers worked fine
too.



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] ms teams ACK

2020-04-18 Thread volga629 via Users

  
  
Hello Alexey,
Thank you on reply,
I undone all changes regard headers
changes and MS Teams send BYE directly to asterisk.
  
No Route header present.
But INVITE ACK 183 180 all travel with 
proper routing information.
  

  
2020/04/18 17:54:28.599711
190.109.70.77:5060 -> 190.109.68.250:5060
BYE sip:11988582770@190.109.68.250:5060 SIP/2.0
FROM:
;tag=4d7fb0763c224e39a13a03c669c4b387
TO: ;tag=as41e97ff5
CSEQ: 3 BYE
CALL-ID: 2e6c1a8d2383a4752403e94512ced077@190.109.70.77
MAX-FORWARDS: 69
Via: SIP/2.0/UDP
190.109.70.77:5060;branch=z9hG4bK050e.e400e373.0;i=66c9c603
VIA: SIP/2.0/TLS
52.114.14.70:5061;rport=8208;received=52.114.14.70;branch=z9hG4bK9594cd7
REASON:
Q.850;cause=18;text="fcb37a2a-4bc4-49b6-a5e3-aabddc8f7a22;Call
Controller timed out while waiting for acknowledgement."
CONTACT:

CONTENT-LENGTH: 0
USER-AGENT: Microsoft.PSTNHub.SIPProxy v.2020.4.13.7 i.ASSE.3
ALLOW: INVITE,ACK,OPTIONS,CANCEL,BYE,NOTIFY
  

  
volga629
  


On 4/18/20 5:13 PM, Alexey Vasilyev
  wrote:


  Hi volga629,

There were nothing special for ACK. You don't need to change
To/From/Contact. All the necessary steps were in the article
https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/ and for most
people it still works.
So I'm not sure, that MS changed anything, because all the hardware SBCs
should change behaviour, so they need new firmware. SBC vendors should
inform customers to update etc. So this is not so simple process. And it
definitely make no sense for anybody.
And in the test lab for the article I've used absolutely the same
architecture with asterisk, the only difference was RTPEngine to transcode
SRTP-RTP.
And within test lab I've tested not only calls, but transfers worked fine
too.



-
---
Alexey Vasilyev
--
Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

___
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] ms teams ACK

2020-04-18 Thread Johan De Clercq
Can’t it be a NAT problem? The IP address where the bye is coming from doesn’t 
seem a pstnhub to me.

Outlook voor iOS downloaden

Van: Users  namens volga629 via Users 

Verzonden: Saturday, April 18, 2020 11:01:19 PM
Aan: OpenSIPS users mailling list ; Alexey Vasilyev 

Onderwerp: Re: [OpenSIPS-Users] ms teams ACK


Hello Alexey,

Thank you on reply,

I undone all changes regard headers changes and MS Teams send BYE directly to 
asterisk.

No Route header present.

But INVITE ACK 183 180 all travel with  proper routing information.


2020/04/18 17:54:28.599711 190.109.70.77:5060 -> 190.109.68.250:5060
BYE sip:11988582770@190.109.68.250:5060 SIP/2.0
FROM: 
;tag=4d7fb0763c224e39a13a03c669c4b387
TO: 
;tag=as41e97ff5
CSEQ: 3 BYE
CALL-ID: 
2e6c1a8d2383a4752403e94512ced077@190.109.70.77
MAX-FORWARDS: 69
Via: SIP/2.0/UDP 190.109.70.77:5060;branch=z9hG4bK050e.e400e373.0;i=66c9c603
VIA: SIP/2.0/TLS 
52.114.14.70:5061;rport=8208;received=52.114.14.70;branch=z9hG4bK9594cd7
REASON: Q.850;cause=18;text="fcb37a2a-4bc4-49b6-a5e3-aabddc8f7a22;Call 
Controller timed out while waiting for acknowledgement."
CONTACT: 

CONTENT-LENGTH: 0
USER-AGENT: Microsoft.PSTNHub.SIPProxy v.2020.4.13.7 i.ASSE.3
ALLOW: INVITE,ACK,OPTIONS,CANCEL,BYE,NOTIFY


volga629


On 4/18/20 5:13 PM, Alexey Vasilyev wrote:

Hi volga629,

There were nothing special for ACK. You don't need to change
To/From/Contact. All the necessary steps were in the article
https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/ and for most
people it still works.
So I'm not sure, that MS changed anything, because all the hardware SBCs
should change behaviour, so they need new firmware. SBC vendors should
inform customers to update etc. So this is not so simple process. And it
definitely make no sense for anybody.
And in the test lab for the article I've used absolutely the same
architecture with asterisk, the only difference was RTPEngine to transcode
SRTP-RTP.
And within test lab I've tested not only calls, but transfers worked fine
too.



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

___
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