Seeing UserAgent info that displays make/model/firmware

With chan_sip you could input “sip show peer xxx” and get an output that included a UserAgent line that would reveal the make, model, and firmware version of the endpoint provisioned to that peer.

It’s a very handy way to know the firmware rev of a device directly from the CLI.

Does pjsip have a similar command that would display that info? Google-fu has failed me.

Thanks!

I don’t think there’s a good way to do that with PJSIP right now, but it’s not a bad idea for a new feature there.

Matthew Fredrickson

1 Like

Thanks for the reply! Should that be a feature request over at the Asterisk issue tracker (honestly it’s an Asterisk question not FreePBX, right?)

Thanks again

On the Asterisk issue tracker you can only file bug reports. For feature requests like this, consider it submitted (since I’m involved with the FreePBX project and the Asterisk project).

Matthew Fredrickson

2 Likes

Thank you Brian for asking this question, it’s something I wanted to ask a couple of times but forgot…

Thank you Matt got submitting it.

I’ve needed this too.

Supporting evidence for Matt’s recent kudos at SIMCON: https://twitter.com/SimwoodeSMS/status/1235669504182677513?s=20

1 Like

Hi @mattf,

It is not going to happen to my opinion on the Asterisk CLI and according to Matt Jordan (https://asteriskfaqs.org/2017/10/18/asterisk-users/user-agent-access-from-pjsip.html), it will not.

So, you can probably add a function to the Asterisk Info module that will do the following:

  1. Connect to the AMI via a socket.
  2. Filter the events to get only the contact status details data.
  3. Pull the raw data of the endpoints to a temporary file.
  4. Save the user agent part to a separate table in the database.

Here is a small raw snippet of how it will look like:

do not forget to add two carriage return signs (CR) after each action in order to connect/disconnect properly from the AMI.

ACTION: LOGIN
USERNAME: cxpanel
SECRET: cxmanager*con
EVENTS: ON


Action: Filter
ActionID: 1
Operation: Add
Filter: "Event: ContactStatusDetail*"

Action: PJSIPShowRegistrationInboundContactStatuses



ACTION: LOGOFF

This is the info that you will get from the Asterisk:

Event: ContactStatusDetail
AOR: XXXX
URI: sip:[email protected]:1032
UserAgent: Fanvil i30 2.1.1.2898
RegExpire: 1584016631
ViaAddress: XX.XX.XXX.XXX:1032
CallID: [email protected]
Status: Reachable
RoundtripUsec: 77728
EndpointName: XXXX
ID: XXXX;@ef09e765b41d00db2b8d39b2900893e2
AuthenticateQualify: 0
OutboundProxy: 
Path: 
QualifyFrequency: 60
QualifyTimeout: 3.000

Event: ContactStatusDetailComplete
EventList: Complete
ListItems: 175

Thank you,

Daniel Friedman
Trixton LTD.

Hi @danielf

@mattf is the project lead for Asterisk. Matt Jordan is no longer with the project.

I’ll also elaborate further. Both Matts are correct. I think adding the user agent to the CLI is a perfectly acceptable thing but what Matt Jordan said is also valid. The CLI is meant for human use, so whenever we add something we do it with that in mind. We don’t change that interface to focus on automation/script usage explicitly. Some people use it for that, but other interfaces like AMI are specifically designed for it and the way things are displayed/presented/communicated reflect that.

1 Like

It’s a very human use thing for me-- EPM can tell me the firmware rev I want and endpoint to have, but if I want to know without a doubt what firmware an endpoint has actually installed on it, UserAgent is foolproof and much more convenient than walking an EU through finding it. So in my use case it’s very human and manual-- I’m not running scripts pulling this data at large.

I understand that, and both Matt and myself agree that it’s perfectly fine to be added and he’s taken it in as a submitted request.

I was elaborating on the philosophy of the CLI and such, as Matt Jordan’s comment was brought up which went into it.

1 Like

I was in the same mode (elaborating on philosophy and use). You guys are great to respond to this!

I may not know FreePBX, but I can darn well speak about Asterisk stuff. :smiley:

4 Likes

Hi @jcolp, @mattf,

Maybe something good will turn out from this post.

I hope to get back the flexibility in the Asterisk CLI again, because since the chan_pjsip arise, the integration with other services started to be more complexed and slower.

Thank you,

Daniel Friedman
Trixton LTD.

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.