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@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.
Your condition is wrong, try something like \+?(\d{10,}) this will strip the leading + for sure 2015-09-10 8:16 GMT-04:00 Jörn Ott <joern.ott@ext.chefkoch.de>:
^\+(\d\d\d\d\d*)$
Luis Daniel Lucio Quiroz CISSP, CISM, CISA Linux, VoIP and much more fun www.okay.com.mx Need LCR? Check out LCR for FusionPBX with FreeSWITCH Need Billing? Check out Billing for FusionPBX with FreeSWITCH
Hello Luis Daniel, thanks a lot, this works like a charm. kind regards Joern Von: "Luis Daniel Lucio Quiroz" <luis.daniel.lucio@gmail.com> An: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Gesendet: Freitag, 11. September 2015 04:04:18 Betreff: Re: [Freeswitch-users] Replacing leading "+" in outgoing numbers Your condition is wrong, try something like \+?(\d{10,}) this will strip the leading + for sure 2015-09-10 8:16 GMT-04:00 Jörn Ott < joern.ott@ext.chefkoch.de > : ^\+(\d\d\d\d\d*)$ Luis Daniel Lucio Quiroz CISSP, CISM, CISA Linux, VoIP and much more fun www.okay.com.mx Need LCR? Check out LCR for FusionPBX with FreeSWITCH Need Billing? Check out Billing for FusionPBX with FreeSWITCH _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
"^\+(\d{5,})$" ? On Thursday, September 10, 2015, Jörn Ott <joern.ott@ext.chefkoch.de> wrote:
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@ext.chefkoch.de <javascript:_e(%7B%7D,'cvml','joern.ott@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.
-- Ítalo Rossi italo@freeswitch.org
\d* is wrong… should be \d+ or maybe \d.* From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Jörn Ott Sent: Thursday, September 10, 2015 7:16 AM To: FreeSWITCH Users Help <freeswitch-users@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@ext.chefkoch.de <mailto:joern.ott@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.
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@freeswitch.org> An: "FreeSWITCH Users Help" <freeswitch-users@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@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Jörn Ott Sent: Thursday, September 10, 2015 7:16 AM To: FreeSWITCH Users Help <freeswitch-users@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@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I use mod_translate for that sort of thing but that's personal preference. On 11 September 2015 at 09:28, Jörn Ott <joern.ott@ext.chefkoch.de> wrote:
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@freeswitch.org> *An: *"FreeSWITCH Users Help" <freeswitch-users@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@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Jörn Ott *Sent:* Thursday, September 10, 2015 7:16 AM *To:* FreeSWITCH Users Help <freeswitch-users@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@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- *Andrew Cassidy BSc (Hons) MBCS SSCA* Managing Director *T <info@cassidywebservices.co.uk> *03300 100 960 *F <info@cassidywebservices.co.uk> *03300 100 961 *E <info@cassidywebservices.co.uk> *andrew@cassidywebservices.co.uk *W <info@cassidywebservices.co.uk> *www.cassidywebservices.co.uk
Hello Andrew, some preliminary tests show that it works. I have to rebuild the docker image to get the mod to be built however, so I can't do this in production right away but it looks like I can consolidate a few rules with that. thanks for your help Joern Von: "Andrew Cassidy" <andrew@cassidywebservices.co.uk> An: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Gesendet: Freitag, 11. September 2015 10:37:04 Betreff: Re: [Freeswitch-users] Replacing leading "+" in outgoing numbers I use mod_translate for that sort of thing but that's personal preference. On 11 September 2015 at 09:28, Jörn Ott < joern.ott@ext.chefkoch.de > wrote: 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@freeswitch.org > An: "FreeSWITCH Users Help" < freeswitch-users@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@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org ] On Behalf Of Jörn Ott Sent: Thursday, September 10, 2015 7:16 AM To: FreeSWITCH Users Help < freeswitch-users@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@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org -- Andrew Cassidy BSc (Hons) MBCS SSCA Managing Director T 03300 100 960 F 03300 100 961 E andrew@cassidywebservices.co.uk W www.cassidywebservices.co.uk _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (5)
-
Andrew Cassidy
-
Jörn Ott
-
Ken Rice
-
Luis Daniel Lucio Quiroz
-
Ítalo Rossi