Re: [asterisk-users] Phone Inventory
Perhaps another idea (works with extensions with 3 or more digits) #!/bin/sh asterisk -rx sip show peers| grep -vP '(UNKNOWN|Unmonitored)' | cut -f1 -d/ | grep -P '\d\d\d.*' | while read PEER do echo $PEER asterisk -rx sip show peer ${PEER} | grep -P (Useragent|Contact) echo done Best regards. -- Ing CIP. Alejandro Celi Mariátegui a...@linux.org.pe http://cipher.pe/web/asterisk.html El jue, 23-02-2012 a las 09:20 -0600, Dale Noll escribió: On 02/23/2012 08:49 AM, Danny Nicholas wrote: 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 Thanks for the inspiration!! Here is my version, done with a single loop and gets Useragent and Contact together with a visual separation between peers. asterisk -rx sip show peers| cut -f1 -d/ | grep -P '\d\d\d\d' | grep -vP '(UNKNOWN|Unmonitored)' | while read PEER do asterisk -rx sip show peer ${PEER} | grep -P (Useragent|Contact) echo done I hope others find it useful. Dale PS. I by no means claim to be smarter than thou. I just happen to really like grep and the -P option ;-) -- _ -- 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
Re: [asterisk-users] Phone Inventory
Does anyone know if Snom phones can be set to do this as well? Thanks Ish On Thu, 2012-02-23 at 09:31 -0500, Eric Wieling wrote: 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-boun...@lists.digium.com [mailto:asterisk-users-boun...@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 : 6 ms Leandro 2012/2/23 Muro, Sam resea...@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 -- Ishfaq Malik Software Developer PackNet Ltd Office: 0161 660 3062 -- _ -- 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
Re: [asterisk-users] Phone Inventory
On 02/23/2012 08:49 AM, Danny Nicholas wrote: 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 Thanks for the inspiration!! Here is my version, done with a single loop and gets Useragent and Contact together with a visual separation between peers. asterisk -rx sip show peers| cut -f1 -d/ | grep -P '\d\d\d\d' | grep -vP '(UNKNOWN|Unmonitored)' | while read PEER do asterisk -rx sip show peer ${PEER} | grep -P (Useragent|Contact) echo done I hope others find it useful. Dale PS. I by no means claim to be smarter than thou. I just happen to really like grep and the -P option ;-) -- _ -- 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
Re: [asterisk-users] Phone Inventory
Thank you all You are a life saver Sam Dale Noll wrote: On 02/23/2012 08:49 AM, Danny Nicholas wrote: 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 Thanks for the inspiration!! Here is my version, done with a single loop and gets Useragent and Contact together with a visual separation between peers. asterisk -rx sip show peers| cut -f1 -d/ | grep -P '\d\d\d\d' | grep -vP '(UNKNOWN|Unmonitored)' | while read PEER do asterisk -rx sip show peer ${PEER} | grep -P (Useragent|Contact) echo done I hope others find it useful. Dale PS. I by no means claim to be smarter than thou. I just happen to really like grep and the -P option ;-) -- _ -- 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
Re: [asterisk-users] Phone Inventory
+1 Dale - p.s. the grep -P '\d\d\d\d' killed the output on my 1.4 box. P.P.S if you change grep -P (Useragent|Contact) to grep -P (Username|Contact|Username) it produces a nice 4 line report like this: Def. Username: Danny Nicholas Useragent: PolycomSoundPointIP-SPIP_501-UA/3.1.2.0392 Reg. Contact : sip:104@192.168.23.114 = -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Dale Noll Sent: Thursday, February 23, 2012 9:21 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Phone Inventory On 02/23/2012 08:49 AM, Danny Nicholas wrote: 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 Thanks for the inspiration!! Here is my version, done with a single loop and gets Useragent and Contact together with a visual separation between peers. asterisk -rx sip show peers| cut -f1 -d/ | grep -P '\d\d\d\d' | grep -vP '(UNKNOWN|Unmonitored)' | while read PEER do asterisk -rx sip show peer ${PEER} | grep -P (Useragent|Contact) echo done I hope others find it useful. Dale PS. I by no means claim to be smarter than thou. I just happen to really like grep and the -P option ;-) -- _ -- 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
Re: [asterisk-users] Phone Inventory
My short google-fu session says no - It's not universal for Polycom either (the phone has to support microbrowser). -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Ishfaq Malik Sent: Thursday, February 23, 2012 9:00 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Phone Inventory Does anyone know if Snom phones can be set to do this as well? Thanks Ish On Thu, 2012-02-23 at 09:31 -0500, Eric Wieling wrote: 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-boun...@lists.digium.com [mailto:asterisk-users-boun...@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 : 6 ms Leandro 2012/2/23 Muro, Sam resea...@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 -- Ishfaq Malik Software Developer PackNet Ltd Office: 0161 660 3062 -- _ -- 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
[asterisk-users] Phone Inventory
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