[Freeswitch-users] Direct inward dialling

Michael Collins msc at freeswitch.org
Tue May 25 17:34:46 PDT 2010


On Tue, May 25, 2010 at 5:27 PM, RR <ranjtech at gmail.com> wrote:

> Ok, so I take that back. This seems to only work when the dialplan has a
> specific ANI and DNIS / destination_number / sip_to_user defined. If this is
> more general
>
> like
>
> <include>
>   <extension name="public_did">
>     <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$"
> break="never">
>         <action application="set" data="effective_caller_id_number=$2"/>
>         <action application="set" data="effective_caller_id_name=$2"/>
>     </condition>
>     <condition field="${sip_to_user}"
> expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never">
>       <action application="set" data="continue_on_fail=false"/>
>       <action application="set" data="hangup_after_bridge=true"/>
>       <action application="set" data="domain_name=$${domain}"/>
>       <action application="set" data="bypass_media=true"/>
>       <action application="limit_hash" data="in cc_blades 4200
> !USER_BUSY"/>
>       <action application="bridge"
> data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/>
>     </condition>
>   </extension>
> </include>
>
> then even though the expression/conditions seem to match, none of the
> digits are being stripped off. Shouldn't this be stripping off digits??
>
> Here's the debug output:
>
> Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did]
> ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never
> Dialplan: sofia/external/16469NNNNNN Action
> set(effective_caller_id_number=16469NNNNNN)
> Dialplan: sofia/external/16469NNNNNN Action
> set(effective_caller_id_name=16469NNNNNN)
> Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did]
> ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~
> /^(\+1?|\+|1?|011?)(\d+).*$/ break=never
> Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false)
> Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true)
> Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166)
> Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true)
> Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200
> !USER_BUSY)
> Dialplan: sofia/external/16469NNNNNN Action
> bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN)
>
> why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped
> off???
>

Regex 101 :)

The 1 or the 011 are in $1
-MC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100525/4e9b447a/attachment.html 


More information about the FreeSWITCH-users mailing list