Re: [asterisk-users] SIP via TCP - new TCP session per call or use same session for multiple calls?

2019-12-27 Thread Greg Troxel
"Joshua C. Colp"  writes:

>> I am curious if the "reuse registration TCP connection" is required by
>> standards or if it is merely obviously good practice.
>>
>> I have had this problem too with asterisk 16.5.0
>>
>> This is not the first recommendation I have seen to use kamailio as a
>> proxy for asterisk, for these sorts of issues as well as clients that
>> change addresses.  Unfortunately the "jsr pc, set_up_kamailo" subroutine
>> call is still executing so I can't say if things work right then...
>>
>
> There is a specification for doing it, but it's not required by the main
> SIP RFC. In fact the main one states that you're supposed to establish an
> outgoing connection to the address in the Contact header. In practice,
> though, this is futile as generally NAT Is in use so you can't connect back
> and thus you reuse the connection. The chan_sip module should do this
> automatically, while chan_pjsip will do this if "rewrite_contact" is set to
> yes.

Thanks.  I read the docs for pjsip (and the book) and failed to grasp
that.  It seems that this should be the default behavior.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Sean Bright

On 12/27/2019 2:56 PM, Jonathan H wrote:

OK, that works - looks like a documentation bug? (Also very confusing!)

Should I report it on the page at 
https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+full+variable or 
on the main tracker?


These wiki pages are automatically generated from the source code[1], so 
the best place would be the Asterisk Issues Tracker[2]. Even better 
would be to attach a patch to the issue you create which beefs up the 
documentation to your liking.


Kind regards,
Sean

[1] https://github.com/asterisk/asterisk/blob/17/res/res_agi.c#L321-L341
[2] https://issues.asterisk.org/


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Jonathan H
OK, that works - looks like a documentation bug? (Also very confusing!)

Should I report it on the page at
https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+full+variable
or
on the main tracker?

Many thanks - couldn't figure out what was wrong!

On Fri, 27 Dec 2019 at 19:36, Sean Bright  wrote:

> On 12/27/2019 2:24 PM, Jonathan H wrote:
> > AGI Rx << SET VARIABLE myVar "Hello
> > World!!!"
> > AGI Tx >> 200 result=1
> > AGI Rx << GET FULL VARIABLE myVar
> > AGI Tx >> 200 result=1 (myVar)
> >
> > Is this a bug, poor documentation, or my poor understanding of them?
>
> I believe the syntax you are looking for is:
>
>  GET FULL VARIABLE ${myVar}
>
> Kind regards,
> Sean
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Sean Bright

On 12/27/2019 2:24 PM, Jonathan H wrote:
AGI Rx << SET VARIABLE myVar "Hello 
World!!!"

AGI Tx >> 200 result=1
AGI Rx << GET FULL VARIABLE myVar
AGI Tx >> 200 result=1 (myVar)

Is this a bug, poor documentation, or my poor understanding of them?


I believe the syntax you are looking for is:

    GET FULL VARIABLE ${myVar}

Kind regards,
Sean

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Jonathan H
Just trying out a node agi package (https://github.com/sergey12313/ts-agi/ ,
and it wasn't behaving as I expected, but when turning on agi debug, it
looks like it might be Asterisk (using 17.1.0)

This works as expected

AGI Rx << SET VARIABLE myVar "Hello World!!!"
AGI Tx >> 200 result=1
AGI Rx << GET VARIABLE myVar
AGI Tx >> 200 result=1 (Hello World!!!)

But  GET FULL VARIABLE just returns the NAME of the variable

AGI Rx << SET VARIABLE myVar "Hello World!!!"
AGI Tx >> 200 result=1
AGI Rx << GET FULL VARIABLE myVar
AGI Tx >> 200 result=1 (myVar)

Is this a bug, poor documentation, or my poor understanding of them?

https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+full+variable
GET FULL VARIABLE VARIABLENAME CHANNEL NAME
Example return code: 200 result=1 (testvariable)

https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+variable
GET VARIABLE VARIABLENAME
Example return code: 200 result=1 (testvariable)
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] SIP via TCP - new TCP session per call or use same session for multiple calls?

2019-12-27 Thread Joshua C. Colp
On Fri, Dec 27, 2019 at 2:00 PM Greg Troxel  wrote:

> Dovid Bender  writes:
>
> > So long as the tcp socket is open your SBC should send the call back over
> > the same socket. Now it can be that your SBC is seeing the socket as
> > timing out. If you are using Kamailio you can have it send tcp keep
> alives
> > every so often so that the socket stays up.
>
> SBC?
>
> I am curious if the "reuse registration TCP connection" is required by
> standards or if it is merely obviously good practice.
>
> I have had this problem too with asterisk 16.5.0
>
> This is not the first recommendation I have seen to use kamailio as a
> proxy for asterisk, for these sorts of issues as well as clients that
> change addresses.  Unfortunately the "jsr pc, set_up_kamailo" subroutine
> call is still executing so I can't say if things work right then...
>

There is a specification for doing it, but it's not required by the main
SIP RFC. In fact the main one states that you're supposed to establish an
outgoing connection to the address in the Contact header. In practice,
though, this is futile as generally NAT Is in use so you can't connect back
and thus you reuse the connection. The chan_sip module should do this
automatically, while chan_pjsip will do this if "rewrite_contact" is set to
yes.

-- 
Joshua C. Colp
Asterisk Technical Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Handling a non-responsive peer after it answers

