[Freeswitch-users] matching word
Michael Collins
msc at freeswitch.org
Fri May 27 20:43:53 MSD 2011
On Thu, May 26, 2011 at 11:41 PM, Sam <u2nsam at gmail.com> wrote:
> Is my dialplan correct ?
>
I suppose that depends on what you're trying to do. I'm assuming you want to
send the call into the voicemail box for "sam". If so then your voicemail
action should be something like this:
<action application="voicemail" data="default ${domain} $1"/>
(Note that you don't need $$ for any channel variables; a single $ will
suffice.)
HTH,
MC
>
> <extension name="public_extensions">
> <condition field="destination_number" expression="^(sam)$">
> <action application="info"/>
> <action application="voicemail" data="default $${domain}
> ${sip_to_host}"/>
> </condition>
> </extension>
>
>
> I want to match three any alphanumeric 3 digit/letters
>
> Also i wan to store the voicemail into the folders where the herachy would
> be ::: Domain --> Username --> Voicemail file
>
> Regards
> Sam
>
>
>
>
> On Fri, May 27, 2011 at 12:19 AM, Michael Collins <msc at freeswitch.org>wrote:
>
>> Your regex is only going to match a single alphanumeric character. Are you
>> trying to match an actual email address or what? Once you know what you hope
>> to match it will be easier to know which regex to use. For the record a
>> semi-proper email grabbing regex is like this:
>>
>> ^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})$
>>
>> Matching emails is an interesting exercise. If you're not all into "making
>> it perfect" and just want to capture "foo at bar" then do something like
>> this:
>>
>> ^([^@]+ at .*)$
>>
>> -MC
>>
>>
>> On Thu, May 26, 2011 at 10:02 AM, Sam <u2nsam at gmail.com> wrote:
>>
>>> Thanks for that,
>>>
>>> I want to use that when someone with username sam at gmail.com will be
>>> routed to a voicemail dialplan, with domain partitioning.
>>>
>>> here still i am not able to achiveve it with domain.
>>>
>>> <domain name="gmail.com">
>>>
>>> <extension name="public_extensions">
>>> <condition field="destination_number" expression="^(\w)$">
>>> <action application="info"/>
>>> <action application="voicemail" data="default $${domain_name}
>>> $1"/>
>>> </condition>
>>> </extension>
>>>
>>> </domain>
>>>
>>> here above gmail.com is examplary .
>>>
>>> when there is an invite coming from different server to FS with
>>> sam at gmail.com and it is routed directly on voicemail context to route
>>> via public.xml
>>>
>>> here first the call is not recognized to the context gmail.com but when
>>> i remove that it goes to voicemail directly properly and stores the
>>> voicemail.
>>>
>>> but the voicemail is not stored under domain name gmail.com which should
>>> store it ideally under domain name as folder, which it is just storing it
>>> under user sam folder.
>>>
>>> This is what I want to achieve.
>>>
>>> Regards
>>> Sam
>>>
>>>
>>>
>>>
>>>
>>> On Thu, May 26, 2011 at 3:56 PM, mazilo <Nabble at slickdeals.endjunk.com>wrote:
>>>
>>>>
>>>> samir wrote:
>>>> >
>>>> > Friends,
>>>> >
>>>> > How can i match words in expressions,
>>>> >
>>>> > is it by expression="^(\y\w+\y)$" or could be something else.
>>>> >
>>>> > Regards
>>>> > Sam
>>>> I understand ^(\w)$ will match any word, but not with \y. Perhaps, if
>>>> you
>>>> tell us exactly what you want to accomplish, someone will chime in for a
>>>> better solution.
>>>>
>>>> -----
>>>> FreeSWITCH hosted on a Seagate DockStar with OpenWRT and ONLY consumes 3
>>>> Watts of electricity.
>>>> --
>>>> View this message in context:
>>>> http://freeswitch-users.2379917.n2.nabble.com/matching-word-tp6406170p6406420.html
>>>> Sent from the freeswitch-users mailing list archive at Nabble.com.
>>>>
>>>> _______________________________________________
>>>> 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
>>
>>
>
> _______________________________________________
> 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/20110527/3ab770ca/attachment.html
More information about the FreeSWITCH-users
mailing list