[Freeswitch-users] Questions about bridge pattern and variables captured by conditions
Iskren Hadzhinedev
iskren.hadzhinedev at ikiji.com
Thu May 22 10:15:40 MSD 2014
Thanks for the response, I should have been clearer.
Yes, local is a profile on which all registered devices are connecting.
sip.test.com is just an alias, but for some reason when calling via the local
profile it doesn't ring, but instead dies with a
NORMAL_TEMPORARY_FAILURE, while when dialing via the sip.test.com
alias, it works just fine.
About the condition variables, I ended up with another variable, because some
users are allowed to make local calls but are actually trying to ring a international
number which triggers the anti-action as the toll evaluates as true, but the
destination number doesn't.
Thanks again!
Kind regards,
--
Iskren Hadzhinedev
If my understanding is correct(TM), the first line is attempting to dial
1000 at sip.test.com via a profile called 'local', whereas the second line is
attempting to dial 1000 via a profile called sip.test.com.
For the second question, you can swap the two statements like this:
<condition field="${toll_allow}" expression="local"/>
<condition field="${destination_number}" expression="^([0-9]{6})$">
<action application="set" data="hangup_after_bridge=true"/>
<action application="bridge" data="sofia/gateway/${default_gateway}/$1"/>
<anti-action application="answer"/>
<anti-action application="speak" data="Local calls are not allowed!"/>
</condition>
Which will preserve $1 for use in the condition statement without having to
explicitly set it as a variable.
Francis
On 2014-05-22 01:11, Iskren Hadzhinedev wrote:
Hello,
I'm having some trouble understanding a couple of things.
First is what's the difference between:
<action application="bridge" data="sofia/local/1000 at sip.test.com"/>
and
<action application="bridge" data="sofia/sip.test.com/1000"/> ?
The other question:
With these dialplan rules:
<condition field="${destination_number}" expression="^([0-9]{6})$"/>
<condition field="${toll_allow}" expression="local">
<action application="set" data="hangup_after_bridge=true"/>
<action application="bridge" data="sofia/gateway/${default_gateway}/$1"/>
<anti-action application="answer"/>
<anti-action application="speak" data="Local calls are not allowed!"/>
</condition>
The variable $1 doesn't get expanded to the captured expression. Is it possible
to retain it somehow without setting a temporary variable?
Thanks!
Kind regards,
--
Iskren Hadzhinedev
_____________________________________________________________
____________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org[1]
http://www.freeswitchsolutions.com[2]
[3]
Official FreeSWITCH Sites
http://www.freeswitch.org[4]
http://wiki.freeswitch.org[5]
http://www.cluecon.com[6]
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org[7]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users[8]
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users[9]
http://www.freeswitch.org[4]
--------
[1] mailto:consulting at freeswitch.org
[2] http://www.freeswitchsolutions.com
[3]
[4] http://www.freeswitch.org
[5] http://wiki.freeswitch.org
[6] http://www.cluecon.com
[7] mailto:FreeSWITCH-users at lists.freeswitch.org
[8] http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
[9] http://lists.freeswitch.org/mailman/options/freeswitch-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140522/05b8715f/attachment-0001.html
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list