Dear Ovidiu,
Thank you for your kind, and I solved it. You are right, it is cached mode.
Is it possible to always be loaded it from DB not in cache?
Thank you again.
Best regards,
Charles
2007/5/17, Ovidiu Sas <sip.nslu(a)gmail.com>om>:
Hi Charles,
Starting with 1.2 lcr is operating in cached mode and therefore there
will be no SQL queries during a call.
You can use `openserctl fifo lcr_dump' to check the content of your
tables.
Regards,
Ovidiu Sas
On 5/16/07, Charles Wang <lazy.charles(a)gmail.com> wrote:
Hi, Ovidiu,
I update the from_uri field from '%' to Empty string.
But the result is the same as before.
No any SQL command related to lcr or gw or gw_grp in my mysql.log during
I
make an offnet call.
Best regards,
Charles
2007/5/16, Ovidiu Sas <sip.nslu(a)gmail.com>om>:
> Hi Charles,
>
>
> In the lcr table you should have an empty string, not '%'.
>
>
> Regards,
> Ovidiu Sas
>
> On 5/16/07, Charles Wang <lazy.charles(a)gmail.com> wrote:
> > Hi all,
> >
> > I got this openser.cfg from
http://www.sipwise.com/wizard .
> > I tried to make a offnet call prefix with 00.
> >
> > I try to load_gws and next_gw for lcr.
> > But I can't find out such as "select xxx from lcr" or
"select xxx
from
gw"
> > during these steps in my mysql.log ( I opened the log file myself ).
And
> also
it will not redirect to the voice gateway.
>
> Is it the error of my schemas ? Any idea for it please.
>
>
> #################### /var/log/message ####################
> May 16 22:52:05 XXX /usr/local/sbin/openser[29112]: New request -
M=INVITE
> > RURI=sip:00862123456789@XXX.XXX.XXX F=sip:101@XXX.XXX.XXX
> > T=sip:00862123456789@XXX.XXX.XXX IP=61.217.XXX.XXX
> > ID= C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> > May 16 22:52:05 XXX /usr/local/sbin/openser[29112]: Proxy
authentication
>
failed - M=INVITE RURI=sip:00862123456789@XXX.XXX.XXX F=
sip:101@XXX.XXX.XXX
> T=sip:00862123456789@XXX.XXX.XXX
IP=61.217.XXX.XXX
> ID= C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: New request -
M=INVITE
> RURI=sip:00862123456789@XXX.XXX.XXX
F=sip:101@XXX.XXX.XXX
> T=sip:00862123456789@XXX.XXX.XXX IP=61.217.XXX.XXX
> ID= C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: Clear caller
preferences
> > - M=INVITE RURI=sip:00862123456789@XXX.XXX.XXX F=
sip:101@XXX.XXX.XXX
>
T=sip:00862123456789@XXX.XXX.XXX IP=61.217.XXX.XXX
> ID= C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: Load caller
preferences
> > for uuid '1' - M=INVITE RURI= sip:00862123456789@XXX.XXX.XXX F=
> > sip:101@XXX.XXX.XXX T=sip:00862123456789@XXX.XXX.XXX IP=
61.217.XXX.XXX
> ID=
C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: Clear callee
preferences
> > - M=INVITE RURI= sip:00862123456789@XXX.XXX.XXX F=
sip:101@XXX.XXX.XXX
> > T=sip:00862123456789@XXX.XXX.XXX
IP=61.217.XXX.XXX
> > ID=C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> > May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: Callee is not
local
-
> > M=INVITE RURI=sip:00862123456789@XXX.XXX.XXX F=sip:101@XXX.XXX.XXX
> > T= sip:00862123456789@XXX.XXX.XXX IP=61.217.XXX.XXX
> > ID=C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> > May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: Ready to Invite
To
> > External - M=INVITE
RURI=sip:00862123456789@XXX.XXX.XXX F=
> > sip:101@XXX.XXX.XXX T= sip:00862123456789@XXX.XXX.XXX IP=
61.217.XXX.XXX
>
ID=C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: Ready to 00 -
M=INVITE
> > RURI=sip:00862123456789@XXX.XXX.XXX F=sip:101@XXX.XXX.XXX
> > T=sip:00862123456789@XXX.XXX.XXX IP=61.217.XXX.XXX
> > ID=C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> > May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: Ready to Load
PSTN
> > gateways - M=INVITE
RURI=sip:00862123456789@XXX.XXX.XXX F=
> > sip:101@XXX.XXX.XXX T= sip:00862123456789@XXX.XXX.XXX IP=
61.217.XXX.XXX
> >
ID=C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> > May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: Ready to NextGW
-
> > M=INVITE
RURI=sip:00862123456789@XXX.XXX.XXX F=sip:101@XXX.XXX.XXX
> > T= sip:00862123456789@XXX.XXX.XXX IP=61.217.XXX.XXX
> > ID=C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> > May 16 22:52:05 XXX /usr/local/sbin/openser[29117]: No PSTN gateways
> > available - M=INVITE RURI=sip:00862123456789@XXX.XXX.XXX F=
> > sip:101@XXX.XXX.XXX T= sip:00862123456789@XXX.XXX.XXX IP=
61.217.XXX.XXX
> >
ID=C8F50846-1452-4EDC-9726-5A3AFECDF533(a)192.168.11.9
> >
> >
> >
> > #################### /tmp/mysql.log ####################
> > 070516 22:52:05 755 Query select password,uuid from
subscriber
> > where username='101' AND
domain='xxx.xxx.xxx'
> > 755 Query select value,attribute,type from
> > usr_preferences where uuid='1'
> > 755 Query select uuid from subscriber
where
> > username = '00862123456789'
> >
> >
> > ===> gw table
> > | id | gw_name | grp_id | ip_addr | port |
uri_scheme
|
> transport | strip | prefix |
> | 1 | my-test-gw | 1 | XXX.XXX.XXX.XXX | 5060 | 1
|
> > 1 | 0 | NULL |
> >
> > ===> gw schema
> > | Field | Type | Null | Key |
Default
|
> > Extra |
> > | id | int(10) | NO | PRI |
NULL
|
> > auto_increment |
> > | gw_name | varchar(128) | NO | UNI | NULL |
> > |
> > | grp_id | int(10) unsigned | NO | MUL | NULL |
> > |
> > | ip_addr | varchar(15) | NO | |
NULL |
> > |
> > | port | smallint(5) unsigned | YES | | NULL |
> > |
> > | uri_scheme | tinyint(3) unsigned | YES | | NULL |
> > |
> > | transport | tinyint(3) unsigned | YES | | NULL |
> > |
> > | strip | tinyint(3) unsigned | YES | | NULL |
> > | <=== it should be varchar ?
> > | prefix | varchar(16) | YES | |
NULL |
> > | <===
default value should be Empty or NULL
?
> >
> > ===> gw_grp table
> > | grp_id | grp_name |
> > | 1 | my-test-gw |
> >
> > ===> gw_grp schema
> > | Field | Type | Null | Key | Default |
Extra
> > |
> > | grp_id | int(10) unsigned | NO | PRI | NULL |
auto_increment
|
> > | grp_name | varchar(64) | NO | | NULL |
> > |
> >
> > ===> lcr table
> > | id | prefix | from_uri | grp_id | priority
|
> | 1
| 00862123456789 | % | 1 | 10 |
>
> ===> lcr schema
> | Field | Type | Null | Key | Default |
Extra
> |
> | id | int(10) | NO | PRI | NULL |
> auto_increment |
> | prefix | varchar(16) | NO | MUL | NULL |
> |
> | from_uri | varchar(128) | YES | MUL | NULL |
> |
> | grp_id | int(10) unsigned | NO | MUL | NULL |
> |
> | priority | tinyint(3) unsigned | NO | | NULL |
> |
>
>
>
> ################ parts of my openser.cfg
> #######################################
> loadmodule "lcr.so"
> modparam("lcr", "db_url",
> "mysql://openser:openserrw@localhost /openser")
> modparam("lcr", "gw_table", "gw")
> modparam("lcr", "gw_name_column", "gw_name")
> modparam("lcr", "ip_addr_column", "ip_addr")
> modparam("lcr", "port_column", "port")
> modparam("lcr", "uri_scheme_column", "uri_scheme")
> modparam("lcr", "transport_column", "transport")
> modparam("lcr", "grp_id_column", "grp_id")
> modparam("lcr", "lcr_table", "lcr")
> modparam("lcr", "strip_column", "strip")
> modparam("lcr", "prefix_column", "prefix")
> modparam("lcr", "from_uri_column", "from_uri")
> modparam("lcr", "priority_column", "priority")
> modparam("lcr", "gw_uri_avp", "1400")
> modparam("lcr", "ruri_user_avp", "1402")
> modparam("lcr", "contact_avp", "1401")
> modparam("lcr", "fr_inv_timer_avp",
"s:fr_inv_timer_avp")
> modparam("lcr", "fr_inv_timer", 90)
> modparam("lcr", "fr_inv_timer_next", 30)
> modparam("lcr", "rpid_avp", "s:rpid")
>
>
########################################################################
> # Request route
'invite-to-external'
>
########################################################################
> route[15]
> {
> xlog("L_INFO", "Ready to Invite To External - M=$rm RURI=$ru F=$fu
T=$tu
> > IP=$si ID=$ci\n");
> >
> > if(isflagset(20))
> > {
> >
> > xlog("L_INFO", "Call to foreign domain - M=$rm RURI=$ru F=$fu
T=$tu
IP=$si
> > ID=$ci\n");
> > route(11);
> > exit;
> > }
> > if(!isflagset(23))
> > {
> > # don't allow calls relaying from PSTN to PSTN, if not explicitely
> > forwarded
> > xlog("L_INFO", "Ready to 00 - M=$rm RURI=$ru F=$fu T=$tu
IP=$si
> > ID=$ci\n");
> > if(uri =~ "^sip:00[0-9]+@")
> > {
> > xlog("L_INFO", "Ready to Load PSTN gateways - M=$rm RURI=$ru
F=$fu
T=$tu
> > IP=$si ID=$ci\n");
> > # only route numeric users to PSTN
> > if(!load_gws())
> > {
> > xlog("L_INFO", "Ready to LoadGW - M=$rm RURI=$ru F=$fu T=$tu
IP=$si
> > ID=$ci\n");
> > xlog("L_ERR", "Error loading PSTN gateways - M=$rm RURI=$ru
F=$fu
T=$tu
> > IP=$si ID=$ci\n");
> > sl_send_reply("503", "PSTN Termination Currently
Unavailable");
> > exit;
> > }
> > if(!next_gw())
> > {
> >
> > xlog("L_INFO", "Ready to NextGW - M=$rm RURI=$ru F=$fu T=$tu
IP=$si
>
ID=$ci\n");
> xlog("L_ERR", "No PSTN gateways available - M=$rm RURI=$ru F=$fu
T=$tu
> IP=$si ID=$ci\n");
> sl_send_reply("503", "PSTN Termination Currently
Unavailable");
> exit;
> }
> setflag(21);
>
> t_on_failure("1");
> route(11);
> }
> }
>
> xlog("L_INFO", "Call to unknown user - M=$rm RURI=$ru F=$fu T=$tu
IP=$si
ID=$ci\n");
route(7);
sl_send_reply("404", "User Not Found");
exit;
}
--
Best Regards
Charles
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users
--
Best Regards
Charles