Technically that is not a big issue, however I will explain it for the sake of discussion. The ^ and $ are "anchors" for the beginning and end of the string. Consider these patterns:<br><br>\d (match a single digit)<br>
\d+ (match one or more digits)<br>^\d+ (match a string that begins with one or more digits)<br>\d+$ (match a string that ends with one or more digits)<br>^\d+$ (match a string that contains only one or more digits)<br><br>
So, the pattern ^(\d+) literally means:<br>"Match a string that begins with one or more digits and capture those digits into the variable $1."<br><br>The only issue with not having a $ at the end of the pattern is that there could be other stuff in the string after the digits. For example, these strings would all match the pattern "^(\d+)":<br>
<br>1x<br>43abc<br>12345abcd<br>998877LA_LA_LA_WHATEVER<br>18005551212!hoohah<br><br>If you added the $ at the end of the pattern then none of the above strings would match.<br><br>Hope that makes sense....<br><br>-MC<br>
<br><div class="gmail_quote">On Tue, Feb 7, 2012 at 11:46 AM, Bote Man <span dir="ltr"><<a href="mailto:bote_radio@botecomm.com">bote_radio@botecomm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am an absolute newbie to FS, but from reading about dialplan regular<br>
expressions this morning I would guess that this line:<br>
<br>
<condition field="caller_id_number" expression="^(\d+)"><br>
<br>
is missing the required trailing "$" to end the regular expression.<br>
<br>
It should be:<br>
<condition field="caller_id_number" expression="^(\d+)$"><br>
<br>
no?<br>
<br>
Bote<br>
<br>
<br>
> -----Original Message-----<br>
> From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a><br>
> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>] On Behalf Of<br>
> George Sapak<br>
> Sent: Tuesday, 07 February, 2012 11:30<br>
> To: FreeSWITCH Users Help<br>
> Subject: Re: [Freeswitch-users] sip_invite_from_params<br>
><br>
> i already have it setup, my calls go through to the right extensions<br>
> and I have done some rewitting in public.xml file, but I have having<br>
> some wierdness on the handsets with call ID, when the phone rings the<br>
> ID show correctly but when its picked up it shows it with the<br>
> ;national... sting included.<br>
><br>
> Here is how I have done the routing and rewritte:<br>
><br>
><br>
> <extension name="105"><br>
> <condition expression="public" field="context"/><br>
> <condition field="destination_number"<br>
> expression="^403XXXXXXX(.+)$"><br>
> <action application="transfer" data="105 XML default"/><br>
> </condition><br>
> </extension><br>
><br>
> public.xml<br>
> <extension name="set caller id" continue="true"><br>
> <condition field="caller_id_number" expression="^(\d+)"><br>
> <action application="set" data="caller_id_number=$1"/><br>
> <action application="set" data="effective_caller_id_number=$1"/><br>
> </condition><br>
> </extension><br>
><br>
><br>
> Thank You,<br>
> George<br>
><br>
> ----- Original Message -----<br>
> From: "Brian West" <<a href="mailto:brian@freeswitch.org">brian@freeswitch.org</a>><br>
> To: "FreeSWITCH Users Help" <<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>><br>
> Sent: Tuesday, February 7, 2012 8:43:54 AM<br>
> Subject: Re: [Freeswitch-users] sip_invite_from_params<br>
><br>
><br>
> Why? What is your goal? This should be a simple dialplan rewrite<br>
> really.<br>
><br>
><br>
> /b<br>
><br>
><br>
><br>
> On Feb 7, 2012, at 9:27 AM, George Sapak wrote:<br>
><br>
><br>
> can someone give me an example in use, I have looked at the wiki and<br>
> its pretty unclear, I am trying to remove a string in an invite -><br>
> ;phone-context=national<br>
><br>
> INVITE sip:403XXXXXXX;phone-context=<a href="mailto:national@10.185.16.170">national@10.185.16.170</a>;user=phone<br>
> SIP/2.0<br>
> Via: SIP/2.0/UDP<br>
> 10.185.16.169:5060;branch=z9hG4bKght6ecqg4eh7d5sluaj9cl2rr4<br>
> From: "Caller"< sip:403YYYYYYY;phone-<br>
> context=<a href="mailto:national@10.185.16.169">national@10.185.16.169</a>;user=phone;isup-oli=00 >;tag=SDj6q1a01-<br>
> 98964<br>
> To: < sip:403XXXXXXX;phone-context=<a href="mailto:national@10.185.16.170">national@10.185.16.170</a>;user=phone ><br>
> Call-ID: SDj6q1a01-2afa0c6426482b0cfa2885f32878c86c-o0t3g30<br>
> CSeq: 62218 INVITE<br>
> Content-Type: application/sdp<br>
> Contact: < sip:403YYYYYYY;phone-<br>
> context=national@10.185.16.169:5060;transport=udp ><br>
> User-Agent: Nortel SESM 14.0.6.0<br>
> Max-Forwards: 19<br>
> Supported: com.nortelnetworks.firewall,p-3rdpartycontrol,nosec,join,x-<br>
> nortel-sipvc,com.nortelnetworks.im.encryption,r eplaces,100rel,tdialog<br>
> Allow: UPDATE,REFER<br>
> x-nt-corr-id: 871f3514-29e7-1b21-a633-000e0cb7d3a0<br>
> x-nt-location: -1<br>
> Content-Length: 206<br>
> Route: < sip:403XXXXXXX;phone-<br>
> context=national@10.185.16.170:5060;user=phone;lr ><br>
><br>
><br>
> Thank You,<br>
> George<br>
><br>
> --<br>
> Brian West<br>
> FreeSWITCH Solutions, LLC<br>
> Phone: <a href="tel:%2B1%20%28918%29%20420-9266" value="+19184209266">+1 (918) 420-9266</a><br>
> Fax: <a href="tel:%2B1%20%28918%29%20420-9267" value="+19184209267">+1 (918) 420-9267</a><br>
> <a href="mailto:brian@freeswitch.org">brian@freeswitch.org</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
> ______________________________________________________________________<br>
> ___<br>
> Professional FreeSWITCH Consulting Services:<br>
> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
> <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
><br>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
><br>
> Official FreeSWITCH Sites<br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
><br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-</a><br>
> users<br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
> ______________________________________________________________________<br>
> ___<br>
> Professional FreeSWITCH Consulting Services:<br>
> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
> <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
><br>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
><br>
> Official FreeSWITCH Sites<br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
><br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-</a><br>
> users<br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br>