[Freeswitch-users] Direct inward dialling

RR ranjtech at gmail.com
Tue May 25 17:27:07 PDT 2010


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???

Thanks in Advance,
RR


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

> Thanks for pointing me in the right direction. What fixed it was adding a
> '*' which I used to have before but with all these changes I was making I
> forgot to add it back in. So doing this:
>
> <condition field="${sip_to_user}"
> expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).*$" break="never">
>
> works
> Thanks for the help
> \RR
>
>
> On Tue, May 25, 2010 at 6:10 PM, Anthony Minessale <
> anthony.minessale at gmail.com> wrote:
>
>> you probably have to remove the $ at the end to allow for the ;params
>>
>>
>> On Tue, May 25, 2010 at 4:43 PM, RR <ranjtech at gmail.com> wrote:
>>
>>> Hi Anthony,
>>>
>>> this is what I see in the debug:
>>>
>>> Dialplan: sofia/external/16469NNNNNN Regex (FAIL) [DIDtest]
>>> ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~
>>> /^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$/ break=on-false
>>>
>>> and then it moves on to another dialplan xml file.
>>>
>>> please note that info app shows:
>>>
>>> variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39]
>>>
>>> shouldn't this actually match??
>>>
>>> Oh and yes, the copy of FS is pretty old but this is a production system
>>> which gets 24 / 7 traffic so the upgrade is being pushed and pushed :(
>>>
>>> you think this is simply because it's an old build?
>>>
>>> Thanks
>>> RR
>>>
>>>
>>> On Tue, May 25, 2010 at 4:49 PM, Anthony Minessale <
>>> anthony.minessale at gmail.com> wrote:
>>>
>>>> did you turn up the debug (press f8 or type console loglevel debug)
>>>> The debug logs will show the data being passed into the regex and the
>>>> results.
>>>>
>>>> P.S.
>>>> I hope only your example is from years ago and not your copy of FS.
>>>>
>>>>
>>>> On Tue, May 25, 2010 at 3:40 PM, David Ponzone <david.ponzone at gmail.com
>>>> > wrote:
>>>>
>>>>> Which means there is no @ in the sip: part of the SIP To field. Only in
>>>>> the phone-context part.
>>>>> FS uses the @ to split the strings into pieces, and then in your case,
>>>>> it fails as one is missing.
>>>>>
>>>>>  David Ponzone  Direction Technique
>>>>> email: david.ponzone at ipeva.fr
>>>>> tel:      01 74 03 18 97
>>>>> gsm:   06 66 98 76 34
>>>>>
>>>>> Service Client IPeva
>>>>> tel:      0811 46 26 26
>>>>> www.ipeva.fr  -   www.ipeva-studio.com
>>>>>
>>>>> *Ce message et toutes les pièces jointes sont confidentiels et établis
>>>>> à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion
>>>>> non autorisée est interdite. Tout message électronique est susceptible
>>>>> d'altération. **IPeva** décline toute responsabilité au titre de ce
>>>>> message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas
>>>>> destinataire de ce message, merci de le détruire immédiatement et d'avertir
>>>>> l'expéditeur.*
>>>>> *
>>>>> *
>>>>>
>>>>>
>>>>>
>>>>> Le 25/05/2010 à 22:28, RR a écrit :
>>>>>
>>>>> Hi Guys,
>>>>>
>>>>> Thanks for the quick feedback
>>>>>
>>>>> David, no we're getting the full URI with the domain part intact, just
>>>>> nothing before the "<" braces
>>>>>
>>>>> Michael, I already tried the info app and we get
>>>>>
>>>>> variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39]
>>>>> variable_sip_to_uri: [011390NNNNNNNNNN;
>>>>> phone-context=+39 at 208.xx.xxx.xxx:5060]
>>>>>
>>>>> Thanks
>>>>> RR
>>>>>
>>>>>
>>>>> On Tue, May 25, 2010 at 4:12 PM, Michael Collins <msc at freeswitch.org>wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, May 25, 2010 at 12:48 PM, RR <ranjtech at gmail.com> wrote:
>>>>>>
>>>>>>> Hello I want to follow up on this example from YEARS ago. I had tried
>>>>>>> using the variable "destination_number" but that didn't work, and I figured
>>>>>>> that it was because the To: header doesn't have the destination_number but
>>>>>>> has just the URI, so I thought I'd use sip_to_user instead.
>>>>>>>
>>>>>>> We have calls coming in with the following info in the INVITE
>>>>>>>
>>>>>>> From: "16469NNNNNN" <
>>>>>>> sip:16469NNNNNN;phone-context=+1 at 67.1x.xxx.xxx:5060;user=phone
>>>>>>> >;tag=SDru6fc01-gK0c10a887.
>>>>>>> To: <
>>>>>>> sip:011390NNNNNNNNNN;phone-context=+39 at xxx.xxx.xxx.xxx:5060;user=phone
>>>>>>> >.
>>>>>>> (N and x are obviously being masked for privacy)
>>>>>>>
>>>>>>> I use this info in the dialplan like so
>>>>>>>
>>>>>>> <include>
>>>>>>>   <extension name="DIDtest">
>>>>>>>     <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).*$"
>>>>>>> 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?)(390NNNNNNNNNN).$" 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="bridge"
>>>>>>> data="{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2"/>
>>>>>>>     </condition>
>>>>>>>   </extension>
>>>>>>> </include>
>>>>>>>
>>>>>>> However, the calls aren't passing the condition in this dialplan and
>>>>>>> thus not being forwarded to "blade2" server. In fact, even the 011 is not
>>>>>>> being stripped off.
>>>>>>>
>>>>>>> What am I doing wrong?
>>>>>>>
>>>>>>
>>>>>> Create a quick test extension that only does an info dump. (See 9992
>>>>>> in default.xml for an example.) Make a call, look at the info dump, and make
>>>>>> sure that what you think you are getting is really what you are getting. :)
>>>>>>
>>>>>> -MC
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> 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
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Anthony Minessale II
>>>>
>>>> FreeSWITCH http://www.freeswitch.org/
>>>> ClueCon http://www.cluecon.com/
>>>>  Twitter: http://twitter.com/FreeSWITCH_wire
>>>>
>>>>
>>>> AIM: anthm
>>>> MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
>>>> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
>>>> IRC: irc.freenode.net #freeswitch
>>>>
>>>>
>>>> FreeSWITCH Developer Conference
>>>> sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
>>>> googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
>>>> pstn:+19193869900
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>>
>>
>>
>> --
>> Anthony Minessale II
>>
>> FreeSWITCH http://www.freeswitch.org/
>> ClueCon http://www.cluecon.com/
>> Twitter: http://twitter.com/FreeSWITCH_wire
>>
>> AIM: anthm
>> MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
>> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
>> IRC: irc.freenode.net #freeswitch
>>
>> FreeSWITCH Developer Conference
>> sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
>> googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
>> pstn:+19193869900
>>
>> _______________________________________________
>> 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/20100525/1a7a18af/attachment-0001.html 


More information about the FreeSWITCH-users mailing list