[Asterisk-Users] Able to tell if phone is registered?

Race Vanderdecken asteriskusers at codetyrant.com
Wed Feb 23 15:40:08 MST 2005


Look at ast_exists_extension in pbx.c

I have tinkered a bit around them, but not directly coded to it. In the
app_voicemail.c code I think it is used to make sure the extension is
valid. There might be code in there to see if the registration is
active.

Look further I see that chan_sip.c has a sip_show_registry() function
that dumps out the registration state of things.

But the coup de gras maybe the ast_device_state_changed()

When the SIP stack expires a registered phone it calls expire_register()
which calls ast_device_state_changed() to notifiy someone of the state
change.

Race "The Tyrant" Vanderdecken


-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tim Pushor
Sent: Wednesday, February 23, 2005 12:56 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] Able to tell if phone is registered?

Kevin,

Thanks for the reply, and thats what I am doing now, but I would really 
like to know in advance if a particular phone has been registered before

taking a certain action.

I was wondering if I could do something with regexten, but seemed like a

messy solution. Is there any other way? I don't mind getting my hands 
dirty with perl or C, but I wouldn't really know where to start ...

Thanks,
Tim

Kevin P. Fleming wrote:

> Tim Pushor wrote:
>
>> I have a new asterisk setup running at home and am very happy with 
>> it. One thing that I am trying to do is to take various actions in 
>> the dialplan *if* a particular phone is 
>> registered/authenticated/connected. For example, if someone dials 
>> *me* and is shows that I am connected via my softphone, to try it 
>> instead of my deskphone (and possibly notifiy the user in advance 
>> that it is taking that action).
>
>
> Just go ahead and try to send the call there... it will fail 
> immediately if it is not registered, with a DIALSTATUS of CHANUNAVAIL.
>
> If you are using CVS HEAD, you can use "regexten" to accomplish 
> something similar, but I wouldn't recommend it as it's about to change

> :-)
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users





More information about the asterisk-users mailing list