Get ip address of other registered users/phones with xml

wberriel1
Posts: 17
Member Since:
2008-12-15

So I want to do a bit of xml programming, where I'll want to update the status of multiple phones, depending on a button press from a single phone.

Basically, I'm doing a group dnd on a phone. I stole enough code from the aastra provided code to change the dnd status to what I want it to be from all phones in a group. However, to propagate that change to the phones, I think I need to use the push2phone command, that takes an ip address of the phone to push to. However, I'm not sure of a way to programatically get the ip address that other users are registered to.

Any ideas?

Am I going about group dnd the wrong way, by the way?

thanks.



SkykingOH
Posts: 9681
Member Since:
2007-12-17
I think you are going at it

I think you are going at it the hard way.

I would use a custom devstate in Asterisk and reuse the FreePBX code in a bit of extension programming. I have done the same thing for a multiple queue login and lamp to indicate if they are in the queue or not.

--

Scott

aka "Skyking"



wberriel1
Posts: 17
Member Since:
2008-12-15
Thanks. How would the state

Thanks.

How would the state get pushed to the phones that way? Like I said, I have the php code I need to change all to a dnd state. I am infinitely more comfortable with php programming than asterisk programming, and I figured I would be able to re-use the code already provided to do what I need. I will try the extension route next if I don't get any luck here.

The problem lies, it seems to me, in both cases, in pushing that state to the phones. Unless the aastra stuff will automatically push the dnd state (I want the phones to show when they are in dnd). If I want to manually push the state (using xml), I need the phone's ip address, so is there a way using the php provided by aastra to get an ip address for a phone?



SkykingOH
Posts: 9681
Member Since:
2007-12-17
Quote: How would the state
Quote:
How would the state get pushed to the phones that way?

The phone would subscribe a blf to the devstate.

--

Scott

aka "Skyking"



wberriel1
Posts: 17
Member Since:
2008-12-15
Ah ok. That makes sense. The

Ah ok. That makes sense. The aastra dnd uses xml commands to set the dnd status to "on" on the phone. just using blf and hints would probably be a lot easier.

thanks.



aastra1
Posts: 287
Member Since:
2006-11-06
Phones IP address

Hi there,

You can access to the phones IP address either by using the AGI and get the registry status or you can read the file /var/cache/aastra/startup_asterisk.cfg where we keep the IP address of the phones which used the self-configuration mechanism. The other way you can consider is to look how we propagate a DND status in device/user mode with a SIP Notify, this might be another way for you.

Hope this helps.

--

---
aastra1
Aastra XML scripts 2.3.0 now available



jfinstrom
Posts: 2013
Member Since:
2007-03-07
just a thought... arp -n |

just a thought...

arp -n | grep '00:08:5D' | awk '{print $1}'
--



wberriel1
Posts: 17
Member Since:
2008-12-15
I'll probably just read the

I'll probably just read the /var/cache file. Maybe you guys at aastra want to consider adding a php class with the data from that file in it, I imagine you're parsing that file anyway, why not just make those public classes?

The arp-ing doesn't work since I need to know what's registered to what ip.

By SIP Notify, you mean doing something like SkyKing suggested with BLF? I might try that once I get more comfortable with asterisk coding.

thanks.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.