Trixbox 2.8.0 DEVICE_STATE / BLF Issues

sultanj18
Posts: 18
Member Since:
2008-03-14

Ok, installed and setup 2.8.0 yesterday. I'm trying to do a custom script using DEVSTATE, but when I do a "core show function devstate" I get "No function by that name registered.". I have the option in amportal.conf for "USEDEVSTATE=true" and the system has been restarted/reloaded multiple times. Am I missing something here?

Also, what's with CDR reports? (PBX | CDR Report), it's blank. I'll check on modules here and try to update.... Thanks for any info!



sultanj18
Posts: 18
Member Since:
2008-03-14
WOW

Ok, I'm not being smart here. "core show function DEVICE_STATE" DOES work! But my script still doesn't. Anyone else have example scripts for toggling a BLF or something? I'm using a modified version of digium-russell's initial example after he created the the original mod-function "DEVSTATE". Thanks, and I'll try to post updates to my progress if it starts working....



sultanj18
Posts: 18
Member Since:
2008-03-14
Ok....

Now I'm pretty sure the script is working. I'm now using a version of THIS script (thank you for posting!), MINUS the DND stuff (just experimenting with an indicator light) - http://trixbox.org/forums/vendor-specific-unmoderated/grandstream... and in CLI I get:

-- Executing [8765@from-internal:1] NoOp("SIP/5000-094e0380", "") in new stack
-- Executing [8765@from-internal:2] GotoIf("SIP/5000-094e0380", "?deactivate") in new stack
-- Executing [8765@from-internal:3] Set("SIP/5000-094e0380", "DEVSTATE(Custom:logstate)=INUSE") in new stack
-- Executing [8765@from-internal:4] Goto("SIP/5000-094e0380", "end") in new stack
-- Goto (from-internal,8765,7)
-- Executing [8765@from-internal:7] Hangup("SIP/5000-094e0380", "") in new stack

But on the phone, I get "Call Failed Reason Code: 603" (which I understand is a generic error). This is with Grandstream's new 1.2.1.4 firmware, but I've also tried with 1.1.6.44 with the same error. The button is setup as just an "Asterisk BLF", like some others I use successfully for a queue login/out routine. I see in the changelog, Grandstream says they've fixed an issues with BLFs and multiple accounts (maybe/maybe not), but I still don't think this is the core issue.

Anyone else with issues like these? Is it just Grandstream's "Bulletproof" firmware? or another config issue? I appreciate any info, and I've GOT to think MORE people are trying to make BLF/DEVICE_STATE custom indicators work! Where are you people?!?!?



sultanj18
Posts: 18
Member Since:
2008-03-14
WORKING

Finally! I realized the syntax of the script was incorrect. Now working, BLF changes on phone toggling between "INUSE" and "NOT_INUSE". The GXP2000 also supports BLF state "RINGING", but this causes the phone to try and 'pickup' the 'call' when toggling off of that state. Now we just need to add the queue login/out routine to this. Script as used:

exten => xxxx,hint,Custom:loglight
exten => xxxx,1,Goto(xxxx-${DEVICE_STATE(Custom:loglight)},1)
exten => xxxx-UNKNOWN,1,Goto(xxxx-NOT_INUSE,1)
exten => xxxx-NOT_INUSE,1,Set(DEVICE_STATE(Custom:loglight)=INUSE)
exten => xxxx,n,Hangup
exten => xxxx-INUSE,1,Set(DEVICE_STATE(Custom:loglight)=NOT_INUSE)
exten => xxxx,n,Hangup

...And output from CLI:

-- Executing [xxxx@from-internal:1] Goto("SIP/5000-09130780", "xxxx-NOT_INUSE,1") in new stack
-- Goto (from-internal,xxxx-NOT_INUSE,1)
-- Executing [xxxx-NOT_INUSE@from-internal:1] Set("SIP/5000-09130780", "DEVICE_STATE(Custom:loglight)=INUSE") in new stack
-- Executing [xxxx-NOT_INUSE@from-internal:2] NoCDR("SIP/5000-09130780", "") in new stack
-- Executing [xxxx-NOT_INUSE@from-internal:3] Wait("SIP/5000-09130780", "1") in new stack
== Extension Changed xxxx[from-internal-custom] new state InUse for Notify User 5000
== Spawn extension (from-internal, xxxx-NOT_INUSE, 3) exited non-zero on 'SIP/5000-09130780'
-- Executing [h@from-internal:1] Macro("SIP/5000-09130780", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("SIP/5000-09130780", "vw") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("SIP/5000-09130780", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("SIP/5000-09130780", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("SIP/5000-09130780", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("SIP/5000-09130780", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("SIP/5000-09130780", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/5000-09130780' in macro 'hangupcall'
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/5000-09130780'

So, something is still wrong with properly hanging up the call, I'll have to work on that. Hopefully someone else will start using DEVICE_STATE and we can get something else working!



rwalker
Posts: 49
Member Since:
2006-11-17
Queue BLF function

Did you ever get a BLF key to function as queue login/logout (maybe with color code for number of calls in queue)?

Thanks,
Roy



Comment viewing options

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