[Freeswitch-users] Persistence BLFs (or: Dear PBX please remember the BLF state)
Patrick Plattes
patrick.plattes at niemann-frey.info
Fri Jan 28 16:41:31 MSK 2011
Hi :-)
2011/1/27 Anthony Minessale <anthony.minessale at gmail.com>:
> try setting the variable presence_id to the blf entity you are
> subscribing to (include the domain)
I don't understand fully the variable presence_id, but i've tried a
few things without any success. If I use the following lines, the lamp
fill be enabled at the login for a few milliseconds.
<extension name="Queue Management">
<condition field="destination_number"
expression="^queue-(\w+)-(\d+)$" break="on-false">
<action application="set"
data="queue_name=${regex(${destination_number}|^queue-(\w+)-(\d+)$|$1)}"
inline="true"/>
<action application="set"
data="queue_user=${regex(${destination_number}|^queue-(\w+)-(\d+)$|$2)}"
inline="true"/>
<action application="log" data="INFO destination_number
${destination_number}"/>
<action application="log" data="INFO queue_user ${queue_user}"/>
<action application="log" data="INFO queue_name ${queue_name}"/>
</condition>
<condition field="${fifo(list ${queue_name}@${domain_name})}"
expression="${queue_user}">
<action application="answer"/>
<action application="set"
data="presence_id=queue-${queue_name}-${queue_user}@${domain_name}"/>
<action application="set" data="result=${fifo_member(del
${queue_name}@${domain_name}
{fifo_member_wait=nowait}user/${queue_user} )}"/>
<action application="log" data="INFO Delete FIFO agent result: ${result}"/>
<action application="log" data="INFO User Logout: ${user_name}"/>
<action application="sleep" data="600"/>
<action application="playback" data="ivr/ivr-you_are_now_logged_out.wav"/>
<action application="set" data="result=${presence(out
queue-${queue_name}-${queue_user}@${domain_name} inuse inuse)}"/>
<action application="log" data="INFO Presence OUT ${result}"/>
<action application="hangup"/>
<anti-action application="answer"/>
<anti-action application="set"
data="presence_id=queue-${queue_name}-${queue_user}@${domain_name}"
inline="true"/>
<anti-action application="set" data="result=${fifo_member(add
${queue_name}@${domain_name}
{fifo_member_wait=nowait}user/${queue_user} )}" inline="true"/>
<anti-action application="log" data="INFO Add FIFO agent result:
${result}"/>
<anti-action application="log" data="INFO User Login: ${user_name}"/>
<anti-action application="sleep" data="600"/>
<anti-action application="playback"
data="ivr/ivr-you_are_now_logged_in.wav"/>
<anti-action application="set" data="result=${presence(in
queue-${queue_name}-${queue_user}@${domain_name} inuse inuse)}"/>
<anti-action application="log" data="INFO Presence IN ${result}"/>
<anti-action application="hangup"/>
</condition>
</extension>
More information about the FreeSWITCH-users
mailing list