[asterisk-users] From the CLI, how can I hangup a channel name that includes a space character?

Dan Cropp dan at amtelco.com
Thu Jan 16 14:06:45 CST 2020


We think the reason hangup request does not work is because it's an alias.
We are using the default cli_aliases.conf which supports hangup request calling channel request hangup.
We think the alias detects the arguments correctly, but then passes the argument without the escaped character (or double quotes) to the real CLI command.

We found that double quotes also work for channel request hangup "..."

It would be nice if the CLI alias commands would pass arguments (or at least some arguments) with double quotes.
That would allow the hangup request alias to work exactly as the channel request hangup that it calls.

-----Original Message-----
From: asterisk-users <asterisk-users-bounces at lists.digium.com> On Behalf Of Dan Cropp
Sent: Thursday, January 16, 2020 1:18 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
Subject: Re: [asterisk-users] From the CLI, how can I hangup a channel name that includes a space character?

Thanks Doug.

Turns out if using hangup request does not work with the escaped character
CLI> hangup request PJSIP/1003\ a-00000007
Usage: channel request hangup <channel>|<all>
       Request that a channel be hung up. The hangup takes effect
       the next time the driver reads or writes from the channel.
       If 'all' is specified instead of a channel name, all channels
       will see the hangup request.

However, channel request hangup ... does support the escaped character.
CLI> channel request hangup PJSIP/1003\ a-00000007
Requested Hangup on channel 'PJSIP/1003 a-00000007'

Thank you for the help.

Dan

-----Original Message-----
From: asterisk-users <asterisk-users-bounces at lists.digium.com> On Behalf Of Doug Lytle
Sent: Thursday, January 16, 2020 12:22 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
Subject: Re: [asterisk-users] From the CLI, how can I hangup a channel name that includes a space character?

>>> Is there some control character(s) for the CLI to interpret everything in between as a single argument?

I think you can typically use tab completion when working with spaces or you can escape the space with a back slash

For example Doug Lytle would be

Doug\ Lytle

Doug

-- 
_____________________________________________________________________
-- 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


More information about the asterisk-users mailing list