Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


davidcole

6099 posts

Uber Geek
+1 received by user: 1465

Trusted

#255931 7-Sep-2019 09:04
Send private message

Anyone know of a way of getting the sip status from one of these devices (in an automated way), some curl command I could go periodically to get my sip status (from say openhab which can just do a http call)

 

 





Previously known as psycik

Home Assistant: Gigabyte AMD A8 Brix, Home Assistant with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Shelly Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Server
Host Plex Server 3x3TB, 4x4TB using MergerFS, Samsung 850 evo 512 GB SSD, Proxmox Server with 1xW10, 2xUbuntu 22.04 LTS, Backblaze Backups, usenetprime.com fastmail.com Sharesies Trakt.TV Sharesight 


Create new topic
cyril7
9075 posts

Uber Geek
+1 received by user: 2499

ID Verified
Trusted
Subscriber

  #2312098 7-Sep-2019 09:29
Send private message

Hi, not too sure but can you ssh into it and run a bash script and sweep that?

 

Cyril




davidcole

6099 posts

Uber Geek
+1 received by user: 1465

Trusted

  #2312119 7-Sep-2019 09:58
Send private message

cyril7:

Hi, not too sure but can you ssh into it and run a bash script and sweep that?


Cyril



Yes I can ssh to it (could set up key based). But any ideas what I’d look at for a status? A command. Or do you mean just scan the main log file?




Previously known as psycik

Home Assistant: Gigabyte AMD A8 Brix, Home Assistant with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Shelly Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Server
Host Plex Server 3x3TB, 4x4TB using MergerFS, Samsung 850 evo 512 GB SSD, Proxmox Server with 1xW10, 2xUbuntu 22.04 LTS, Backblaze Backups, usenetprime.com fastmail.com Sharesies Trakt.TV Sharesight 


speed
296 posts

Ultimate Geek
+1 received by user: 101


  #2312121 7-Sep-2019 10:02
Send private message

davidcole: Yes I can ssh to it (could set up key based). But any ideas what I’d look at for a status? A command. Or do you mean just scan the main log file?

 

 

 

I think they run Asterisk under the hood, so try this:

 

 

 

asterisk -rx 'sip show registry'




davidcole

6099 posts

Uber Geek
+1 received by user: 1465

Trusted

  #2312125 7-Sep-2019 10:18
Send private message

Hmm yes.

 

 

 

real ILBC_Frame_Size:240
Setting max files open to 2048
Host                           dnsmgr Username       Refresh State                Reg.Time
sip.2talk.co.nz:5060           N      12345567@si       105 Registered           Sat, 07 Sep 2019 10:14:43
1 SIP registrations.

 

 

 

Does that mean there's an asterisk api underneath?

 

 

 

I see the following open ports:

 

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:5038            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:www             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
netstat: /proc/net/tcp6: No such file or directory
udp        0      0 0.0.0.0:bootpc          0.0.0.0:*
udp        0      0 0.0.0.0:47944           0.0.0.0:*
udp        0      0 TA100.local:ntp   0.0.0.0:*
udp        0      0 TA100.com:ntp           0.0.0.0:*
udp        0      0 0.0.0.0:ntp             0.0.0.0:*
udp        0      0 0.0.0.0:sip             0.0.0.0:*
udp        0      0 0.0.0.0:5108            0.0.0.0:*





Previously known as psycik

Home Assistant: Gigabyte AMD A8 Brix, Home Assistant with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Shelly Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Server
Host Plex Server 3x3TB, 4x4TB using MergerFS, Samsung 850 evo 512 GB SSD, Proxmox Server with 1xW10, 2xUbuntu 22.04 LTS, Backblaze Backups, usenetprime.com fastmail.com Sharesies Trakt.TV Sharesight 


speed
296 posts

Ultimate Geek
+1 received by user: 101


  #2312140 7-Sep-2019 10:41
Send private message

davidcole:

 

Hmm yes.

 

<SNIP>

 

Does that mean there's an asterisk api underneath?

 

 

No idea sorry. I'm not aware of any api.

 

If you really need to use http, could you maybe scrape the information from the Yeastar's own webUI (eg using curl or wget on your OpenHab host)?

 

 


davidcole

6099 posts

Uber Geek
+1 received by user: 1465

Trusted

  #2314047 10-Sep-2019 10:14
Send private message

So using python, and a python library asterisk-ami, you can get the status.

 

And I've even added an mqtt publish do it, so I can get the status in openhab.  

 

I'm actually thinking about making it run longer...and process incoming calls.





Previously known as psycik

Home Assistant: Gigabyte AMD A8 Brix, Home Assistant with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Shelly Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Server
Host Plex Server 3x3TB, 4x4TB using MergerFS, Samsung 850 evo 512 GB SSD, Proxmox Server with 1xW10, 2xUbuntu 22.04 LTS, Backblaze Backups, usenetprime.com fastmail.com Sharesies Trakt.TV Sharesight 


 
 
 
 

Shop now on Samsung phones, tablets, TVs and more (affiliate link).
chevrolux
4962 posts

Uber Geek
+1 received by user: 2638
Inactive user


  #2314068 10-Sep-2019 10:27
Send private message

Late to the party... but yea Asterisk Manager will give the status you want.


davidcole

6099 posts

Uber Geek
+1 received by user: 1465

Trusted

  #2314069 10-Sep-2019 10:28
Send private message

chevrolux:

 

Late to the party... but yea Asterisk Manager will give the status you want.

 

 

Is that software?  or do you mean the asterisk manager ami call?





Previously known as psycik

Home Assistant: Gigabyte AMD A8 Brix, Home Assistant with Aeotech ZWave Controller, Raspberry PI, Wemos D1 Mini, Zwave, Shelly Humidity and Temperature sensors
Media:Chromecast v2, ATV4 4k, ATV4, HDHomeRun Dual
Server
Host Plex Server 3x3TB, 4x4TB using MergerFS, Samsung 850 evo 512 GB SSD, Proxmox Server with 1xW10, 2xUbuntu 22.04 LTS, Backblaze Backups, usenetprime.com fastmail.com Sharesies Trakt.TV Sharesight 


Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.