Re: [asterisk-users] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
FWIW, I added the following after the Dial, and it doesn't appear in cli
after peer hangup:

same => n,NoOp(After Dial ${AddressToReachPeer})

I also tried putting 'g' before the 'b'.

I also tried removing the context headers of the hangup handlers and
predial handler, and just referring to those by extensions. No difference.

On Tue, Jun 5, 2018 at 3:17 PM, David P  wrote:

> This has been super-helpful, Eric. However, the handleHangupByPeer priorities
> below are still not run when the peer hangs-up. The last line in the cli
> when the peer hangs-up is still:
> Strict RTP learning complete - Locking on source address
> (Although sometimes there is also: Retransmission timeout reached on
> transmission)
>
>  same => 
> n(callPeer),Set(GLOBAL(CB${IndexIntoPeers}CurrentCallsCount)=$[${PeerCurrentCallsCount}
> + 1])
>  ; Ensure that hangup by caller/inbound-channel will invoke
> handleHangupByCaller.
>  same => n,Set(CHANNEL(hangup_handler_push)=handleHangupByCaller,s,
> 1(args))
>  same => n,Set(AddressToReachPeer=SIP/${EXTEN:0:4}@${PeerBeingConsidered})
>  ; Ensure that the channel of the peer (i.e. outbound-channel) is
> configured with hangup handler.
>  same => n,Dial(${AddressToReachPeer},,b(beforeDialingPeerConfigureItsC
> hannelForPeerHangupHandling^s^1))
>  same => n,Hangup
>
> [beforeDialingPeerConfigureItsChannelForPeerHangupHandling]
> exten => s,1,Set(CHANNEL(hangup_handler_push)=
> handleHangupByPeer,s,1(args))
>  same => n,Return
>
> [handleHangupByPeer]
>  ; Ensure that GLOBAL(CB${IndexIntoPeers}CurrentCallsCount) is
> decremented after hangup, and end-of-call-epoch is set.
> exten => s,1,NoOp(${PeerBeingConsidered} peer channel: Entered
> handleHangupByCallerOrPeer Calls ${CB${IndexIntoPeers}CurrentCallsCount})
>  same => n,Set(GLOBAL(CB${IndexIntoPeers}CurrentCallsCount)=$[${CB${
> IndexIntoPeers}CurrentCallsCount} - 1])
>  same => n,Set(GLOBAL(${PeerBeingConsidered}EpochAtCallEnd)=${EPOCH})
>  same => n,Return
>
> [handleHangupByCaller]
>  ; Ensure that GLOBAL(CB${IndexIntoPeers}CurrentCallsCount) is
> decremented after hangup, and end-of-call-epoch is set.
> exten => s,1,NoOp(${PeerBeingConsidered} caller channel: Entered
> handleHangupByCallerOrPeer Calls ${CB${IndexIntoPeers}CurrentCallsCount})
>  same => n,Set(GLOBAL(CB${IndexIntoPeers}CurrentCallsCount)=$[${CB${
> IndexIntoPeers}CurrentCallsCount} - 1])
>  same => n,Set(GLOBAL(${PeerBeingConsidered}EpochAtCallEnd)=${EPOCH})
>  same => n,Return
>
>
> When the caller hangs-up, handleHangupByCaller is run first, then 
> handleHangupByPeer
> runs. (And strangely, the value of global CB${IndexIntoPeers}CurrentCallsCount
> isn't accessible in handleHangupByPeer.)
>
> Cheers,
> David
>
>
> On Tue, Jun 5, 2018 at 12:58 PM, Eric Wieling  wrote:
>
>> Don't use the _. pattern.  Ever.
>>
>> The call has two channels so it needs two hangup handlers, something like
>> this, though I've not tested it.
>>
>> [some_context]
>> exten => _X.,1,Noop
>>  same => n,Set(CHANNEL(hangup_handler_push)=my_caller_hangup_handler)
>>  same => n,Dial(SIP/number@peer,b(pre_dial^s^1))
>>  same => n,Hangup
>>
>> [pre_dial]
>> exten => s,1,Set(CHANNEL(hangup_handler_push)=my_called_hangup_handler)
>>  same => Return
>>
>> See: https://wiki.asterisk.org/wiki/display/AST/Pre-Dial+Handlers
>> and https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers
>>
>>
-- 
_
-- 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] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
This has been super-helpful, Eric. However, the handleHangupByPeer priorities
below are still not run when the peer hangs-up. The last line in the cli
when the peer hangs-up is still:
Strict RTP learning complete - Locking on source address
(Although sometimes there is also: Retransmission timeout reached on
transmission)

 same =>
