[Freeswitch-users] Dialplan delimiter transform
Michael Collins
msc at freeswitch.org
Thu Sep 15 19:28:57 MSD 2011
On Thu, Sep 15, 2011 at 3:19 AM, Steven Ayre <steveayre at gmail.com> wrote:
> Change the regex to only pull out the first part into $1. Something like
> this:
>
> <condition field="destination_number"
> expression="^(\d+)\-(\d+\.\d+\.\d+\.\d+)$">
>
FYI, a bare - in a regex does not need to be escaped.
-MC
>
> $1 will be 0114712500
> $2 will be 10.3.12.153
>
> -Steve
>
>
> On 15 September 2011 10:14, Chris Graham <chrisg.lists at gmail.com> wrote:
>
>> Hi All,
>>
>> I have a simple issue I seem to not be making progress on. Due to topology
>> hiding in one of the headquaters I send a invite as such:
>>
>> INVITE sip:0114712500-10.3.12.153 at x.x.x.x SIP/2.0.
>>
>> You can see the first part of the invite is the dialstring then a "-" used
>> as a delimiter to bill against the hidden IP. FS duly passed this dialstring
>> on. The carrier then rejects the call.
>>
>> I want to modify the dialstring in the context below not to dial
>> 0114712500-10.3.12.153 but rather just 0114712500. I hope I am clear, and
>> thanks in advance.
>>
>> <document type="freeswitch/xml">
>> <section name="dialplan" description="RE FS DP">
>> <context name="lcr_trunks">
>> <extension name="Catch all send to carriers">
>> <condition field="destination_number" expression="^(.*)$">
>> <action application="set" data="nibble_account=10.3.12.153"/>
>> <action application="lcr" data="$1 peak"/>
>> <action application="bridge" data="${lcr_auto_route}"/>
>> </condition>
>> </extension>
>> </context>
>> </section>
>> </document>
>>
>> Chris G
>>
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110915/63e8644f/attachment-0001.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list