[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

DevState (BRIstuff) => DEVSTATE (Asterisk 1.4)

Posted on 2009-04-21
1
Medium Priority
?
1,229 Views
Last Modified: 2013-11-12
Hi,

I have a weird problem trying to transfer extensions.conf code from an old system, running Asterisk 1.2.26-BRIstuffed-0.3.0-PRE-1y-p to a new one, running Asterisk 1.4.24. I use SNOM phones. Here is the old code :


exten => *88880,hint,DS/*88880
exten => *88880,1,Macro(agent-login,*88880,queue1,SIP/880)

[macro-agent-login]
exten => s,1,NoOp(Agent Login Nr: ${ARG1} Queue: ${ARG2})
exten => s,n,GotoIf(${DB(${ARG2}/${ARG1})}?logout,1:login,1)
exten => login,1,Answer()
exten => login,n,Set(DB(${ARG2}/${ARG1})=1)
exten => login,n,DevState(${ARG1},2)
exten => login,n,AddQueueMember(${ARG2}|${ARG3})
exten => login,n,Playback(txt-70)
exten => login,n,Hangup()

exten => logout,1,Answer()
exten => logout,n,DBdel(${ARG2}/${ARG1})
exten => logout,n,DevState(${ARG1},0)
exten => logout,n,RemoveQueueMember(${ARG2}|${ARG3})
exten => logout,n,Playback(txt-71)
exten => logout,n,Hangup()


The lines

exten => login,n,DevState(${ARG1},2)  
and
exten => logout,n,DevState(${ARG1},0)

activate and deactivate the LED of the SNOM phone, which visually shows if the used is currently logged in or logged out. I cannot manage to get this working on the new system. I've downloaded, complied and installed the backport of the new function DEVICE_STATE to 1.4  from here (http://svncommunity.digium.com/svn/russell/asterisk-1.4/func_devstate-1.4/), the function is registsered, but the LEDs remain off :(

Here is the new code :

exten => *88880,hint,Custom:*88880
exten => *88880,1,Macro(agent-login,*88880,queue1,SIP/880)
[macro-agent-login]
exten => s,1,NoOp(Agent Login Nr: ${ARG1} Queue: ${ARG2})
exten => s,n,GotoIf(${DB(${ARG2}/${ARG1})}?logout,1:login,1)

exten => login,1,Answer()
exten => login,n,Playback(beep)
exten => login,n,Set(DB(${ARG2}/${ARG1})=1)
exten => login,n,Set(DEVSTATE(Custom:${ARG1})=BUSY))
exten => login,n,NoOp(${ARG1} has state ${DEVSTATE(Custom:${ARG1})})
exten => login,n,AddQueueMember(${ARG2}|${ARG3})
exten => login,n,Playback(txt-70)
exten => login,n,Hangup()

exten => logout,1,Answer()
exten => logout,n,Playback(beeperr)
exten => logout,n,DBdel(${ARG2}/${ARG1})
exten => logout,n,Set(DEVSTATE(Custom:${ARG1})=NOT_INUSE))
exten => logout,n,NoOp(${ARG1} has state ${DEVSTATE(Custom:${ARG1})})
exten => logout,n,RemoveQueueMember(${ARG2}|${ARG3})
exten => logout,n,Playback(txt-71)
exten => logout,n,Hangup()

Here is what the CLI shows :
[Apr 21 16:22:31]     -- Executing [logout@macro-agent-login:4] Set("SIP/880-09dd2ff0", "DEVSTATE(Custom:*88880)=NOT_INUSE)") in new stack
[Apr 21 16:22:31]     -- Executing [logout@macro-agent-login:5] NoOp("SIP/880-09dd2ff0", "*88880 has state UNKNOWN") in new stack

doesn't matter what I dial, I always get *88880 has state UNKNOWN and the LED remains off.

The function is registered :

localhost*CLI> show function DEVSTATE
localhost*CLI>
  -= Info about function 'DEVSTATE' =-

[Syntax]
DEVSTATE(device)

[Synopsis]
Get or Set a device state

[Description]
  The DEVSTATE function can be used to retrieve the device state from any
device state provider.  For example:
   NoOp(SIP/mypeer has state ${DEVSTATE(SIP/mypeer)})
   NoOp(Conference number 1234 has state ${DEVSTATE(MeetMe:1234)})

  The DEVSTATE function can also be used to set custom device state from
the dialplan.  The "Custom:" prefix must be used.  For example:
  Set(DEVSTATE(Custom:lamp1)=BUSY)
  Set(DEVSTATE(Custom:lamp2)=NOT_INUSE)
You can subscribe to the status of a custom device state using a hint in
the dialplan:
  exten => 1234,hint,Custom:lamp1

  The possible values for both uses of this function are:
UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING
RINGINUSE | ONHOLD



Obviously I have something wrong in the settings ... :(

0
Comment
Question by:tkalchev
1 Comment
 
LVL 9

Accepted Solution

by:
tkalchev earned 0 total points
ID: 24195551
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How To Create Custom / Distinctive Ring Tones on Polycom Phones Purpose and Overview When creating a custom ring tone, you have simple aspirations: to make your phone cooler than everyone else's. Perhaps you need a louder ringer. Perhaps you w…
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
Integration Management Part 2
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question