Re: [asterisk-users] Asterisk 14.2.1 PJSIP - is it possible to retrieve a PJSIP header To field for the SIP OK response to Trying?

2017-01-24 Thread Joshua Colp
On Tue, Jan 24, 2017, at 01:41 PM, Dan Cropp wrote:
> Thank you Joshua.
> 
> So there is no way to retrieve header information which may come in on
> subsequent packages?
> 
> If not, is there any way to make an Attended Transfer following the
> RFC5589?
> https://tools.ietf.org/html/rfc5589
> 
> Asking because we have a hospital with a Cisco switch.  Hospital has two
> calls from their Cisco switch into an Asterisk box.  Operator handling
> the two calls and needs to transfer Call A to be connected to call B. 
> Can obviously be patched inside of Asterisk.  However, the hospital wants
> the call to be Attended Transferred. Basically, we need to send the
> Transfer (REFER) with the Replaces containing the call ID, From tag, and
> the To Tag.
> 
> I am able to gather everything needed for the REFER field and pass that
> to the Transfer command (via AMI), except the To tag. 

There isn't that I can think of. Even if you are able to construct such
a REFER I'm not sure what exactly will happen inside of Asterisk with
the legs.

-- 
Joshua Colp
Digium, Inc. | Senior 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] Asterisk 14.2.1 PJSIP - is it possible to retrieve a PJSIP header To field for the SIP OK response to Trying?

2017-01-24 Thread Dan Cropp
Thank you Joshua.

So there is no way to retrieve header information which may come in on 
subsequent packages?

If not, is there any way to make an Attended Transfer following the RFC5589?
https://tools.ietf.org/html/rfc5589

Asking because we have a hospital with a Cisco switch.  Hospital has two calls 
from their Cisco switch into an Asterisk box.  Operator handling the two calls 
and needs to transfer Call A to be connected to call B.  Can obviously be 
patched inside of Asterisk.  However, the hospital wants the call to be 
Attended Transferred. Basically, we need to send the Transfer (REFER) with the 
Replaces containing the call ID, From tag, and the To Tag.

I am able to gather everything needed for the REFER field and pass that to the 
Transfer command (via AMI), except the To tag. 

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Joshua Colp
Sent: Tuesday, January 24, 2017 11:27 AM
To: asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] Asterisk 14.2.1 PJSIP - is it possible to 
retrieve a PJSIP header To field for the SIP OK response to Trying?

On Tue, Jan 24, 2017, at 01:25 PM, Dan Cropp wrote:
> I place a call into Asterisk (from SIP phone) and the To header does 
> not have a tag.  Asterisk then sends it's Trying response, still no 
> tag in the To header.  The phone then replies with OK, this time the 
> To header includes a tag.
> 
> Is there any way to retrieve this response To header (including the 
> tag
> field) from the dial plan?
> I have tried the PJSIP-HEADER read of the To header, but it seems to 
> only have access to the initial To header.
> I even tried reading multiple layers of the To header, but it still 
> didn't retrieve the newer dialog To headers.

The PJSIP_HEADER dialplan function currently only looks at the initial message. 
It does not allow access to subsequent ones.

--
Joshua Colp
Digium, Inc. | Senior 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] Asterisk 14.2.1 PJSIP - is it possible to retrieve a PJSIP header To field for the SIP OK response to Trying?

2017-01-24 Thread Joshua Colp
On Tue, Jan 24, 2017, at 01:25 PM, Dan Cropp wrote:
> I place a call into Asterisk (from SIP phone) and the To header does not
> have a tag.  Asterisk then sends it's Trying response, still no tag in
> the To header.  The phone then replies with OK, this time the To header
> includes a tag.
> 
> Is there any way to retrieve this response To header (including the tag
> field) from the dial plan?
> I have tried the PJSIP-HEADER read of the To header, but it seems to only
> have access to the initial To header.
> I even tried reading multiple layers of the To header, but it still
> didn't retrieve the newer dialog To headers.

The PJSIP_HEADER dialplan function currently only looks at the initial
message. It does not allow access to subsequent ones.

-- 
Joshua Colp
Digium, Inc. | Senior 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


[asterisk-users] Asterisk 14.2.1 PJSIP - is it possible to retrieve a PJSIP header To field for the SIP OK response to Trying?

2017-01-24 Thread Dan Cropp
I place a call into Asterisk (from SIP phone) and the To header does not have a 
tag.  Asterisk then sends it's Trying response, still no tag in the To header.  
The phone then replies with OK, this time the To header includes a tag.

Is there any way to retrieve this response To header (including the tag field) 
from the dial plan?
I have tried the PJSIP-HEADER read of the To header, but it seems to only have 
access to the initial To header.
I even tried reading multiple layers of the To header, but it still didn't 
retrieve the newer dialog To headers.

I am including the SIP messages reported by Asterisk for the call coming in...

*** Phone sends INVITE to Asterisk ***