n(callPeer),Set(GLOBAL(CB${IndexIntoPeers}CurrentCallsCount)=$[${PeerCurrentCallsCount}
+ 1])
 ; Ensure that hangup by caller/inbound-channel will invoke
handleHangupByCaller.
 same => n,Set(CHANNEL(hangup_handler_push)=handleHangupByCaller,s,1(args))
 same => n,Set(AddressToReachPeer=SIP/${EXTEN:0:4}@${PeerBeingConsidered})
 ; Ensure that the channel of the peer (i.e. outbound-channel) is
configured with hangup handler.
 same =>
n,Dial(${AddressToReachPeer},,b(beforeDialingPeerConfigureItsChannelForPeerHangupHandling^s^1))
 same => n,Hangup

[beforeDialingPeerConfigureItsChannelForPeerHangupHandling]
exten => s,1,Set(CHANNEL(hangup_handler_push)=handleHangupByPeer,s,1(args))
 same => n,Return

[handleHangupByPeer]
 ; Ensure that GLOBAL(CB${IndexIntoPeers}CurrentCallsCount) is decremented
after hangup, and end-of-call-epoch is set.
exten => s,1,NoOp(${PeerBeingConsidered} peer channel: Entered
handleHangupByCallerOrPeer Calls ${CB${IndexIntoPeers}CurrentCallsCount})
 same =>
n,Set(GLOBAL(CB${IndexIntoPeers}CurrentCallsCount)=$[${CB${IndexIntoPeers}CurrentCallsCount}
- 1])
 same => n,Set(GLOBAL(${PeerBeingConsidered}EpochAtCallEnd)=${EPOCH})
 same => n,Return

[handleHangupByCaller]
 ; Ensure that GLOBAL(CB${IndexIntoPeers}CurrentCallsCount) is decremented
after hangup, and end-of-call-epoch is set.
exten => s,1,NoOp(${PeerBeingConsidered} caller channel: Entered
handleHangupByCallerOrPeer Calls ${CB${IndexIntoPeers}CurrentCallsCount})
 same =>
n,Set(GLOBAL(CB${IndexIntoPeers}CurrentCallsCount)=$[${CB${IndexIntoPeers}CurrentCallsCount}
- 1])
 same => n,Set(GLOBAL(${PeerBeingConsidered}EpochAtCallEnd)=${EPOCH})
 same => n,Return


When the caller hangs-up, handleHangupByCaller is run first, then
handleHangupByPeer
runs. (And strangely, the value of global CB${IndexIntoPeers}CurrentCallsCount
isn't accessible in handleHangupByPeer.)

Cheers,
David


On Tue, Jun 5, 2018 at 12:58 PM, Eric Wieling  wrote:

> Don't use the _. pattern.  Ever.
>
> The call has two channels so it needs two hangup handlers, something like
> this, though I've not tested it.
>
> [some_context]
> exten => _X.,1,Noop
>  same => n,Set(CHANNEL(hangup_handler_push)=my_caller_hangup_handler)
>  same => n,Dial(SIP/number@peer,b(pre_dial^s^1))
>  same => n,Hangup
>
> [pre_dial]
> exten => s,1,Set(CHANNEL(hangup_handler_push)=my_called_hangup_handler)
>  same => Return
>
> See: https://wiki.asterisk.org/wiki/display/AST/Pre-Dial+Handlers
> and https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers
>
>
-- 
_
-- 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] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread Eric Wieling

Don't use the _. pattern.  Ever.

The call has two channels so it needs two hangup handlers, something 
like this, though I've not tested it.


[some_context]
exten => _X.,1,Noop
 same => n,Set(CHANNEL(hangup_handler_push)=my_caller_hangup_handler)
 same => n,Dial(SIP/number@peer,b(pre_dial^s^1))
 same => n,Hangup

