<div dir="ltr">After reading many docs, googled, chatgpt, I barely have a working configuration with only REGISTER working , but INVITE not working:<br><br>``` opensips.cfg<br>#<br># OpenSIPS residential configuration script<br># by OpenSIPS Solutions <<a href="mailto:team@opensips-solutions.com">team@opensips-solutions.com</a>><br>#<br># This script was generated via "make menuconfig", from<br># the "Residential" scenario.<br># You can enable / disable more features / functionalities by<br># re-generating the scenario with different options.#<br>#<br># Please refer to the Core CookBook at:<br># <a href="https://opensips.org/Resources/DocsCookbooks">https://opensips.org/Resources/DocsCookbooks</a><br># for a explanation of possible statements, functions and parameters.<br>#<br><br><br>####### Global Parameters #########<br><br>/* uncomment the following lines to enable debugging */<br>#debug_mode=yes<br><br>### default log level is 3, change to 4 for debugging<br>log_level=4<br>xlog_level=4<br>stderror_enabled=yes<br>syslog_enabled=yes<br>syslog_facility=LOG_LOCAL0<br><br>udp_workers=4<br><br>/* uncomment the next line to enable the auto temporary blacklisting of<br> not available destinations (default disabled) */<br>#disable_dns_blacklist=no<br><br>/* uncomment the next line to enable IPv6 lookup after IPv4 dns<br> lookup failures (default disabled) */<br>#dns_try_ipv6=yes<br><br><br>#socket=udp:<a href="http://127.0.0.1:5060">127.0.0.1:5060</a> # CUSTOMIZE ME<br>socket=udp:<a href="http://192.168.113.144:5060">192.168.113.144:5060</a><br>#listen=udp:<a href="http://192.168.113.144:5060">192.168.113.144:5060</a><br><br><br><br>####### Modules Section ########<br><br>#set module path<br>mpath="/usr/lib/x86_64-linux-gnu/opensips/modules/"<br><br><br>### add for freeswitch<br>loadmodule "db_postgres.so"<br><br><br>#### SIGNALING module<br>loadmodule "signaling.so"<br><br>#### StateLess module<br>loadmodule "sl.so"<br><br>#### Transaction Module<br>loadmodule "tm.so"<br>modparam("tm", "fr_timeout", 5)<br>modparam("tm", "fr_inv_timeout", 30)<br>modparam("tm", "restart_fr_on_each_reply", 0)<br>modparam("tm", "onreply_avp_mode", 1)<br><br>#### Record Route Module<br>loadmodule "rr.so"<br>/* do not append from tag to the RR (no need for this script) */<br>modparam("rr", "append_fromtag", 0)<br><br>### add for freeswitch<br>loadmodule "dialog.so"<br>modparam("dialog", "db_mode", 1)<br>modparam("dialog", "db_url", "postgres://<a href="http://opensips:opensipsrw@192.168.113.145/opensips">opensips:opensipsrw@192.168.113.145/opensips</a>")<br><br><br>#### MAX ForWarD module<br>loadmodule "maxfwd.so"<br><br>### add for freeswitch<br>loadmodule "textops.so"<br><br><br>#### SIP MSG OPerationS module<br>loadmodule "sipmsgops.so"<br><br>#### FIFO Management Interface<br>loadmodule "mi_fifo.so"<br>modparam("mi_fifo", "fifo_name", "/run/opensips/opensips_fifo")<br># not working either, modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")<br>modparam("mi_fifo", "fifo_mode", 0666)<br><br>### add for freeswitch<br>loadmodule "dispatcher.so"<br>modparam("dispatcher", "db_url", "postgres://<a href="http://opensips:opensipsrw@192.168.113.145/opensips">opensips:opensipsrw@192.168.113.145/opensips</a>")<br>modparam("dispatcher", "ds_ping_method", "OPTIONS")<br>modparam("dispatcher", "ds_ping_interval", 5)<br>modparam("dispatcher", "ds_probing_threshhold", 2)<br>modparam("dispatcher", "ds_probing_mode", 1)<br><br>### add for freeswitch<br>loadmodule "load_balancer.so"<br>modparam("load_balancer", "db_url", "postgres://<a href="http://opensips:opensipsrw@192.168.113.145/opensips">opensips:opensipsrw@192.168.113.145/opensips</a>")<br>modparam("load_balancer", "probing_method", "OPTIONS")<br>modparam("load_balancer", "probing_interval", 5)<br><br><br><br>#### USeR LOCation module<br>loadmodule "usrloc.so"<br>modparam("usrloc", "nat_bflag", "NAT")<br>modparam("usrloc", "working_mode_preset", "single-instance-no-db")<br><br>#### REGISTRAR module<br>loadmodule "registrar.so"<br>modparam("registrar", "tcp_persistent_flag", "TCP_PERSISTENT")<br>/* uncomment the next line not to allow more than 10 contacts per AOR */<br>#modparam("registrar", "max_contacts", 10)<br><br>#### ACCounting module<br>loadmodule "acc.so"<br>/* what special events should be accounted ? */<br>modparam("acc", "early_media", 0)<br>modparam("acc", "report_cancels", 0)<br>/* by default we do not adjust the direct of the sequential requests.<br> if you enable this parameter, be sure to enable "append_fromtag"<br> in "rr" module */<br>modparam("acc", "detect_direction", 0)<br><br>loadmodule "proto_udp.so"<br><br><br>#### gjw add for rtpengine<br>loadmodule "rtpengine.so"<br># single rtproxy<br>modparam("rtpengine", "rtpengine_sock", "udp:<a href="http://192.168.113.143:2223">192.168.113.143:2223</a>")<br># multiple rtproxies for LB<br>#modparam("rtpengine", "rtpengine_sock", "udp:localhost:12221 udp:localhost:12222")<br># multiple sets of multiple rtproxies<br>#modparam("rtpengine", "rtpengine_sock", "1 == udp:localhost:12221 udp:localhost:12222")<br>#modparam("rtpengine", "rtpengine_sock", "2 == udp:localhost:12225")<br><br>### add for freeswitch<br><br><br><br>####### Routing Logic ########<br><br># main request routing logic<br><br>route{<br><br>if (!mf_process_maxfwd_header(10)) {<br>send_reply(483,"Too Many Hops");<br>exit;<br>}<br><br>if (has_totag()) {<br><br># handle hop-by-hop ACK (no routing required)<br>if ( is_method("ACK") && t_check_trans() ) {<br>t_relay();<br>exit;<br>}<br><br># sequential request within a dialog should<br># take the path determined by record-routing<br>if ( !loose_route() ) {<br># we do record-routing for all our traffic, so we should not<br># receive any sequential requests without Route hdr.<br>send_reply(404,"Not here");<br>exit;<br>}<br><br>if (is_method("BYE")) {<br># do accounting even if the transaction fails<br>do_accounting("log","failed");<br>}<br><br># route it out to whatever destination was set by loose_route()<br># in $du (destination URI).<br>route(relay);<br>exit;<br>}<br><br># CANCEL processing<br>if (is_method("CANCEL")) {<br>if (t_check_trans())<br>t_relay();<br>exit; }<br><br># absorb retransmissions, but do not create transaction<br>t_check_trans();<br><br>if ( !(is_method("REGISTER") ) ) {<br><br>if (is_myself("$fd")) {<br><br>} else {<br># if caller is not local, then called number must be local<br><br>if (!is_myself("$rd")) {<br>send_reply(403,"Relay Forbidden");<br>exit;<br>}<br>}<br><br>}<br><br># preloaded route checking<br>if (loose_route()) {<br>xlog("L_ERR",<br>"Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");<br>if (!is_method("ACK"))<br>send_reply(403,"Preload Route denied");<br>exit;<br>}<br><br># record routing<br>if (!is_method("REGISTER|MESSAGE"))<br>record_route();<br><br># account only INVITEs<br>if (is_method("INVITE")) {<br><br># #do_accounting("log");<br># # Route to FreeSWITCH<br># $du = "sip:<a href="http://192.168.113.142:5060">192.168.113.142:5060</a>";<br># forward();<br><br>if (!load_balance(1,"pstn","1")) {<br> log("sreekanth invite method\n");<br> send_reply(503,"Service Unavailable");<br> exit;<br>}<br><br>}<br><br><br>if (!is_myself("$rd")) {<br>append_hf("P-hint: outbound\r\n");<br><br>route(relay);<br>}<br><br># requests for my domain<br><br>if (is_method("PUBLISH|SUBSCRIBE")) {<br>send_reply(503, "Service Unavailable");<br>exit;<br>}<br><br>if (is_method("REGISTER")) {<br># # store the registration and generate a SIP reply<br># if (!save("location"))<br># xlog("failed to register AoR $tu\n");<br>#<br># exit;<br><br><br>if (!ds_select_dst(1, 4)) {<br> send_reply(503,"Service Unavailable");<br> exit;<br>}<br>}<br><br># if ($rU==NULL) {<br># # request with no Username in RURI<br># send_reply(484,"Address Incomplete");<br># exit;<br># }<br><br># do lookup with method filtering<br>if (!lookup("location","method-filtering")) {<br>t_reply(404, "Not Found");<br>exit;<br>}<br><br># when routing via usrloc, log the missed calls also<br>do_accounting("log","missed");<br>route(relay);<br>}<br><br><br>route[relay] {<br># for INVITEs enable some additional helper routes<br>if (is_method("INVITE")) {<br>t_on_branch("per_branch_ops");<br>t_on_reply("handle_nat");<br>t_on_failure("missed_call");<br>}<br><br>if (!t_relay()) {<br>send_reply(500,"Internal Error");<br>}<br>exit;<br>}<br><br><br><br><br>branch_route[per_branch_ops] {<br>xlog("new branch at $ru\n");<br>}<br><br><br>onreply_route[handle_nat] {<br>xlog("incoming reply\n");<br>}<br><br><br>failure_route[missed_call] {<br>if (t_was_cancelled()) {<br>exit;<br>}<br><br># uncomment the following lines if you want to block client<br># redirect based on 3xx replies.<br>##if (t_check_status("3[0-9][0-9]")) {<br>##t_reply(404,"Not found");<br>## exit;<br>##}<br><br><br>}<br><br>```<br><br>Any idea why INVITE not working? :-)</div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Nine to one <<a href="mailto:9to1url@gmail.com">9to1url@gmail.com</a>> 於 2023年9月14日 週四 下午4:40寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Get idea from another thread: Reading documents :-)<br>Did that.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Nine to one <<a href="mailto:9to1url@gmail.com" target="_blank">9to1url@gmail.com</a>> 於 2023年9月14日 週四 上午9:12寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><span style="font-size:12.8px">Can anyone share the opensips conf file with Freeswitch and rtpengine?</span></div>
</blockquote></div>
</blockquote></div>