Looks better to me.. give it a shot and let us know if you still have trouble.<div>-Brett</div><div><br><br><div class="gmail_quote">On Tue, May 25, 2010 at 4:20 PM, Sean Salomon <span dir="ltr"><<a href="mailto:ssalomon@icoe.org">ssalomon@icoe.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Brett,<br>
<br>
Would I replace this<br>
<div class="im"><br>
dp_translate("2", "$ruri.user/$avp(s:dest)");<br>
xlog("translated to var $avp(s:dest) \n");<br>
<br>
<br>
</div>with the following, And that would push the translation on?<br>
<br>
dp_translate("2", "$ruri.user/$ruri.user")<br>
<br>
<br>
Sean Salomon<br>
<br>
From: <a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a> [mailto:<a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>] On Behalf Of Brett Nemeroff<br>
Sent: Tuesday, May 25, 2010 2:14 PM<br>
To: OpenSIPS users mailling list<br>
Subject: Re: [OpenSIPS-Users] Dial Plan Module<br>
<div><div></div><div class="h5"><br>
The problem is that:<br>
dp_translate("2", "$ruri.user/$avp(s:dest)");<br>
That line sticks the translated value into that avp and not into the ruri. So the lookup still looks at the originally dialed number<br>
<br>
-Brett<br>
<br>
<br>
<br>
On Tue, May 25, 2010 at 4:05 PM, Sean Salomon <<a href="mailto:ssalomon@icoe.org">ssalomon@icoe.org</a>> wrote:<br>
Hello,<br>
<br>
I am implementing the Dial Plan Module and I might be missing<br>
something. I added the module info for the opensips.cfg files as shown<br>
below. Created the translations. When running opensips in debug=8 I get<br>
the blow output. It appears to be matching to a rule, then properly<br>
translating. But then It doesn't appear to be passing the output and the<br>
call fails with a 404. Am I missing something?<br>
<br>
Thanks in advance..<br>
<br>
<br>
############## Dialplan entry into the opensips.cfg file ##############<br>
<br>
loadmodule "dialplan.so"<br>
#----- dialplan params -----<br>
modparam("dialplan", "db_url",<br>
"mysql://username:password@localhost/opensips")<br>
modparam("dialplan", "attrs_pvar", "$avp(s:dest)")<br>
<br>
<br>
# account only INVITEs<br>
if (is_method("INVITE")) {<br>
dp_translate("2", "$ruri.user/$avp(s:dest)");<br>
xlog("translated to var $avp(s:dest) \n");<br>
setflag(1); # do accounting<br>
<br>
############## Translation ##############<br>
<br>
mysql> select * from dialplan;<br>
+----+------+----+----------+-----------+-----------+-------------+-----<br>
-----+-------+<br>
| id | dpid | pr | match_op | match_exp | match_len | subst_exp |<br>
repl_exp | attrs |<br>
+----+------+----+----------+-----------+-----------+-------------+-----<br>
-----+-------+<br>
| 7 | 2 | 0 | 1 | ^5900+ | 0 | ^(5900)(.+) | \2<br>
| |<br>
+----+------+----+----------+-----------+-----------+-------------+-----<br>
-----+-------+<br>
1 row in set (0.00 sec)<br>
<br>
<br>
############## Debug=8 output ##############<br>
<br>
May 25 12:36:13 [5414] DBG:dialplan:dp_translate_f: input is 59008432<br>
May 25 12:36:13 [5414] DBG:dialplan:translate: regex operator testing<br>
May 25 12:36:13 [5414] DBG:dialplan:test_match: test string 59008432<br>
against a pattern ^5900+<br>
May 25 12:36:13 [5414] DBG:dialplan:test_match: test_match:[0] 5900<br>
May 25 12:36:13 [5414] DBG:dialplan:translate: found a matching rule<br>
0xb39e2498: pr 0, match_exp ^5900+<br>
May 25 12:36:13 [5414] DBG:dialplan:test_match: test string 59008432<br>
against a pattern ^(5900)(.+)<br>
May 25 12:36:13 [5414] DBG:dialplan:test_match: test_match:[0] 59008432<br>
May 25 12:36:13 [5414] DBG:dialplan:test_match: test_match:[1] 5900<br>
May 25 12:36:13 [5414] DBG:dialplan:test_match: test_match:[2] 8432<br>
May 25 12:36:13 [5414] DBG:dialplan:dp_translate_f: input 59008432 with<br>
dpid 2 => output 8432<br>
translated to var<br>
May 25 12:36:13 [5414] DBG:core:grep_sock_info: checking if host==us:<br>
14==9 && [<a href="http://sip.k12hsn.org" target="_blank">sip.k12hsn.org</a>] == [127.0.0.1]<br>
May 25 12:36:13 [5414] DBG:core:grep_sock_info: checking if port 5060<br>
matches port 5060<br>
May 25 12:36:13 [5414] DBG:core:grep_sock_info: checking if host==us:<br>
14==14 && [<a href="http://sip.k12hsn.org" target="_blank">sip.k12hsn.org</a>] == [207.62.103.166]<br>
May 25 12:36:13 [5414] DBG:core:grep_sock_info: checking if port 5060<br>
matches port 5060<br>
May 25 12:36:13 [5414] DBG:core:grep_sock_info: checking if host==us:<br>
14==9 && [<a href="http://sip.k12hsn.org" target="_blank">sip.k12hsn.org</a>] == [127.0.0.1]<br>
May 25 12:36:13 [5414] DBG:core:grep_sock_info: checking if port 5060<br>
matches port 5060<br>
May 25 12:36:13 [5414] DBG:core:grep_sock_info: checking if host==us:<br>
14==14 && [<a href="http://sip.k12hsn.org" target="_blank">sip.k12hsn.org</a>] == [207.62.103.166]<br>
May 25 12:36:13 [5414] DBG:core:grep_sock_info: checking if port 5060<br>
matches port 5060<br>
May 25 12:36:13 [5414] DBG:registrar:lookup: '59008432' Not found in<br>
usrloc<br>
<br>
Sean Salomon<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>
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>