INVITE sip:3...@xxx.xxx.xxx.xxx SIP/2.0^M
Via: SIP/2.0/UDP yyy.yyy.yyy.yyy:5063;branch=z9hG4bK-18e552c3^M
From: "1004" ;tag=79e7940882a792ao2^M
To: ^M
Call-ID: 3162d378-ea2b2...@yyy.yyy.yyy.yyy^M
CSeq: 102 INVITE^M
Max-Forwards: 70^M
Authorization: Digest 
username="1004",realm="asterisk",nonce="1485271992/b1bebde5cb4a763ed85b1d8e52c8e30d",uri="sip:3...@xxx.xxx.xxx.xxx",algorithm=MD5,response="8dd827e9910c2446fb0b8497f5944b81",opaque="66e52\
68a2111e777",qop=auth,nc=0001,cnonce="9dda9e0d"^M
Contact: "1004" ^M
Expires: 240^M
User-Agent: Cisco/SPA504G-7.4.8a^M
Content-Length: 401^M
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE^M
Supported: replaces^M
Content-Type: application/sdp^M
^M
v=0^M
o=- 32730859 32730859 IN IP4 yyy.yyy.yyy.yyy^M
s=-^M
c=IN IP4 yyy.yyy.yyy.yyy^M
t=0 0^M
m=audio 16436 RTP/AVP 0 2 8 9 18 96 97 98 101^M
a=rtpmap:0 PCMU/8000^M
a=rtpmap:2 G726-32/8000^M
a=rtpmap:8 PCMA/8000^M
a=rtpmap:9 G722/8000^M
a=rtpmap:18 G729a/8000^M
a=rtpmap:96 G726-40/8000^M
a=rtpmap:97 G726-24/8000^M
a=rtpmap:98 G726-16/8000^M
a=rtpmap:101 telephone-event/8000^M
a=fmtp:101 0-15^M
a=ptime:30^M
a=sendrecv^M

*** reply from Asterisk to phone ***

SIP/2.0 100 Trying^M
Via: SIP/2.0/UDP 
yyy.yyy.yyy.yyy:5063;received=yyy.yyy.yyy.yyy;branch=z9hG4bK-18e552c3^M
Call-ID: 3162d378-ea2b2...@yyy.yyy.yyy.yyy^M
From: "1004" ;tag=79e7940882a792ao2^M
To: ^M
CSeq: 102 INVITE^M
Server: Asterisk PBX 14.2.1^M
Content-Length:  0^M
^M


**
Asterisk receives this packet in response to the Trying.
Is it possible to retrieve this To header via the dial plan?  Specifically, I 
need the tag portion of the From
**

SIP/2.0 200 OK^M
Via: SIP/2.0/UDP 
yyy.yyy.yyy.yyy:5063;received=yyy.yyy.yyy.yyy;branch=z9hG4bK-18e552c3^M
Call-ID: 3162d378-ea2b2...@yyy.yyy.yyy.yyy^M
From: "1004" ;tag=79e7940882a792ao2^M
To: ;tag=96156bd7-9e8e-4077-b6e4-f3eb12e39069^M
CSeq: 102 INVITE^M
Server: Asterisk PBX 14.2.1^M
Contact: ^M
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, 
PRACK, REGISTER, MESSAGE, REFER^M
Supported: 100rel, timer, replaces, norefersub^M
Content-Type: application/sdp^M
Content-Length:   179^M
^M
v=0^M
o=- 32730859 32730861 IN IP4 xxx.xxx.xxx.xxx^M
s=Asterisk^M
c=IN IP4 xxx.xxx.xxx.xxx^M
t=0 0^M
m=audio 19384 RTP/AVP 0^M
a=rtpmap:0 PCMU/8000^M
a=ptime:20^M
a=maxptime:150^M
a=sendrecv^M


ACK sip:xxx.xxx.xxx.xxx:5060 SIP/2.0^M
Via: SIP/2.0/UDP yyy.yyy.yyy.yyy:5063;branch=z9hG4bK-c38362b^M
From: "1004" ;tag=79e7940882a792ao2^M
To: ;tag=96156bd7-9e8e-4077-b6e4-f3eb12e39069^M
Call-ID: 3162d378-ea2b2...@yyy.yyy.yyy.yyy^M
CSeq: 102 ACK^M
Max-Forwards: 70^M
Authorization: Digest 
username="1004",realm="asterisk",nonce="1485271992/b1bebde5cb4a763ed85b1d8e52c8e30d",uri="sip:3...@xxx.xxx.xxx.xxx",algorithm=MD5,response="8dd827e9910c2446fb0b8497f5944b81",opaque="66e52\
68a2111e777",qop=auth,nc=0001,cnonce="9dda9e0d"^M
Contact: "1004" ^M
User-Agent: Cisco/SPA504G-7.4.8a^M
Content-Length: 0^M
^M

SIP/2.0 200 OK^M
Via: SIP/2.0/UDP 
192.168.35.91:5063;received=192.168.35.91;branch=z9hG4bK-18e552c3^M
Call-ID: 3162d378-ea2b2452@192.168.35.91^M
From: "1004" ;tag=79e7940882a792ao2^M
To: ;tag=96156bd7-9e8e-4077-b6e4-f3eb12e39069^M
CSeq: 102 INVITE^M
Server: Asterisk PBX 14.2.1^M
Contact: ^M
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, 
PRACK, REGISTER, MESSAGE, REFER^M
Supported: 100rel, timer, replaces, norefersub^M
Content-Type: application/sdp^M
Content-Length:   179^M
^M
v=0^M
o=- 32730859 32730861 IN IP4 192.168.33.30^M
s=Asterisk^M
c=IN IP4 192.168.33.30^M
t=0 0^M
m=audio 19384 RTP/AVP 0^M
a=rtpmap:0 PCMU/8000^M
a=ptime:20^M
a=maxptime:150^M
a=sendrecv^M
-- 
_
-- 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