That is exactly what we needed. I’m still a little new to
matching with regular expressions.
Thanks!
Ken
From:
freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of David
Ponzone
Sent: Wednesday, May 05, 2010 2:57 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Sorting through a list of conditions
Ken,
ever heard of regexp ? :)
In this case, I think you need to use one, or to add one
extension per fax line, which can be more readable and managable.
Other solution would be to use an external DB with XML CURL.
The regexp solution would be:
<condition field="caller_id_number"
expression="^XXXXXXXXXX|XXXXXXXXXX|XXXXXXXXXX|XXXXXXXXXX|XXXXXXXXXX$"/>
Another smart (I think) way to do that would be to create
and dedicate a new SIP Profile on a specific IP or port to fax handling (of
course, that's only possible if you use a dedicated SIP account for fax).
I think the ability to split FreeSWITCH into multiple SIP
Profiles (and so multiple threads) is something that should not be underrated.
It's really easier to manage and you dont break everything
when you test some new parameters on the profile.
Most serious SIP devices should allow to register to a
specific port, so you can use something else than 5060 (Ok I admit some shitty
gear don't allow that, but most of the ATAs I know are ok).
David Ponzone Direction
Technique
email: david.ponzone@ipeva.fr
tel: 01
74 03 18 97
gsm: 06 66 98 76 34
Service Client IPeva
tel:
0811 46 26 26
Ce message et toutes les pièces
jointes sont confidentiels et établis à l'intention exclusive de ses
destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout
message électronique est susceptible d'altération. IPeva décline
toute responsabilité au titre de ce message s'il a été altéré, déformé ou
falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire
immédiatement et d'avertir l'expéditeur.
Le 05/05/2010 à 21:41, Ken Fulmer a écrit :
We’d like to match on either Caller ID or ANI for outbound faxes
and lock them to PCMU.
Here’s what we’ve been using:
<extension name="FAX-LCL-7D">
<condition field="caller_id_number"
expression="^XXXXXXXXXX$"/>
<condition field="destination_number"
expression="^9(\d{7})$">
<action
application="export" data="sip_append_audio_sdp=a=fmtp:18
annexb=no"/>
<action
application="export"
data="nolocal:absolute_codec_string=PCMU"/>
<action
application="set" data="hangup_after_bridge=true"/>
<action
application="bridge" data="sofia/external/$0@X.X.X.X"/>
<action
application="set" data="instant_ringback=true"/>
<action
application="set" data="ringback=${us-ring}"/>
</condition>
</extension>
If we use a list and break=on-false, searching stops after the
first non-match. If we use break=on-true, it stops after the first match, and
we get no digits to send upstream. If we use break=never, it applies the digit
match to all numbers, regardless of Caller ID. I realize this is all normal
behavior.
Is there a way to sort through a list of Caller ID’s, match one,
and then match the outbound digits? We’re trying to avoid having to create a
dial-plan entry for every Caller ID.
Here’s what it *might* look like with multiple internal fax lines:
<extension name="FAX-LCL-7D">
<condition field="caller_id_number"
expression="^XXXXXXXXXX$"/>
<condition field="caller_id_number"
expression="^XXXXXXXXXX$"/>
<condition field="caller_id_number"
expression="^XXXXXXXXXX$"/>
<condition field="caller_id_number"
expression="^XXXXXXXXXX$"/>
<condition field="caller_id_number"
expression="^XXXXXXXXXX$"/>
<condition field="caller_id_number"
expression="^XXXXXXXXXX$"/>
<condition field="caller_id_number"
expression="^XXXXXXXXXX$"/>
<condition field="caller_id_number"
expression="^XXXXXXXXXX$"/>
<condition field="destination_number"
expression="^9(\d{7})$">
<action
application="export" data="sip_append_audio_sdp=a=fmtp:18
annexb=no"/>
<action
application="export"
data="nolocal:absolute_codec_string=PCMU"/>
<action
application="set" data="hangup_after_bridge=true"/>
<action
application="bridge" data="sofia/external/$0@X.X.X.X"/>
<action
application="set" data="instant_ringback=true"/>
<action
application="set" data="ringback=${us-ring}"/>
</condition>
</extension>
Thanks,
Ken Fulmer
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org