[Freeswitch-users] Replacing leading "+" in outgoing numbers

Ken Rice krice at freeswitch.org
Fri Sep 11 06:13:59 MSD 2015


\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 <mailto: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.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150910/f1a6abb3/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list