<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div id="yiv191839083">Thanks; I have made some progress on my config, but now I have an issue sending the calls to the gateways. I took a config file from "Building a telephony system with openser" from Flavio E. Goncalves an adapted it to my needs, but when I try to pass a call to PSTN I receive error 404, not found.<br><br>This is the debug of the call:<br><br>U 192.168.1.101:4142 -> 192.168.1.102:5060<br>INVITE sip:13057286338@192.168.1.102 SIP/2.0. <br>Via: SIP/2.0/UDP 192.168.1.101:4142;branch=z9hG4bK-d8754z-d32c024c26331414-1---d8754z-;rport.<br>Max-Forwards: 70.<br>Contact: <sip:7862702200@192.168.1.101:4142>.<br>To: "13057286338"<sip:13057286338@192.168.1.102>.<br>From: "Gonzo"<sip:7862702200@192.168.1.102>;tag=b7384713.<br>Call-ID: YmFmZDgxYmI2YTVmMDJjZWRkZjM4OGI3YzhiMjljYTg..<br>CSeq: 1 INVITE.<br>Allow: INVITE, ACK,
CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.<br>Content-Type: application/sdp.<br>User-Agent: X-Lite release 1100l stamp 47546.<br>Content-Length: 474.<br>.<br>v=0.<br>o=- 0 2 IN IP4 192.168.1.101.<br>s=CounterPath X-Lite 3.0.<br>c=IN IP4 192.168.1.101.<br>t=0 0.<br>m=audio 28830 RTP/AVP 107 119 100 106 0 105 98 8 3 101.<br>a=alt:1 2 : MlZdUnJz Ygmz8XzM 192.168.1.101 28830.<br>a=alt:2 1 : tM0AgMUl 5/M2r2zq 5.247.86.54 28830.<br>a=fmtp:101 0-15.<br>a=rtpmap:107 BV32/16000.<br>a=rtpmap:119 BV32-FEC/16000.<br>a=rtpmap:100 SPEEX/16000.<br>a=rtpmap:106 SPEEX-FEC/16000.<br>a=rtpmap:105 SPEEX-FEC/8000.<br>a=rtpmap:98 iLBC/8000.<br>a=rtpmap:101 telephone-event/8000.<br>a=sendrecv.<br><br><br>U 192.168.1.102:5060 -> 192.168.1.101:4142<br>SIP/2.0 404 Not Found.<br>Via: SIP/2.0/UDP 192.168.1.101:4142;branch=z9hG4bK-d8754z-d32c024c26331414-1---d8754z-;rport=4142.<br>To:
"13057727932"<sip:13057286338@192.168.1.102>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.3872.<br>From: "Gonzo"<sip:7862702200@192.168.1.102>;tag=b7384713.<br>Call-ID: YmFmZDgxYmI2YTVmMDJjZWRkZjM4OGI3YzhiMjljYTg..<br>CSeq: 1 INVITE.<br>Server: OpenSIPS (1.4.4-notls (i386/linux)).<br>Content-Length: 0.<br>.<br><br><br>U 192.168.1.101:4142 -> 192.168.1.102:5060<br>ACK sip:13057286338@192.168.1.102 SIP/2.0.<br>Via: SIP/2.0/UDP 192.168.1.101:4142;branch=z9hG4bK-d8754z-d32c024c26331414-1---d8754z-;rport.<br>To: "13057286338"<sip:13057286338@192.168.1.102>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.3872.<br>From: "Gonzo"<sip:7862702200@192.168.1.102>;tag=b7384713.<br>Call-ID: YmFmZDgxYmI2YTVmMDJjZWRkZjM4OGI3YzhiMjljYTg..<br>CSeq: 1 ACK.<br>Content-Length: 0.<br><br><br>An this is my config file:<br><br># ----------- global configuration parameters
------------------------<br><br>debug=3 # debug level (cmd line: -dddddddddd)<br>fork=yes<br>log_stderror=no # (cmd line: -E)<br>children=4<br>port=5060<br>disable_tcp=yes<br><br># ------------------ module loading ----------------------------------<br>#set module path<br>mpath="/usr/local/lib/opensips/modules/"<br><br>loadmodule "db_mysql.so"<br>loadmodule "sl.so"<br>loadmodule "tm.so"<br>loadmodule "rr.so"<br>loadmodule "maxfwd.so"<br>loadmodule "usrloc.so"<br>loadmodule "registrar.so"<br>loadmodule "textops.so"<br>loadmodule "uri.so"<br>loadmodule "uri_db.so"<br>loadmodule "domain.so"<br>loadmodule "permissions.so"<br>loadmodule "group.so"<br>loadmodule "mi_fifo.so"<br>loadmodule "dispatcher.so"<br><br># Uncomment this if you want digest authentication<br># mysql.so must be loaded !<br>loadmodule "auth.so"<br>loadmodule "auth_db.so"<br><br># ----------------- setting
module-specific parameters ---------------<br><br>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")<br>modparam("usrloc", "db_mode", 2)<br>modparam("auth_db", "calculate_ha1", yes)<br>modparam("auth_db", "password_column", "password")<br>modparam("rr", "enable_full_lr", 1)<br>modparam("auth_db|permissions|uri_db|usrloc","db_url","mysql://opensips:opensipsrw@localhost/opensips")<br>modparam("permissions", "db_mode", 1)<br>modparam("permissions", "trusted_table", "trusted") <br>modparam("domain", "db_mode", 1) # Use caching<br><br><br># ------ dispatcher params --------<br>modparam("dispatcher", "list_file", "/usr/local/etc/opensips/dispatcher.list")<br>modparam("dispatcher", "force_dst", 1)<br><br><br># ------------------------- request routing logic -------------------<br><br># main routing logic<br><br>route{<br> #<br> # -- 1 -- Request Validation <br> #<br>
if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","Too Many Hops");<br> exit;<br> };<br><br> if (msg:len >= 2048 ) {<br> sl_send_reply("513", "Message too big");<br> exit;<br> };<br><br> #<br> # -- 2 -- Routing Preprocessing<br> #<br> ## Record-route all except Register<br> if (!method=="REGISTER") record_route();<br><br> ##Loose_route packets<br> if (loose_route()) {<br> # mark routing logic in request<br> append_hf("P-hint: rr-enforced\r\n"); <br>
route(1);<br> };<br><br> #CANCEL processing<br> if (is_method("CANCEL")) {<br> if (t_check_trans()) t_relay();<br> exit;<br> };<br><br> t_check_trans();<br> <br> # <br> # -- 3 -- Determine Request Target<br> #<br> if (method=="REGISTER") {<br> route(2);<br> } else {<br> route(3);<br> };<br><br>}<br><br><br>route[1] {<br> #<br> # -- 4 -- Forward request to target<br> #<br> ## Forward statefully<br> if (!t_relay()) {<br>
sl_reply_error();<br> };<br> exit;<br>}<br><br>route[2] {<br> ## Register request handler<br> if (is_uri_host_local()) {<br> if (!www_authorize("", "subscriber")) {<br> www_challenge("", "1");<br> exit;<br> };<br><br> if (!check_to()) {<br> sl_send_reply("403", "Forbidden");<br> exit;<br> };<br><br> save("location");<br> exit;<br> } else if
{<br> sl_send_reply("403", "Forbidden");<br> };<br>}<br><br>route[3] {<br> ## INVITE request handler <br> if (is_from_local()){<br> # From an internal domain -> check the credentials and the FROM<br> if(!allow_trusted()){<br> if (!proxy_authorize("","subscriber")) {<br> proxy_challenge("","1");<br> exit;<br> } else if (!check_from()) {<br> sl_send_reply("403",
"Forbidden, use From=ID");<br> exit;<br> };<br> } else { <br> log("Request bypassed the auth.using allow_trusted");<br> };<br> <br> consume_credentials();<br> <br> #Verify aliases, if found replace R-URI. <br> lookup("aliases");<br> <br> if (is_uri_host_local()) {<br> # -- Inbound to
Inbound<br> route(10);<br> } else {<br> # -- Inbound to outbound<br> route(11);<br> };<br><br> } else {<br> #From an external domain ->do not check credentials<br> #Verify aliases, if found replace R-URI. <br> lookup("aliases");<br> if (is_uri_host_local()) {<br> #-- Outbound to inbound<br> route(12);<br> } else
{<br> # -- Outbound to outbound<br> route(13);<br> };<br> };<br>}<br><br>route[4] {<br> # routing to the public network<br> ds_select_dst("1", "0");<br> record_route();<br> t_relay();<br>}<br><br>route[10] {<br> #from an internal domain -> inbound<br> #Native SIP destinations are handled using the location table<br> #Gateway destinations are handled by regular expressions<br> append_hf("P-hint: inbound->inbound \r\n");<br> <br> if (uri=~"^sip:[2-9][0-9]{6}@") {<br> if
(is_user_in("credentials","local")) {<br> route(4);<br> exit;<br> } else {<br> sl_send_reply("403", "No permissions for local calls");<br> exit;<br> };<br> };<br><br> if (uri=~"^sip:1[2-9][1-9]{9}@") {<br> if (is_user_in("credentials","ld")) {<br> route(4);<br> exit;<br> } else {<br>
sl_send_reply("403", "No permissions for long distance");<br> exit;<br> };<br> };<br> <br> if (uri=~"^sip:011[0-9]*@") {<br> if (is_user_in("credentials","int")) {<br> route(4);<br> exit;<br> } else {<br> sl_send_reply("403", "No permissions for international calls");<br> };<br> };<br><br> if (!lookup("location")) {<br> sl_send_reply("404", "Not Found");<br>
exit;<br> };<br> route(1);<br>}<br><br>route[11] {<br> # from an internal domain -> outbound<br> # Simply route the call outbound using DNS search<br> append_hf("P-hint: inbound->outbound \r\n");<br> route(1);<br>}<br><br>route[12] {<br> # From an external domain -> inbound<br> # Verify aliases, if found replace R-URI.<br> lookup("aliases");<br> if (!lookup("location")) {<br> sl_send_reply("404", "Not Found");<br> exit;<br> };<br> route(1);<br>}<br><br>route[13] {<br> #From an external domain outbound<br> #we are not accepting these calls<br> append_hf("P-hint: outbound->inbound
\r\n");<br> sl_send_reply("403", "Forbidden");<br> exit;<br>}<br><br>Any Idea why calls are getting rejected?<br><br><br>--- On <b>Fri, 1/23/09, Robin Rodriguez <i><rrodriguez@ifbyphone.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Robin Rodriguez <rrodriguez@ifbyphone.com><br>Subject: Re: [OpenSIPS-Users] Asteriak load balance<br>To: gonzovoip@yahoo.com<br>Cc: users@lists.opensips.org<br>Date: Friday, January 23, 2009, 4:05 PM<br><br><div id="yiv954334027">
Gonzalo Gonzalez wrote:
<blockquote type="cite">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">Thanks.....<br>
<br>
Could somebody share a simple config file using dispatcher module.<br>
<br>
Thanks<br>
<br>
Gonzo<br>
<br>
<br>
<blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>
</blockquote>
</td>
</tr>
</tbody>
</table>
</blockquote>
<a rel="nofollow" class="moz-txt-link-freetext" target="_blank" href="http://www.dialogic.com/products/docs/appnotes/10833_HMP_OpenSER_SIP_an.pdf">http://www.dialogic.com/products/docs/appnotes/10833_HMP_OpenSER_SIP_an.pdf</a>
is the most concise example i've ever seen on using dispatcher, should
be enough to get you going. A zip file is linked in the pdf that with a
sample config<br>
<br>
<div class="moz-signature">-- <br>
<title></title>
Robin D. Rodriguez<br>
Systems Engineer<br>
Ifbyphone, Inc.<br>
Phone: (866) 250-1663<br>
Fax: (847) 676-6553<br>
<a rel="nofollow" class="moz-txt-link-abbreviated" target="_blank" href="mailto:rrodriguez@ifbyphone.com">rrodriguez@ifbyphone.com</a><br>
<a rel="nofollow" class="moz-txt-link-freetext" target="_blank" href="http://www.ifbyphone.com">http://www.ifbyphone.com</a><br>
<div class="moz-signature">
<div class="Section1">
<p class="MsoNormal" style="line-height: normal;"> </p>
<p class="MsoNormal" style="line-height: normal;"> </p>
</div>
</div>
</div>
</div></blockquote></div></td></tr></table><br>