[pre_dial]
exten => s,1,Set(CHANNEL(hangup_handler_push)=my_called_hangup_handler)
 same => Return

See: https://wiki.asterisk.org/wiki/display/AST/Pre-Dial+Handlers
and https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers


On 06/05/2018 03:37 PM, David P wrote:
Thanks, Eric. I just tried a hangup handler, but it's showing a similar 
problem: When the peer hangs-up, the hangup handler is not invoked and 
the caller channel remains open.


  same => 
n(callPeer),Set(GLOBAL(Peer${IndexIntoPeers}CurrentCallsCount)=$[${PeerCurrentCallsCount} 
+ 1])
  same => 
n,Set(CHANNEL(hangup_handler_push)=handleHangupByCallerOrPeer,doesntMatter,1(args))

  same => n,Set(DialForPeer=SIP/${EXTEN:0:4}@${PeerBeingConsidered})
  same => n,Dial(${DialForPeer})
  same => n,Hangup()
[handleHangupByCallerOrPeer]
exten => _.,1,NoOp(${PeerBeingConsidered}: Entered 
handleHangupByCallerOrPeer Calls ${Peer${IndexIntoPeers}CurrentCallsCount})
  same => 
n,Set(GLOBAL(Peer${IndexIntoPeers}CurrentCallsCount)=$[${Peer${IndexIntoPeers}CurrentCallsCount} 
- 1])

  same => n,Set(GLOBAL(${PeerBeingConsidered}EpochAtCallEnd)=${EPOCH})
  same => n,Return()

I've also tried replacing the Dial above with:

  same => n,Dial(${DialForPeer},,g)

Cheers,
David

On Tue, Jun 5, 2018 at 7:38 AM, Eric Wieling > wrote:


Use hangup handlers, they work around the issues with the 'h' extension.

On 06/05/2018 05:33 AM, David P wrote:

Thanks, Anthony.

I added both 'g' and 'F' options. Now, when the caller hangs-up,
my cleanup code is run by both the caller channel and the peer
channel, but I only want the caller channel to do that.

Also, when the peer hangs-up, there is no execution of the
priorities following the Dial.

Finally, is there a way to reset all globals, maybe as a variant
of "dialplan reload"?

On Tue, Jun 5, 2018 at 1:21 AM, Antony Stone
mailto:antony.st...@asterisk.open.source.it>
>> wrote:

     On Tuesday 05 June 2018 at 08:33:26, David P wrote:

     > We're using Asterisk 14.7.6 and I have a dialplan that
ends like this:
     >     >  same => n,Dial(SIP/${EXTEN:0:4}@peer1)
     >  same => n,Set(GLOBAL(EpochAtCallEnd)=${EPOCH})
     >  same => n,Hangup()
     >     > When peer1 hangsup, the priorities after the Dial
are executed fine. But
     > when the caller hangsup during the Dial, the cleanup
steps aren't done.
     > Why?
     >     > I did read "Note that on a successful connection,
in the absence of the g
     > and G modifiers (below), the Dial command does not return
to allow
     > execution of further commands for that extension in that
context." at
     > https://www.voip-info.org/asterisk-cmd-dial/

     > But it seems not
to apply
     > because I'm seeing the 'g' behavior without specifying
that option, and the
     > 'G' option seems intended for a far more complicated
scenario.

     If you're getting "g" functionality without specifying it,
     congratulations.

     If you want something similar when the callER hangs up, you
want to
     use the F
     option.

     Regards,


     Antony.




-- 
http://help.nyigc.net/







--
http://help.nyigc.net/

--
_
-- 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] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
Thanks, Eric. I just tried a hangup handler, but it's showing a similar
problem: When the peer hangs-up, the hangup handler is not invoked and the
caller channel remains open.

 same =>
n(callPeer),Set(GLOBAL(Peer${IndexIntoPeers}CurrentCallsCount)=$[${PeerCurrentCallsCount}
+ 1])
 same =>
n,Set(CHANNEL(hangup_handler_push)=handleHangupByCallerOrPeer,doesntMatter,1(args))
 same => n,Set(DialForPeer=SIP/${EXTEN:0:4}@${PeerBeingConsidered})
 same => n,Dial(${DialForPeer})
 same => n,Hangup()

