[Freeswitch-users] Routing calls based on 'Referred-By'

Anthony Minessale anthony.minessale at gmail.com
Thu Jul 17 06:19:34 PDT 2008


if both field and expression are not present in the <condition> tag.  It is
instantly evaluated as true without performing the regex.  Therefore there
is no expansion and the $1 will remain $1.

Notice all you examples that do not work are missing the field=

e.g.
<condition "${sip_referred_by_user}" expression="4473451">


On Thu, Jul 17, 2008 at 4:08 AM, Matt Darnell <mattdarnell at gmail.com> wrote:

> On Wed, Jul 16, 2008 at 10:59 PM, Matt Darnell <mattdarnell at gmail.com>
> wrote:
> >> I would like the dial plan to route based on the number in the
> >> Refered-By or Diversion field.
> >
> >    <extension name="Mailbox_4473451">
> >      <condition "${sip_referred_by_user}" expression="4473451">
> >        <action application="info"/>
> >        <action application="export" data="sip_h_Diversion=3451"/>
> >        <action application="bridge"
> > data="{absolute_codec_string=PCMA}sofia/gateway/gw.akamaitel.com/3451"/>
> >      </condition>
> >    </extension>
> >
> >    <extension name="Mailbox_4473452">
> >      <condition "${sip_referred_by_user}" expression="4473452">
> >        <action application="info"/>
> >        <action application="export" data="sip_h_Diversion=3452"/>
> >        <action application="bridge"
> > data="{absolute_codec_string=PCMA}sofia/gateway/gw.akamaitel.com/3452"/>
> >      </condition>
> >    </extension>
> >
> > For some reason, all calls go to the first extension.  When I look at
> > the out put from info, the sip_referred_by_user is 4473452 but it
> > still routes to the first extension.
> > variable_sip_referred_by_user: [4473452]
> >
> > I have even changed the condition statement of the first extensin to :
> > <condition "${sip_referred_BOGUS_by_user}" expression="4473451">
> > and it still executes that extension.
> >
> > Please let me know if you can see the issue.
> >
> > -Matt
> >
>
> Another interesting thing is that if I have this:
>    <extension name="Mailbox_4473451">
>      <condition "${sip_referred_by_user}" expression="^\d{3}(\d{4})$">
>        <action application="info"/>
>        <action application="export" data="sip_h_Diversion=$1"/>
>        <action application="bridge"
> data="{absolute_codec_string=PCMA}sofia/gateway/gw.akamaitel.com/$1"/>
>      </condition>
>    </extension>
>
> $1 does not get populated with \d{4}, the invite has $1 in the string.
>
> This however works fine:
> <condition field="destination_number" expression="^\d{3}(\d{4})$">
>
> -Matt
>
> _______________________________________________
> 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/

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>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080717/e5995b5f/attachment-0002.html 


More information about the FreeSWITCH-users mailing list