I'm able to make generic dialplan but don't know how to make subscriber based dialplan. Here is my generic dialplan sample config file and dialplan table;<div><br></div><div>----</div><div><br></div><div><div>loadmodule "avpops.so"</div>
<div>loadmodule "dialplan.so"</div><div><br></div><div><div>#------ avpops params -----</div><div>modparam("avpops", "db_url", "mysql://openser:openserrw@localhost/kamailio")</div><div>
modparam("avpops", "avp_table", "usr_preferences")</div><div>#------ load the dpid field to a pseudo-variable $avp(s:dpid) ------</div><div>### modparam("auth_db", "load_credentials", "$avp(s:rpid)=rpid ;$avp(s:countrycode)=contrycode;$avp(s:areacode)=areacode")</div>
<div><br></div><div>modparam("dialplan", "db_url","mysql://openser:openserrw@localhost/kamailio")</div><div>## attribute of the matched line will be store in the $avp(s:dest)</div><div>modparam("dialplan", "attrs_pvar", "$avp(s:dest)")</div>
</div><div><br></div><div><div>if(!dp_translate("0","$rU/$rU")){</div><div>send_reply("420", "Invalid Destination");</div><div>exit;</div><div>}</div><div>xlog("$avp(s:dest)");</div>
<div>if ($avp(s:dest)=="pstn") {</div><div>#route to pstn</div><div>prefix("+90454");</div><div>enum_query();</div><div>$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);</div><div>
route(RELAY);</div><div>}</div></div><div><br></div><div>----</div><div><br></div><div><div># kamctl db show dialplan</div><div>database engine 'MYSQL' loaded</div><div>Control engine 'FIFO' loaded</div><div>
+----+------+----+----------+------------------+-----------+--------------------+----------+-------+</div><div>| id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs |</div><div>
+----+------+----+----------+------------------+-----------+--------------------+----------+-------+</div><div>| 1 | 0 | 1 | 1 | ^[2-9][0-9]{6}.* | 0 | (^[2-9][0-9]{6}).* | 90212\1 | pstn |</div><div>
+----+------+----+----------+------------------+-----------+--------------------+----------+-------+</div></div><div><br><br><div class="gmail_quote">2012/1/31 Bayram Karagoz <span dir="ltr"><<a href="mailto:karagoz.bayram@gmail.com">karagoz.bayram@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div><div><br></div><div>I'm trying to make when each subscriber dials 7 digits add subscriber based specific prefix to dialed number defined in subscriber or dialplan table. I know that it's possible with avp but I'm not professional about avp. could you send me a successful scenario and config example please? </div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><b>Bayram KARAGOZ</b><br>System Administrator<br><br><a href="mailto:bayram@bayramkaragoz.org" target="_blank">bayram@bayramkaragoz.org</a><br><br><a href="http://www.bayramkaragoz.org" target="_blank">www.bayramkaragoz.org</a><br>
<br>
</div></div>