[handleHangupByCallerOrPeer]
exten => _.,1,NoOp(${PeerBeingConsidered}: Entered
handleHangupByCallerOrPeer Calls ${Peer${IndexIntoPeers}CurrentCallsCount})
 same =>
n,Set(GLOBAL(Peer${IndexIntoPeers}CurrentCallsCount)=$[${Peer${IndexIntoPeers}CurrentCallsCount}
- 1])
 same => n,Set(GLOBAL(${PeerBeingConsidered}EpochAtCallEnd)=${EPOCH})
 same => n,Return()

I've also tried replacing the Dial above with:

 same => n,Dial(${DialForPeer},,g)

Cheers,
David

On Tue, Jun 5, 2018 at 7:38 AM, Eric Wieling  wrote:

> Use hangup handlers, they work around the issues with the 'h' extension.
>
> On 06/05/2018 05:33 AM, David P wrote:
>
>> Thanks, Anthony.
>>
>> I added both 'g' and 'F' options. Now, when the caller hangs-up, my
>> cleanup code is run by both the caller channel and the peer channel, but I
>> only want the caller channel to do that.
>>
>> Also, when the peer hangs-up, there is no execution of the priorities
>> following the Dial.
>>
>> Finally, is there a way to reset all globals, maybe as a variant of
>> "dialplan reload"?
>>
>> On Tue, Jun 5, 2018 at 1:21 AM, Antony Stone <
>> antony.st...@asterisk.open.source.it > open.source.it>> wrote:
>>
>> On Tuesday 05 June 2018 at 08:33:26, David P wrote:
>>
>> > We're using Asterisk 14.7.6 and I have a dialplan that ends like
>> this:
>> > >  same => n,Dial(SIP/${EXTEN:0:4}@peer1)
>> >  same => n,Set(GLOBAL(EpochAtCallEnd)=${EPOCH})
>> >  same => n,Hangup()
>> > > When peer1 hangsup, the priorities after the Dial are
>> executed fine. But
>> > when the caller hangsup during the Dial, the cleanup steps aren't
>> done.
>> > Why?
>> > > I did read "Note that on a successful connection, in the
>> absence of the g
>> > and G modifiers (below), the Dial command does not return to allow
>> > execution of further commands for that extension in that context."
>> at
>> > https://www.voip-info.org/asterisk-cmd-dial/
>>  But it seems not to
>> apply
>> > because I'm seeing the 'g' behavior without specifying that option,
>> and the
>> > 'G' option seems intended for a far more complicated scenario.
>>
>> If you're getting "g" functionality without specifying it,
>> congratulations.
>>
>> If you want something similar when the callER hangs up, you want to
>> use the F
>> option.
>>
>> Regards,
>>
>>
>> Antony.
>>
>>
>>
>>
> --
> http://help.nyigc.net/
>
-- 
_
-- 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] remove

2018-06-05 Thread Matt Fredrickson
Check the footer at the bottom of this message for instructions on how
to unsubscribe :-)

Matthew Fredrickson

On Fri, Jun 1, 2018 at 12:11 PM, David Mutterer  wrote:
>
> --
> _
> -- 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



-- 
Matthew Fredrickson
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA

-- 
_
-- 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] remove

2018-06-05 Thread David Mutterer

-- 
_
-- 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] Certified Asterisk 13.21-cert1 Now Available

2018-06-05 Thread Asterisk Development Team
The Asterisk Development Team would like to announce the release of Certified 
Asterisk 13.21-cert1.
This release is available for immediate download at
http://downloads.asterisk.org/pub/telephony/certified-asterisk

The release of Certified Asterisk 13.21-cert1 resolves several issues reported 
by the
community and would have not been possible without your participation.

Thank you!

The following issues are resolved in this release:

Security bugs fixed in this release:
---
 * ASTERISK-27583 - Segmentation fault occurs in asterisk with
  an invalid SDP fmtp attribute
  (Reported by Sandro Gauci)
 * ASTERISK-27582 - Segmentation fault occurs in Asterisk with
  an invalid SDP media format description
  (Reported by
  Sandro Gauci)
 * ASTERISK-27618 - Crash occurs when sending a repeated number
  of INVITE messages over TCP or TLS transport
  (Reported by
  Sandro Gauci)
 * ASTERISK-27640 - SUBSCRIBE message with a large Accept value
  causes stack corruption
  (Reported by Sandro Gauci)

