[Freeswitch-users] dialplan condition do string comparison

Brian West brian at freeswitch.org
Thu Aug 21 08:43:45 PDT 2008


On Aug 21, 2008, at 5:32 AM, Lee JJ wrote:

> Hello :
>
> So far I test 2 sip profiles, thinking the dialplan logic
>
> if sip_from_host == sip_to_host {
> // this part is searching 2 groups user registered directly
>      do dialplan XML processing
>      do bridge sofia/...
> //  otherwise looking outside
> }else {
>      do dialplan ENUM processing
> }
>
> Can the dialplan condition do string comparison ?
> e.g. "${sip_from_host} == ${sip_to_host}"
> otherwise something like this
>

I would express that something like this:

<extension name="example">
   <condition field="${sip_from_host}" expression="^${sip_to_host}$">
     <action application="bridge" data="sofia/blah/blah"/>
     <anti-action application="transfer enum ${destination_number}"/>
   </condition>
</extension>


> <condition field="${sip_from_host}" expression="210.2xx.xx.xx"/>
> <condition field="${sip_to_host}" expression="210.2xx.xx.xx">
> <action ....
>
>
> I finally got some experience of multiple sip profiles.
> Some key points
> # under sip_profiles directory #
> <param name="context" value="inter2"/>
> <param name="dialplan" value="ENUM"/>

If you set the dialplan to this then you get no option it goes  
straight to enum.    Now you can do "XML,enum"  As long as anything in  
the XML dialplan doesn't do anything it should fail over to enum.  but  
see above.

>
> # user config file
> <variable name="user_context" value="inter2"/>
>
>
> # enum.conf.xml
> <routes>
> <route service="E2U+SIP" regex="sip:(.*)" replace="sofia/$ 
> {sofia_profile_name}/$1"/>
>
> Wondering can this ENUM work out ?
> <route service="E2U+SIP" regex="sip:^(.*)$\@${sophia_profile_name}"  
> replace="sofia/${sophia_profile_name}/$1"/>
>
> However I still think the FreeSwitch should do DNS , or SRV lookup  
> first !

So you're saying we should do an SRV lookup and totally IGNORE what  
the enum from e164.org says?  Thats wrong.  If you transfer it to enum  
its going to do the enum and go to exactly what its told to do so...  
if that target resolves to an srv sofia will follow that.  But doing  
an srv before the enum isn't the right way.


>
> It should not query ENUM first .
> 21  11.653138 210.2x.x.x -> 202.y.y.y DNS Standard query NAPTR  
> 2.9.9.9.e164.org

Again you told it to go to enum... isn't that exactly what it should  
do.  Why would we do a srv before that unless I'm missing your point  
here.


>
> # dialplan
> <action application="transfer" data="$1 enum"/ >  this syntax also  
> working !
>
> thanks !
> _______________________________________________
> 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

Brian West
sip:brian at freeswitch.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080821/3b303c6b/attachment-0002.html 


More information about the FreeSWITCH-users mailing list