<div dir="ltr">Hi all<br><br>i am learn how to use the acc module, the config is show below, i intend to use mysql to store all call with 200ok but when i make call i got nothing in the acc table of mysql and got the problem <br>
<br>[root@computer1 ~]# tail -f /var/log/messages<br>
Oct 12 10:45:42 computer1 /sbin/opensips[3730]: INFO:registrar:mod_init: initializing...<br>
Oct 12 10:45:42 computer1 /sbin/opensips[3730]: INFO:textops:mod_init: initializing...<br>
Oct 12 10:45:42 computer1 /sbin/opensips[3730]: INFO:auth:mod_init: initializing...<br>
Oct 12 10:45:42 computer1 /sbin/opensips[3730]: INFO:auth_db:mod_init: initializing...<br>
Oct 12 10:45:42 computer1 /sbin/opensips[3730]: INFO:acc:mod_init: initializing...<br>
Oct 12 10:45:42 computer1 /sbin/opensips[3730]: INFO:core:probe_max_receive_buffer: using a UDP receive buffer of 255 kb<br>
Oct 12 10:45:42 computer1 /sbin/opensips[3730]: INFO:core:probe_max_receive_buffer: using a UDP receive buffer of 255 kb<br>
Oct 12 10:45:48 computer1 /sbin/opensips[3750]: ERROR:tm:t_forward_nonack: no branch for forwarding<br>
Oct 12 10:45:48 computer1 /sbin/opensips[3750]: ERROR:tm:w_t_relay: t_forward_nonack failed<br>
Oct 12 10:45:50 computer1 /sbin/opensips[3741]:
CRITICAL:tm:t_should_relay_response: pick_branch failed (lowest==-1)
for code 480<br>
<br><br><br>but when i comment the t_relay(); it works fine but not show up the calling number + called number<br>+----+--------+----------+----------+----------------------------------------------+----------+------------+---------------------+----------+--------+<br>
| id | method | from_tag | to_tag | callid | sip_code | sip_reason | time | from_uri | to_uri |<br>+----+--------+----------+----------+----------------------------------------------+----------+------------+---------------------+----------+--------+<br>
| 7 | INVITE | 1b521e5d | 3b07760d | ZmY3OGZmZmMzY2UzNjZjNTE5YTU2MDBmMTFiM2UzZTQ. | 200 | OK | 2008-10-12 10:55:05 | | |<br>| 8 | BYE | 3b07760d | 1b521e5d | ZmY3OGZmZmMzY2UzNjZjNTE5YTU2MDBmMTFiM2UzZTQ. | 200 | OK | 2008-10-12 10:55:16 | | |<br>
| 6 | INVITE | 3558b765 | d0742f7e | MzI3N2RhOWFmYjUwYWZmNzg0ZWM2NTQwZGNmMmQ1MGQ. | 200 | OK | 2008-10-12 10:43:30 | | |<br>+----+--------+----------+----------+----------------------------------------------+----------+------------+---------------------+----------+--------+<br>
<br>what is the difference between have t_relay() and not have t_replay()?<br>i follow the Gerenal example : <br> <a href="http://www.sfr-fresh.com/unix/privat/opensips-1.4.0-tls_src.tar.gz:a/opensips-1.4.0-tls/modules/acc/README">http://www.sfr-fresh.com/unix/privat/opensips-1.4.0-tls_src.tar.gz:a/opensips-1.4.0-tls/modules/acc/README</a><br>
<br><br>how do i use the text file instead of mysql<br><br><br>loadmodule "acc.so"<br>modparam("acc", "db_flag", 2)<br>modparam("acc", "db_url", "mysql://opensips:opensipsrw@localhost/opensips") # use mysql engine<br>
modparam("acc", "db_table_acc", "acc")<br><br><br>route{<br> if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","Too Many Hops");<br>
exit;<br> }<br> if (msg:len >= 2048 ) {<br> sl_send_reply("513", "Message too big");<br> exit;<br> };<br> if (loose_route()) {<br> # mark routing logic in request<br>
append_hf("P-hint: rr-enforced\r\n");<br> if (is_method("BYE"))<br> setflag(2);<br> route(1);<br> };<br> if (is_method("PUBLISH|SUBSCRIBE"))<br>
{<br> sl_send_reply("503", "Service Unavailable");<br> exit;<br> }<br> if (is_method("REGISTER"))<br> {<br> # authenticate the REGISTER requests (uncomment to enable auth)<br>
if(!www_authorize("", "subscriber")){<br> www_challenge("", "0");<br> consume_credentials();<br> exit;<br>
}<br><br> if (!check_to())<br> {<br> sl_send_reply("403","Forbidden auth ID");<br> exit;<br> }<br>
<br><br> if (!save("location"))<br> sl_reply_error();<br><br> exit;<br> }<br> if (!lookup("location")) {<br> switch ($retcode) {<br>
case -1:<br> case -3:<br> t_newtran();<br> t_reply("404", "Not Found");<br> exit;<br>
case -2:<br> sl_send_reply("405", "Method Not Allowed");<br> exit;<br> }<br> }<br> if (!method=="REGISTER"){<br>
route(2);<br> }<br> route(1);<br>}<br>route[1] {<br> # send it out now; use stateful forwarding as it works reliably<br> # even for UDP2TCP<br> if (!t_relay()) {<br> sl_reply_error();<br>
};<br> exit;<br>}<br>route[2] {<br> if (is_method("INVITE")){<br> if (!proxy_authorize("", "subscriber")) {<br> proxy_challenge("", "0"); # Realm will be autogenerated<br>
consume_credentials();<br> };<br> setflag(2);<br> t_relay(); /* enter stateful mode now */<br> }<br> record_route();<br>}<br><br>Thank you<br>
Ha`<br><br></div>