<div dir="auto"><div>You are using AMI to run CLI commands and that's the problem. <div dir="auto"><br></div><div dir="auto">Try to use the equivalent AMI actions to get the information that you want. </div><div dir="auto"><br></div><div dir="auto">My suggestion : get all channels in use (CoreShowChannels) and then filter just the SIP, since there is not an action to do exactly what you need. </div><br><div class="gmail_extra"><br><div class="gmail_quote">On 8 Jul 2017 9:17 am, "Antony Stone" <<a href="mailto:Antony.Stone@asterisk.open.source.it" target="_blank">Antony.Stone@asterisk.open.so<wbr>urce.it</a>> wrote:<br type="attribution"><blockquote class="m_-8072166512542591584m_4592095720484109060quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-8072166512542591584m_4592095720484109060quoted-text">On Saturday 08 July 2017 at 07:15:08, Marcelo Terres wrote:<br>
<br>
> There are no sip show channels on AMI. Also, the output that you sent is<br>
> not a AMI output. Are u using AMI ou running commands on console?<br>
<br>
</div>I'm using AMI.<br>
<br>
I have a connection to the Asterisk server on port 5038, initated with:<br>
<br>
        Action: Login<br>
        Username: xxxxx<br>
        Secret: yyyyy<br>
        Events: off<br>
<br>
I receive back:<br>
<br>
        Response: Success<br>
        Message: Authentication accepted<br>
<br>
I then issue:<br>
<br>
        Action: Command<br>
        Command: SIP show channels<br>
<br>
and I get back:<br>
<br>
        Response: Follows<br>
        Privilege: Command<br>
<div class="m_-8072166512542591584m_4592095720484109060quoted-text">        Peer             User/ANR         Call ID          Format           Hold<br>
Last Message    Expiry     Peer<br>
<br>
</div>plus the data I quoted previously.<br>
<div class="m_-8072166512542591584m_4592095720484109060quoted-text"><br>
> Running commands on console and parsing the output is the worst way to<br>
> obtain data, first because it is not easily parseable.<br>
<br>
</div>And also because it is very inefficient with connection setups, I believe.<br>
<div class="m_-8072166512542591584m_4592095720484109060quoted-text"><br>
> Second, it doesn't show you all data.<br>
><br>
> Third, you can have these truncate problems, because that's not intention<br>
> of CLI.<br>
><br>
> Using proper AMI Actions you will probably achieve your goals<br>
><br>
> <a href="https://wiki.asterisk.org/wiki/display/AST/AMI+Actions" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki<wbr>/display/AST/AMI+Actions</a><br>
<br>
</div>Hm, I don't see anything there which will give me a list of the SIP channels<br>
currently in use - what command should I be using for that?<br>
<br>
<br>
Thanks,<br>
<br>
<br>
Antony.<br>
<div class="m_-8072166512542591584m_4592095720484109060elided-text"><br>
> On 7 Jul 2017 10:32 pm, Antony Stone wrote:<br>
><br>
> Hi.<br>
><br>
> I'm trying to get a list of the channels currently in use on an Asterisk<br>
> server (1.8.32.1 if it matters) over AMI.<br>
><br>
> I send the command "sip show channels", and I get back a response along the<br>
> lines of (* used to protect the innocent...):<br>
><br>
> Peer             User/ANR         Call ID          Format           Hold<br>
>  Last Message    Expiry     Peer<br>
> *8.22.*0.34    02035644444      0221e874158bb62  0x4 (ulaw)       No<br>
>  Tx: ACK                    SIPtrunkNu<br>
> *.1*.19.70     (None)           2021549013484-1  0x0 (nothing)    No<br>
>  Rx: OPTIONS                <guest><br>
> *.34.*.208     200101           712173267@192.1  0x4 (ulaw)       No<br>
>  Rx: ACK                    200101<br>
> *.1*.19.70     (None)           149831567021051  0x0 (nothing)    No<br>
>  Rx: REGISTER               <guest><br>
><br>
> So, firstly, the "Call ID" column is clearly truncated, because it should<br>
> show more than is indicated above,<br>
> but more importantly for me, the "Peer" column is truncated, and what<br>
> should show as "SIPtrunkNumber8"<br>
> is only shown as "SIPtrunkNu".<br>
><br>
> How can I get the full column widths of these items shown in the output?<br>
><br>
> Note that it is not a solution just to say "don't call it<br>
> 'SIPtrunkNumber8'; call it 'SIPtrunk8' instead", because<br>
> this name has also been modified slightly to conceal the real name of the<br>
> trunk, which is actually longer<br>
> than "SIPtrunkNo8", but still with the most important information at the<br>
> end.<br>
><br>
> What I'm looking for is how to get the *full* details of all the channels<br>
> shown.<br>
><br>
> I have checked, and there is no "verbose" option to the "sip show channels"<br>
> command.<br>
><br>
><br>
> Thanks,<br>
><br>
><br>
> Antony.<br>
<br>
--<br>
</div>Having been asked for a reference for this man,<br>
I can confirm that you will be very lucky indeed if you can get him to work for<br>
you.<br>
<div class="m_-8072166512542591584m_4592095720484109060elided-text"><br>
                                                   Please reply to the list;<br>
                                                         please *don't* CC me.<br>
<br>
--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.org<wbr>/</a><br>
<br>
New to Asterisk? Start here:<br>
      <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki<wbr>/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailm<wbr>an/listinfo/asterisk-users</a><br>
</div></blockquote></div><br></div></div></div>