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