<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1799176759;
        mso-list-type:hybrid;
        mso-list-template-ids:368581582 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Building on my last message, I am trying to get CHANNEL data using getvar (through the AMI).  And although I'm getting responses, some  values returned seem illogical.  For example, phone 111 calls phone 222 via the PBX.  Here's the data I get back<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:red'>  Channel A: "1688509741.112" , name:  "PJSIP/111-00000064" , is originator:  Y , call-Id:  "u.l6kcou25cax60@mydomain.com" , local_uri:  "<sip:222@mydomain.com;user=phone>" , local_tag:  "1734d973-c4da-4ae8-a37d-5f7065f1fe54" , local_addr:  "172.31.253.4:5060" , remote_uri:  "\\\"TestPhone x111\\\" <sip:111@mydomain.com>" , remote_tag:  "yinue4v5ufa4" , remote_addr:  "172.31.253.20:5060"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:red'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:red'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:red'>  Channel B: "1688509741.113" , name:  "PJSIP/222-00000065" , is originator:  N , call-Id:  "1f104544-fc1a-4414-ba74-68c526e294de" , local_uri:  "\\\"TestPhone\\\" <sip:111@172.31.253.4>" , local_tag:  "ac5eeb59-f559-4bb7-a3c2-170ca7f05f8b" , local_addr:  "" , remote_uri:  "<sip:222@172.31.253.20;line=46922>" , remote_tag:  "klwqxe1fvt5wk" , remote_addr:  ""<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>And here's what seems strange:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Channel A's local_uri looks like Channel B's uri<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Channel A's remote_uri looks like channel A's uri<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Channel B's local_uri looks like channel A's uri<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Channel B's remote_uri looks like channel B;s uri<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Channel B's local_addr is blank<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Channel B's remote_addr is blank<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>I double checked my code and I'm definitely asking for the right info.  In regards to the reversed URI's, am I reading them wrong?  Should A's local URI be how to reach A, and A's remote URI be how to reach B ?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>The missing local and remote addresses for B is just strange (mentioned in previous email)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Brian<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> asterisk-users [mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>TTT<br><b>Sent:</b> Tuesday, July 4, 2023 6:37 PM<br><b>To:</b> 'Asterisk Users Mailing List - Non-Commercial Discussion' <asterisk-users@lists.digium.com><br><b>Subject:</b> [asterisk-users] Getvar of CHANNEL not working for a couple of items<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><div><div><div><div><div><div><div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Tahoma",sans-serif;color:#1F497D'>The following AMI command works well for all of the information I want:<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-family:"Tahoma",sans-serif;color:#1F497D'>action: Getvar<br>actionid: act1<br>channel: PJSIP/Twilio-NA-W-3-In-00000028<br>Variable: CHANNEL(pjsip,XXXX)</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Where XXXX can be one of the many available items.  However, when I create a call from A to B, all of the items return properly except: local_addr and remote_addr.  More specifically, they return correctly for the A leg (that initiated the call), but are blank for the B leg.  According to the asterisk.org docs:<o:p></o:p></span></p><p class=MsoListParagraph style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:-.25in;mso-list:l0 level1 lfo2;background:white'><![if !supportLists]><span style='font-size:10.5pt;font-family:Symbol;color:#333333'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>         </span></span></span><![endif]><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'>local_addr</span><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#333333'> - On inbound calls, the full IP address and port number that the </span><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'>INVITE</span><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#333333'> request was received on. On outbound calls, the full IP address and port number that the </span><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'>INVITE</span><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#333333'> request was transmitted from.<o:p></o:p></span></p><p class=MsoListParagraph style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:-.25in;mso-list:l0 level1 lfo2;background:white'><![if !supportLists]><span style='font-size:10.5pt;font-family:Symbol;color:#333333'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>         </span></span></span><![endif]><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'>remote_addr</span><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#333333'> - On inbound calls, the full IP address and port number that the </span><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'>INVITE</span><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#333333'> request was received from. On outbound calls, the full IP address and port number that the </span><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'>INVITE</span><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#333333'> request was transmitted to.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>So they should be set for the B leg (outbound invite) as well but they are not; they are blank.  Is this a bug or am I misunderstanding something?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Brian<o:p></o:p></span></p></div></div></div></div></div></div></div></div></div></div></div></div></body></html>