New Features made in this release:
---
 * ASTERISK-27704 - Add cache_pools debug option to
  pjproject.conf
  (Reported by Richard Mudgett)
 * ASTERISK-27117 - core: Add support for timelen parsing to
  ast_parse_arg and ACO.
  (Reported by Corey Farrell)
 * ASTERISK-27478 - PJSIP: Add CHANNEL(pjsip,request_uri) to get
  incoming INVITE Request-URI.
  (Reported by Richard Mudgett)
 * ASTERISK-27413 - Add cache_media_frames debugging option.
   
  (Reported by Richard Mudgett)
 * ASTERISK-27206 - res_pjsip: No mechanism exists to limit
  endpoint identification to IP only
  (Reported by Ben
  Merrills)

Bugs fixed in this release:
---
 * ASTERISK-27861 - [patch] res_pjsip_endpoint_identifier_ip:
  Unregister the module for headers.
  (Reported by Alexander
  Traud)
 * ASTERISK-27860 - [patch] res_pjsip: Register
  pjsip_transport_management not externally but internally.
 
  (Reported by Alexander Traud)
 * ASTERISK-27809 - [patch] utils/pval: Add -lBlocksRuntime for
  compiler clang conditionally.
  (Reported by Alexander
  Traud)
 * ASTERISK-27774 - res_musiconhold: Music on hold restarts
  after every announcement
  (Reported by lvl)
 * ASTERISK-27782 - cdr_mysql: Missing MYSQL_PORT definition
   
  (Reported by Evandro César Arruda)
 * ASTERISK-27614 - res_pjsip_session: SDP origin does not use
  resolved address
  (Reported by John M.)
 * ASTERISK-27740 - chan_sip: New Channel creation from new SIP
  dialog with Replaces failed to be properly tracked and
  destroyed
  (Reported by Shannon Price)
 * ASTERISK-27706 - PJSIP: Deadlock shutting down subscription
  TCP connection and sending subscription message.
  (Reported
  by Ross Beer)
 * ASTERISK-27435 - [patch] configure:
  pjsip_evsub_set_uas_timeout not found.
  (Reported by
  Alexander Traud)
 * ASTERISK-27761 - [patch] BuildSystem: With external editline,
  do not require libs for internal editline.
  (Reported by
  Alexander Traud)
 * ASTERISK-27755 - ConfBridge: raise ConfbridgeTalking when put
  on hold and clear talking status
  (Reported by Kevin
  Harwell)
 * ASTERISK-27688 - res_pjsip: Crash on TCP PJSIP Transport
  Disconnect
  (Reported by Ross Beer)
 * ASTERISK-27743 - Generic PLC doesn't work if the 2 codecs on
  a channel are equal
  (Reported by George Joseph)
 * ASTERISK-27745 - [patch] BuildSystem: Remove unused
  dependency on libltdl.
  (Reported by Alexander Traud)
 * ASTERISK-12841 - [patch] Make format_ogg_vorbis work on
  OpenBSD
  (Reported by Michiel van Baak)
 * ASTERISK-27720 - [patch] BuildSystem: Enable Advanced Linux
  Sound Architecture (ALSA) in NetBSD.
  (Reported by
  Alexander Traud)
 * ASTERISK-27741 - res_pjsip_rfc3326.c
  rfc3326_use_reason_header doesn't account for more than one
  'Reason' header
  (Reported by Ross Beer)
 * ASTERISK-27734 - [patch] BuildSystem: Enable IMAP storage on
  openSUSE and Arch Linux.
  (Reported by Alexander Traud)
 * ASTERISK-27733 - [patch] res_srtp: Add support for libsrtp2.x
  on openSUSE.
  (Reported by Alexander Traud)
 * ASTERISK-11015 - NetBSD Build Needs RPATH set in 1.2.25
 
  (Reported by Curt Sampson)
 * ASTERISK-27641 - BuildSystem: Enable Better Backtraces in
  FreeBSD.
  (Reported by Alexander Traud)
 * ASTERISK-25586 - uuid_generate_random detection failure
 
  (Reported by John Nemeth)
 * ASTERISK-27721 - [patch] BuildSystem: Enable PortAudio in
  NetBSD.
  (Reported by Alexander Traud)
 * ASTERISK-27715 - [patch] BuildSystem: AC_PATH_PROG sets to
  colon character when not found.
  (Reported by Alexander
  Traud)
 * ASTERISK-27703 - AMI Action VoicemailUsersList returns 0
  

