Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Manipulate extension state in 1.8.x


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
ish at pack-net.co.uk
Guest





PostPosted: Tue Jun 09, 2015 11:19 am    Post subject: [asterisk-users] Manipulate extension state in 1.8.x Reply with quote

Hi

Is there any way to set the presence state of a peer to in-use in asterisk 1.8? 


The idea is to integrate DND buttons on phones to BLF.


Regards

--
Quote:
Ishfaq Malik
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)161 660 2350
f: +44 (0)161 660 9825
e: ish@pack-net.co.uk (ish@pack-net.co.uk)
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, Duplex 2, Ducie House
37 Ducie Street
Manchester, M1 2JW
COMPANY REG NO. 04920552
Back to top
johnkiniston at gmail.com
Guest





PostPosted: Tue Jun 09, 2015 11:27 am    Post subject: [asterisk-users] Manipulate extension state in 1.8.x Reply with quote

You can use a custom device state to do it.

[dnd]
;DND Toggle
exten => *363,1,Answer()
 same =>      n,Set(CURRENT_PRESENCE=${DEVICE_STATE(Custom:DND${CHANNEL(peername)})})
 same =>      n,GotoIf($[${CURRENT_PRESENCE}=NOT_INUSE]?*78,1:*79,1)
;DND On
exten => *78,1,NoOP(Turning DND On)
 same =>     n,Set(DEVICE_STATE(Custom:DND${CHANNEL(peername)})=BUSY)
 same =>     n,Playback(do-not-disturb&enabled)
 same =>     n,Hangup()
;DND Off
exten => *79,1,NoOP(Turning DND Off)
 same =>     n,Set(DEVICE_STATE(Custom:DND${CHANNEL(peername)})=NOT_INUSE)
 same =>     n,Playback(do-not-disturb&disabled)
 same =>     n,Hangup()



Then you can simply hint on your device like:

exten => _70X,hint,SIP/${EXTEN}&Custom:DND${EXTEN}



On Tue, Jun 9, 2015 at 9:19 AM, Ishfaq Malik <ish@pack-net.co.uk (ish@pack-net.co.uk)> wrote:
Quote:
Hi

Is there any way to set the presence state of a peer to in-use in asterisk 1.8? 


The idea is to integrate DND buttons on phones to BLF.


Regards

--
Quote:
Ishfaq Malik
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)161 660 2350
f: +44 (0)161 660 9825
e: ish@pack-net.co.uk (ish@pack-net.co.uk)
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, Duplex 2, Ducie House
37 Ducie Street
Manchester, M1 2JW
COMPANY REG NO. 04920552







--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein
Back to top
ish at pack-net.co.uk
Guest





PostPosted: Tue Jun 09, 2015 11:31 am    Post subject: [asterisk-users] Manipulate extension state in 1.8.x Reply with quote

Hi John

I needed a dialplan solution so thank you very much for the pointer!


Regards


Ish


On 9 June 2015 at 17:27, John Kiniston <johnkiniston@gmail.com (johnkiniston@gmail.com)> wrote:
Quote:
You can use a custom device state to do it.

[dnd]
;DND Toggle
exten => *363,1,Answer()
 same =>      n,Set(CURRENT_PRESENCE=${DEVICE_STATE(Custom:DND${CHANNEL(peername)})})
 same =>      n,GotoIf($[${CURRENT_PRESENCE}=NOT_INUSE]?*78,1:*79,1)
;DND On
exten => *78,1,NoOP(Turning DND On)
 same =>     n,Set(DEVICE_STATE(Custom:DND${CHANNEL(peername)})=BUSY)
 same =>     n,Playback(do-not-disturb&enabled)
 same =>     n,Hangup()
;DND Off
exten => *79,1,NoOP(Turning DND Off)
 same =>     n,Set(DEVICE_STATE(Custom:DND${CHANNEL(peername)})=NOT_INUSE)
 same =>     n,Playback(do-not-disturb&disabled)
 same =>     n,Hangup()



Then you can simply hint on your device like:

exten => _70X,hint,SIP/${EXTEN}&Custom:DND${EXTEN}



On Tue, Jun 9, 2015 at 9:19 AM, Ishfaq Malik <ish@pack-net.co.uk (ish@pack-net.co.uk)> wrote:


Quote:
Hi

Is there any way to set the presence state of a peer to in-use in asterisk 1.8? 


The idea is to integrate DND buttons on phones to BLF.


Regards

--
Quote:
Ishfaq Malik
Department: VOIP Support
Company: Packnet Limited
t: [url=tel:%2B44%20%280%29161%20660%202350]+44 (0)161 660 2350[/url]
f: [url=tel:%2B44%20%280%29161%20660%209825]+44 (0)161 660 9825[/url]
e: ish@pack-net.co.uk (ish@pack-net.co.uk)
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, Duplex 2, Ducie House
37 Ducie Street
Manchester, M1 2JW
COMPANY REG NO. 04920552









--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

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




--
Quote:
Ishfaq Malik
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)161 660 2350
f: +44 (0)161 660 9825
e: ish@pack-net.co.uk (ish@pack-net.co.uk)
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, Duplex 2, Ducie House
37 Ducie Street
Manchester, M1 2JW
COMPANY REG NO. 04920552
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services