Honestly, you'd be better off matching with $ruri.user and not the full RURI unless you really mean that. <div><br></div><div>FWIW, I can't imagine that "sip:1[0-9]{3}@localhost" would *ever* match.</div>
<div><br></div><div>Why don't you set an xlog showing what the RURI is, then write a regex you know matches that?</div><div><br></div><div>Did you try my suggestions? What exactly are you trying to do? There are lots of ways to rewrite the RURI.</div>
<div>-Brett</div><div><br></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><span class="Apple-style-span" style="font-size: 13px; "><a href="mailto:3%7D@192.168.3.20" style="color: rgb(20, 125, 186); "></a></span><br>
</span></font><div class="gmail_quote">On Wed, Oct 14, 2009 at 2:08 AM, Indiver <span dir="ltr"><<a href="mailto:nehru.indu@gmail.com">nehru.indu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi Brett,<br>
Thanks for your quick response. I tested with the criteria you have given<br>
but in vain. I had followed the following scenario for dialplan module.<br>
<br>
Step 1: Added rules in opensips-cp as follows:<br>
Matching Regular Expression: sip:1[0-9]{3}@localhost<br>
Substitution Regular Expression: sip:1[0-9]{3}@localhost<br>
Replacement Expression: sip:1[0-9]{<a href="mailto:3%7D@192.168.3.20">3}@192.168.3.20</a><br>
<br>
Step 2: Entered data in opensips.cfg as follows<br>
<br>
loadmodule ="dialplan.so"<br>
<div class="im"> modparam("dialplan", "db_url",<br>
"mysql://opensips:opensipsrw@localhost/opensips")<br>
</div> route[10]<br>
{<br>
dp_translate("1", "$var(ruri)/$var(tmp)");<br>
}<br>
The logs shows dialplan module and regexpressions loaded. But the call is<br>
not routing from dialplan rules. Is my procedure is correct.<br>
<div><div></div><div class="h5"><br>
<br>
<br>
Brett Nemeroff wrote:<br>
><br>
> Your very close..<br>
> look, your regex shows ^67.+ (starts with 67)<br>
><br>
> BUT your string does NOT start with 67. it starts with sip:67 (ie: "si" !=<br>
> "67") so it just doesn't match.<br>
><br>
> Also, I wouldn't use the $var vars here.. instead try:<br>
> dp_translate("1", "$ruri.user/$ruri.user")<br>
><br>
> THEN your shown regex will work ($ruri.user is just the dialed number,<br>
> does<br>
> not contain the sip:)<br>
> -Brett<br>
><br>
> On Tue, Oct 13, 2009 at 3:05 AM, Indiver <<a href="mailto:nehru.indu@gmail.com">nehru.indu@gmail.com</a>> wrote:<br>
><br>
>><br>
>> HI Everyone,<br>
>><br>
>> I want to implement the dialplan module. But i was confused little bit in<br>
>> the configuration part. my database table of dialplan module is<br>
>><br>
>><br>
>> +----+------+----+----------+-----------+-----------+-----------+------------------+-------+<br>
>> | id | dpid | pr | match_op | match_exp | match_len | subst_exp |<br>
>> repl_exp<br>
>> | attrs |<br>
>><br>
>> +----+------+----+----------+-----------+-----------+-----------+------------------+-------+<br>
>> | 1 | 1 | 1 | 1 | (^67.+) | 0 | (^67.+) | [hidden<br>
>> email] | |<br>
>><br>
>> +----+------+----+----------+-----------+-----------+-----------+------------------+-------+<br>
>><br>
>> and my opensips.cfg configuration is:<br>
>><br>
>> modparam("dialplan", "db_url",<br>
>> "mysql://opensips:opensipsrw@localhost/opensips")<br>
>><br>
>> route[14]<br>
>> {<br>
>> $var(x) = "sip:678";<br>
>> dp_translate("1", "$var(x)/$var(tmp)");<br>
>> xlog("-------------$var(tmp)\n");<br>
>> }.<br>
>><br>
>> My actual intention is when the client dials the number 678... a prefix 1<br>
>> should add to that numbers. Is the above configuration correct for my<br>
>> architecture?.<br>
>><br>
>> Thanks,<br>
>> Nehru.<br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://n2.nabble.com/Dialplan-module-not-working-tp3814747p3814747.html" target="_blank">http://n2.nabble.com/Dialplan-module-not-working-tp3814747p3814747.html</a><br>
>> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.<br>
>><br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
>> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
>><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
><br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://n2.nabble.com/Dialplan-module-not-working-tp3814747p3821039.html" target="_blank">http://n2.nabble.com/Dialplan-module-not-working-tp3814747p3821039.html</a><br>
</font><div><div></div><div class="h5">Sent from the OpenSIPS - Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>