[asterisk-users] Phone Inventory

Danny Nicholas danny at debsinc.com
Thu Feb 23 08:49:16 CST 2012


Here is a snippet that somebody smarter than I am can improve upon
for a in `asterisk -rx "sip show peers"|cut -f1 -d/` ;do asterisk -rx "sip
show peer $a";done|grep Useragent
for a in `asterisk -rx "sip show peers"|cut -f1 -d/` ;do asterisk -rx "sip
show peer $a";done|grep Contact

The first for loop will strip the "Name" out of the peer list and feed it
back to a loop of "sip show peer" stripping out just the UserAgent line
The second loop does the same and returns "Registered Contact", so the two
loops give you something like
Useragent    : PolycomSoundPointIP-SPIP_501-UA/3.1.7.0134
Useragent    : PolycomSoundPointIP-SPIP_501-UA/3.1.2.0392
Reg. Contact : sip:101 at 192.168.81.201
Reg. Contact : sip:100 at 192.168.23.116

So you can see that 81.201 is a Polycom 501 with sip 3.1.7 and 23.116 is a
501 with 3.1.2

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Eric Wieling
Sent: Thursday, February 23, 2012 8:32 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Phone Inventory

Polycom phones can be set to include their MAC in the User Agent string.

Useragent    : PolycomSoundPointIP-SPIP_550-UA/3.3.4.0085_0004f2233929

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Leandro
Dardini
Sent: Thursday, February 23, 2012 2:46 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Phone Inventory

Usually phones transmit all these informations as "User Agent", so you can
just write in asterisk cli:

sip show peer <peername> and you'll get something like :

....
  Useragent    : Yealink SIP-T28P 2.60.0.40
  Reg. Contact : sip:<peername>@192.168.25.102:5062
  Qualify Freq : 60000 ms
....

Leandro

2012/2/23 Muro, Sam <research at businesstz.com>:
> Hi there
>
> I have just took a support of a customer with hundreds of IP phones, 
> mostly Polycom with mixed models.
>
> Is there a way to query asterisk or any other command to retrieve the 
> inventory of all connected phones. i.e. Phone Type and Phone Model, 
> say Polycom SPIP331 or so
>
> Thanks
> Sam
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- 
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> 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 -- New to
Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

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 -- New to
Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

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