Re: [asterisk-users] Questions about SIP From, P-Asserted-Id fields and Diversion headers ?

2018-06-05 Thread George Joseph
On Tue, Jun 5, 2018 at 10:59 AM Olivier  wrote:

>
>
> 2018-06-05 15:27 GMT+02:00 George Joseph :
> Thank  you very much, George for replying.
>
>>
>>
>> On Tue, Jun 5, 2018 at 3:35 AM Olivier  wrote:
>>
>>> Hi,
>>>
>>> After a long discussion with a friend, I would like to ask here:
>>>
>>> 1.According SIP RFCs, is possible/recommended to have different values
>>> in From and P-Asserted-Id fields ?
>>> For instance, From field showing 123456789 and P-Asserted-Id showing
>>> 987654321 (beside privacy considerations) ?
>>>
>>
>> Possible? yes absolutely.
>>
>
> How would you then configure both headers, respectively ?
>
> From memory, in previous testings, whenever  CALLERID was set to WHATEVER,
> P-Asserted-Id was also set to WHATEVER and vice versa, so that I inferred
> from this that P-Asserted-Id was meant for Privacy considerations and
> nothing else (see [1])
>

PAI should be used to indicate the calling party's identification
regardless of privacy concerns.  In the dialplan you can use the CALLERPRES
function to control privacy on a call by call basis.




>
>
> [1]
> https://www.voip-info.org/p-asserted-identity-and-remote-party-id-header/
>
>
>> Recommended? who knows?  Implementations are all over the place.  I've
>> always thought of the From header as identifying the user agent making the
>> request which kinda agrees with RFC3261.   The PAI header should contain
>> the identity of the original caller.
>>
>>
>>>
>>> 2. When Bob forwards to Cory a call coming from Alice, would expect
>>> Diversion/History-Info header to include Alice's number ?
>>>
>>
>> No.  The diversion header shows who the diverter is.
>> https://tools.ietf.org/html/rfc5806
>>
>>
>>
>>
>>>
>>> Best regards
>>> --
>>> _
>>> -- 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
>>
>>
>>
>> --
>> George Joseph
>> Digium, Inc. | Software Developer
>> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
>> Check us out at: www.digium.com & 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
>>
>
> --
> _
> -- 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



-- 
George Joseph
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & 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] Questions about SIP From, P-Asserted-Id fields and Diversion headers ?

2018-06-05 Thread Olivier
2018-06-05 15:27 GMT+02:00 George Joseph :
Thank  you very much, George for replying.

>
>
> On Tue, Jun 5, 2018 at 3:35 AM Olivier  wrote:
>
>> Hi,
>>
>> After a long discussion with a friend, I would like to ask here:
>>
>> 1.According SIP RFCs, is possible/recommended to have different values in
>> From and P-Asserted-Id fields ?
>> For instance, From field showing 123456789 and P-Asserted-Id showing
>> 987654321 (beside privacy considerations) ?
>>
>
> Possible? yes absolutely.
>

How would you then configure both headers, respectively ?

>From memory, in previous testings, whenever  CALLERID was set to WHATEVER,
P-Asserted-Id was also set to WHATEVER and vice versa, so that I inferred
from this that P-Asserted-Id was meant for Privacy considerations and
nothing else (see [1])


[1]
https://www.voip-info.org/p-asserted-identity-and-remote-party-id-header/