2019-12-27 Thread Joshua C. Colp
On Fri, Dec 27, 2019 at 12:02 PM David P  wrote:

>
> I'm looking for a way of detecting in my dialplan when a peer becomes
> non-responsive after answering. It seems that Asterisk knows when the peer
> becomes non-responsive because it logs "Remote UNIX connection
> disconnected" around the same time, and it seems that
> if there is no following "Remote UNIX connection" within a short time,
> then the peer can be considered non-responsive. Is there a way to configure
> a handler for this state?
>
> We use v14.7.6 and we dial the peer this way:
>
>  same =>
> n,Set(CHANNEL(hangup_handler_push)=${CONTEXT},handleHangupByCaller,1(args))
>  same =>
> n,Dial(${AddressToReachPeer},2,b(${CONTEXT}^afterDialingPeerLogIpOfCb^1(${UUID}^${StartEpoch})))
>  same => n,Goto(handle${DIALSTATUS},1)
>

The referenced message is not related to the call at all. It occurs when an
"asterisk -r" console disconnects. As for hanging up a call when the remote
goes away that depends on the channel driver. For SIP both chan_sip and
chan_pjsip provide session timers which use SIP messages to determine if
the call is no longer valid, or RTP timeout which hangs up the call if
media is not flowing for a period of time. These are configured in the
respective channel driver configuration file.

-- 
Joshua C. Colp
Asterisk Technical Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] SIP via TCP - new TCP session per call or use same session for multiple calls?

2019-12-27 Thread Greg Troxel
Dovid Bender  writes:

> So long as the tcp socket is open your SBC should send the call back over
> the same socket. Now it can be that your SBC is seeing the socket as
> timing out. If you are using Kamailio you can have it send tcp keep alives
> every so often so that the socket stays up.

SBC?

I am curious if the "reuse registration TCP connection" is required by
standards or if it is merely obviously good practice.

I have had this problem too with asterisk 16.5.0

This is not the first recommendation I have seen to use kamailio as a
proxy for asterisk, for these sorts of issues as well as clients that
change addresses.  Unfortunately the "jsr pc, set_up_kamailo" subroutine
call is still executing so I can't say if things work right then...


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] SIP via TCP - new TCP session per call or use same session for multiple calls?

2019-12-27 Thread Dovid Bender
So long as the tcp socket is open your SBC should send the call back over
the same socket. Now it can be that your SBC is seeing the socket as
timing out. If you are using Kamailio you can have it send tcp keep alives
every so often so that the socket stays up.



On Fri, Dec 27, 2019 at 10:41 AM Benoit Panizzon 
wrote:

> Hi List
>
> I wonder how SIP via TCP is supposed to work. Not realy Asterisk
> related, but I hope you experts might be able to help out :-)
>
> One of our customers has a SIP device registering via a complex NAT. To
> benefit from TCP Connection Tracking, he choose TCP instead of UDP.
>
> So he expected, that an incoming call would be sent back to him on the
> already open TCP connection, making it easy to get through that NAT.
>
> This is not the case. Our SBC is attempting to initiate a new SIP TCP
> connection towards the NAT Firewall of the customer thus getting
> dropped because this is not the outgoing established connection opened
> during the registration.
>
> So, how should SIP via TCP work? Should one TCP session be used for all
> signaling of potentially multiple concurrent calls, as expected by our
> customer. Or is it usual to make one TCP session per call as observed?
>
> Mit freundlichen Grüssen
>
> -Benoît Panizzon-
> --
> I m p r o W a r e   A G-Leiter Commerce Kunden
> __
>
> Zurlindenstrasse 29 Tel  +41 61 826 93 00
> CH-4133 PrattelnFax  +41 61 826 93 01
> Schweiz Web  http://www.imp.ch
> __
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Handling a non-responsive peer after it answers

2019-12-27 Thread David P
I'm looking for a way of detecting in my dialplan when a peer becomes
non-responsive after answering. It seems that Asterisk knows when the peer
becomes non-responsive because it logs "Remote UNIX connection
disconnected" around the same time, and it seems that
if there is no following "Remote UNIX connection" within a short time, then
the peer can be considered non-responsive. Is there a way to configure a
handler for this state?

We use v14.7.6 and we dial the peer this way:

 same =>
n,Set(CHANNEL(hangup_handler_push)=${CONTEXT},handleHangupByCaller,1(args))
 same =>
n,Dial(${AddressToReachPeer},2,b(${CONTEXT}^afterDialingPeerLogIpOfCb^1(${UUID}^${StartEpoch})))
 same => n,Goto(handle${DIALSTATUS},1)

Cheers,
David
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] SIP via TCP - new TCP session per call or use same session for multiple calls?

2019-12-27 Thread Benoit Panizzon
Hi List

I wonder how SIP via TCP is supposed to work. Not realy Asterisk
related, but I hope you experts might be able to help out :-)

One of our customers has a SIP device registering via a complex NAT. To
benefit from TCP Connection Tracking, he choose TCP instead of UDP.

So he expected, that an incoming call would be sent back to him on the
already open TCP connection, making it easy to get through that NAT.

This is not the case. Our SBC is attempting to initiate a new SIP TCP
connection towards the NAT Firewall of the customer thus getting
dropped because this is not the outgoing established connection opened
during the registration.

So, how should SIP via TCP work? Should one TCP session be used for all
signaling of potentially multiple concurrent calls, as expected by our
customer. Or is it usual to make one TCP session per call as observed?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users