[Freeswitch-users] Replacing leading "+" in outgoing numbers
Jörn Ott
joern.ott at ext.chefkoch.de
Fri Sep 11 12:28:12 MSD 2015
Hello guys,
its not the digits causing problems but the \+ at the beginning.
My routes for national calls ^0(\d\d\d\d\d*)$ and international calls ^00(\d\d\d\d\d*)$ work fine that way (targetting all numbers which are longer than internal numbers and have a leading 0 or 00). The problem happens, if add a similar rule starting with a literal + (\+), then I am getting switch parse errors.
Kind regards
Joern
Von: "Ken Rice" <krice at freeswitch.org>
An: "FreeSWITCH Users Help" <freeswitch-users at lists.freeswitch.org>
Gesendet: Freitag, 11. September 2015 04:13:59
Betreff: Re: [Freeswitch-users] Replacing leading "+" in outgoing numbers
\d* is wrong… should be \d+ or maybe \d.*
From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Jörn Ott
Sent: Thursday, September 10, 2015 7:16 AM
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
Subject: [Freeswitch-users] Replacing leading "+" in outgoing numbers
Hello all,
I am using FusionPBX and freeswitch. Incoming calls are signalled with a leading + and also stored in the snom phones call lists. If someone tries to call back an external caller, I tried to strip off the leading + on the outgoing call with the following condition:
<extension name="ext.ddddd" >
<condition field="destination_number" expression="^\+(\d\d\d\d\d*)$" >
<action application="set" data="sip_h_X-accountcode=${accountcode}" />
<action application="set" data="sip_h_X-Tag=" />
<action application="set" data="call_direction=outbound" />
<action application="set" data="hangup_after_bridge=true" />
<action application="set" data="inherit_codec=true" />
<action application="set" data="ignore_display_updates=true" />
<action application="set" data="callee_id_number=$1" />
<action application="set" data="continue_on_fail=true" />
<action application="set" data="outbound_prefix=+" />
<action application="bridge" data="sofia/gateway/781c8f7f-5d96-4e9e-8939-423b883cb675/$1" />
</condition>
</extension>
Sadly, the condition field already generates compile error.
Can you give me a hint, how I can strip the + from the dialled number?
Kind regards
Joern
--
--
Jörn Ott
Systemadministrator
Chefkoch GmbH
Joseph-Schumpeter-Allee 33
53227 Bonn
Telefon +49 228 28669-50
Telefax +49 228 28669-511
joern.ott at ext.chefkoch.de | http://www.chefkoch.de
HRB 18761, Amtsgericht Bonn
Geschäftsführer: Martin Meister, Sven Giebler, Arne Wolter
Ein Unternehmen von Gruner+Jahr.
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com
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/20150911/861448a2/attachment-0001.html
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list