> Recommended? who knows?  Implementations are all over the place.  I've
> always thought of the From header as identifying the user agent making the
> request which kinda agrees with RFC3261.   The PAI header should contain
> the identity of the original caller.
>
>
>>
>> 2. When Bob forwards to Cory a call coming from Alice, would expect
>> Diversion/History-Info header to include Alice's number ?
>>
>
> No.  The diversion header shows who the diverter is.
> https://tools.ietf.org/html/rfc5806
>
>
>
>
>>
>> Best regards
>> --
>> _
>> -- 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
>
>
>
> --
> George Joseph
> Digium, Inc. | Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
> Check us out at: www.digium.com & 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
>
-- 
_
-- 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] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread Eric Wieling

Use hangup handlers, they work around the issues with the 'h' extension.

On 06/05/2018 05:33 AM, David P wrote:

Thanks, Anthony.

I added both 'g' and 'F' options. Now, when the caller hangs-up, my 
cleanup code is run by both the caller channel and the peer channel, but 
I only want the caller channel to do that.


Also, when the peer hangs-up, there is no execution of the priorities 
following the Dial.


Finally, is there a way to reset all globals, maybe as a variant of 
"dialplan reload"?


On Tue, Jun 5, 2018 at 1:21 AM, Antony Stone 
> wrote:


On Tuesday 05 June 2018 at 08:33:26, David P wrote:

> We're using Asterisk 14.7.6 and I have a dialplan that ends like this:
> 
>  same => n,Dial(SIP/${EXTEN:0:4}@peer1)

>  same => n,Set(GLOBAL(EpochAtCallEnd)=${EPOCH})
>  same => n,Hangup()
> 
> When peer1 hangsup, the priorities after the Dial are executed fine. But

> when the caller hangsup during the Dial, the cleanup steps aren't done.
> Why?
> 
> I did read "Note that on a successful connection, in the absence of the g

> and G modifiers (below), the Dial command does not return to allow
> execution of further commands for that extension in that context." at
> https://www.voip-info.org/asterisk-cmd-dial/
 But it seems not to apply
> because I'm seeing the 'g' behavior without specifying that option, and 
the
> 'G' option seems intended for a far more complicated scenario.

If you're getting "g" functionality without specifying it,
congratulations.

If you want something similar when the callER hangs up, you want to
use the F
option.

Regards,


Antony.





--
http://help.nyigc.net/

--
_
-- 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] Questions about SIP From, P-Asserted-Id fields and Diversion headers ?

2018-06-05 Thread George Joseph
On Tue, Jun 5, 2018 at 3:35 AM Olivier  wrote:

> Hi,
>
> After a long discussion with a friend, I would like to ask here:
>
> 1.According SIP RFCs, is possible/recommended to have different values in
> From and P-Asserted-Id fields ?
> For instance, From field showing 123456789 and P-Asserted-Id showing
> 987654321 (beside privacy considerations) ?
>

Possible? yes absolutely.  Recommended? who knows?  Implementations are all
over the place.  I've always thought of the From header as identifying the
user agent making the request which kinda agrees with RFC3261.   The PAI
header should contain the identity of the original caller.


>
> 2. When Bob forwards to Cory a call coming from Alice, would expect
> Diversion/History-Info header to include Alice's number ?
>

No.  The diversion header shows who the diverter is.
https://tools.ietf.org/html/rfc5806




>
> Best regards
> --
> _
> -- 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



-- 
George Joseph
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & 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] Questions about SIP From, P-Asserted-Id fields and Diversion headers ?

2018-06-05 Thread Daniel Tryba
On Tue, Jun 05, 2018 at 11:34:51AM +0200, Olivier wrote:
> 1.According SIP RFCs, is possible/recommended to have different values in
> From and P-Asserted-Id fields ?
> For instance, From field showing 123456789 and P-Asserted-Id showing
> 987654321 (beside privacy considerations) ?

Yes, most obviuos need for PAI is a call where anonimity is desired by
caller. Set the From to anonymous@anonymous.invalid and PAI to a real
user if the destination is trusted, any proxy that handles this message
that doesn't trust a destination will strip PAI thus ensuring privacy.
 
> 2. When Bob forwards to Cory a call coming from Alice, would expect
> Diversion/History-Info header to include Alice's number ?

No, diversion/history should contain Bob.

-- 
_
-- 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] Questions about SIP From, P-Asserted-Id fields and Diversion headers ?

2018-06-05 Thread Olivier
Hi,

After a long discussion with a friend, I would like to ask here:

1.According SIP RFCs, is possible/recommended to have different values in
>From and P-Asserted-Id fields ?
For instance, From field showing 123456789 and P-Asserted-Id showing
987654321 (beside privacy considerations) ?

2. When Bob forwards to Cory a call coming from Alice, would expect
Diversion/History-Info header to include Alice's number ?

Best regards
-- 
_
-- 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] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
Thanks, Anthony.

I added both 'g' and 'F' options. Now, when the caller hangs-up, my cleanup
code is run by both the caller channel and the peer channel, but I only
want the caller channel to do that.

Also, when the peer hangs-up, there is no execution of the priorities
following the Dial.

Finally, is there a way to reset all globals, maybe as a variant of
"dialplan reload"?

On Tue, Jun 5, 2018 at 1:21 AM, Antony Stone <
antony.st...@asterisk.open.source.it> wrote:

> On Tuesday 05 June 2018 at 08:33:26, David P wrote:
>
> > We're using Asterisk 14.7.6 and I have a dialplan that ends like this:
> >
> >  same => n,Dial(SIP/${EXTEN:0:4}@peer1)
> >  same => n,Set(GLOBAL(EpochAtCallEnd)=${EPOCH})
> >  same => n,Hangup()
> >
> > When peer1 hangsup, the priorities after the Dial are executed fine. But
> > when the caller hangsup during the Dial, the cleanup steps aren't done.
> > Why?
> >
> > I did read "Note that on a successful connection, in the absence of the g
> > and G modifiers (below), the Dial command does not return to allow
> > execution of further commands for that extension in that context." at
> > https://www.voip-info.org/asterisk-cmd-dial/ But it seems not to apply
> > because I'm seeing the 'g' behavior without specifying that option, and
> the
> > 'G' option seems intended for a far more complicated scenario.
>
> If you're getting "g" functionality without specifying it, congratulations.
>
> If you want something similar when the callER hangs up, you want to use
> the F
> option.
>
> Regards,
>
>
> Antony.
-- 
_
-- 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] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread Antony Stone
On Tuesday 05 June 2018 at 08:33:26, David P wrote:

> We're using Asterisk 14.7.6 and I have a dialplan that ends like this:
> 
>  same => n,Dial(SIP/${EXTEN:0:4}@peer1)
>  same => n,Set(GLOBAL(EpochAtCallEnd)=${EPOCH})
>  same => n,Hangup()
> 
> When peer1 hangsup, the priorities after the Dial are executed fine. But
> when the caller hangsup during the Dial, the cleanup steps aren't done.
> Why?
> 
> I did read "Note that on a successful connection, in the absence of the g
> and G modifiers (below), the Dial command does not return to allow
> execution of further commands for that extension in that context." at
> https://www.voip-info.org/asterisk-cmd-dial/ But it seems not to apply
> because I'm seeing the 'g' behavior without specifying that option, and the
> 'G' option seems intended for a far more complicated scenario.

If you're getting "g" functionality without specifying it, congratulations.

If you want something similar when the callER hangs up, you want to use the F 
option.

Regards,


Antony.

-- 
The truth is rarely pure, and never simple.

 - Oscar Wilde

   Please reply to the list;
 please *don't* CC me.

-- 
_
-- 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] How to execute priorities following a caller hangup in a successful Dial?

2018-06-05 Thread David P
We're using Asterisk 14.7.6 and I have a dialplan that ends like this:

 same => n,Dial(SIP/${EXTEN:0:4}@peer1)
 same => n,Set(GLOBAL(EpochAtCallEnd)=${EPOCH})
 same => n,Hangup()

When peer1 hangsup, the priorities after the Dial are executed fine. But
when the caller hangsup during the Dial, the cleanup steps aren't done. Why?

I did read "Note that on a successful connection, in the absence of the g
and G modifiers (below), the Dial command does not return to allow
execution of further commands for that extension in that context." at
https://www.voip-info.org/asterisk-cmd-dial/ But it seems not to apply
because I'm seeing the 'g' behavior without specifying that option, and the
'G' option seems intended for a far more complicated scenario.

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