<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>RE: FW: [Users] OpenSER config help to talk to PSTN..</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Found the issue now, it was an original problem I had but I'm not sure how it went away in the first place. There is a problem with the mysql connection, which is located on another server.<BR>
<BR>
If I attempt to just run the mysql client manually it still does not work..<BR>
<BR>
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)<BR>
<BR>
seen this error a million times on google but couldn't really find any fixes that worked for me? This error occured earlier on when I first configured openser but It went away and I'm not sure how it happened.<BR>
<BR>
I rebooted the machine and i'm guessing this started again due to it<BR>
<BR>
Thanks<BR>
Nick<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Bogdan-Andrei Iancu [<A HREF="mailto:bogdan@voice-system.ro">mailto:bogdan@voice-system.ro</A>]<BR>
Sent: Wed 10/18/2006 3:51 PM<BR>
To: Nick De Cristofaro<BR>
Cc: users@openser.org<BR>
Subject: Re: FW: [Users] OpenSER config help to talk to PSTN..<BR>
<BR>
Hi,<BR>
<BR>
you might have start-up errors - check you syslog to see what is the<BR>
problem.<BR>
<BR>
regards,<BR>
bogdan<BR>
<BR>
Nick De Cristofaro wrote:<BR>
<BR>
> I've been modying the files so it gets no errors now if I attempt to<BR>
> run openser, nothing happens.. no processes are starting but it is<BR>
> saying it is.<BR>
><BR>
> bash-3.00# openser<BR>
> Listening on<BR>
> udp: 127.0.0.1 [127.0.0.1]:5060<BR>
> udp: 212.97.202.136 [212.97.202.136]:5060<BR>
> tcp: 127.0.0.1 [127.0.0.1]:5060<BR>
> tcp: 212.97.202.136 [212.97.202.136]:5060<BR>
> Aliases:<BR>
> tcp: loghost:5060<BR>
> tcp: ser-zone:5060<BR>
> tcp: localhost:5060<BR>
> udp: loghost:5060<BR>
> udp: ser-zone:5060<BR>
> udp: localhost:5060<BR>
><BR>
> after running ps -A , nothing is showing up in there.<BR>
><BR>
> Also, openserctl is not working correctly, if I attempt to start it<BR>
> from there "openserctl start" it says there is no pid file present in<BR>
> /var/run, but if i create an empty one then it says there is a file ,<BR>
> is there a process running? contradicting outlooks.. ? it wants a file<BR>
> and then it doesn't ?<BR>
><BR>
><BR>
> -----Original Message-----<BR>
> From: Bogdan-Andrei Iancu [<A HREF="mailto:bogdan@voice-system.ro">mailto:bogdan@voice-system.ro</A>]<BR>
> Sent: Tue 10/17/2006 12:45 PM<BR>
> To: Nick De Cristofaro<BR>
> Cc: users@openser.org<BR>
> Subject: Re: FW: [Users] OpenSER config help to talk to PSTN..<BR>
><BR>
> Hi Nick,<BR>
><BR>
> it's because of the forward function which changed its prototype;<BR>
> instead of<BR>
> forward(uri:host, uri:port);<BR>
> use<BR>
> forward();<BR>
><BR>
> see<BR>
> <A HREF="http://openser.org/dokuwiki/doku.php/openser_v1.1.0_core_cookbook?#forward_destination">http://openser.org/dokuwiki/doku.php/openser_v1.1.0_core_cookbook?#forward_destination</A><BR>
><BR>
> regards,<BR>
> bogdan<BR>
><BR>
><BR>
> Nick De Cristofaro wrote:<BR>
><BR>
> > below is my config file i modified it a bit.. still pretty basic.<BR>
> > trying to get basic connectivity to a PSTN gateway. I modified an<BR>
> > example file.<BR>
> ><BR>
> > errors I get are:<BR>
> ><BR>
> > bash-3.00# openser -c<BR>
> > 0(6841) parse error (98,21-28): parse error<BR>
> > 0(6841) parse error (98,29-30): bad arguments<BR>
> > 0(6841) parse error (121,33-36): parse error<BR>
> > 0(6841) parse error (121,51-52): bad forwardargument<BR>
> > 0(6841) parse error (139,55-56): unknown command, missing loadmodule?<BR>
> ><BR>
> > 0(6841) parse error (145,55-56): unknown command, missing loadmodule?<BR>
> ><BR>
> > 0(6841) parse error (151,55-56): unknown command, missing loadmodule?<BR>
> ><BR>
> > 0(6841) parse error (163,10-11): parse error<BR>
> > 0(6841) parse error (163,10-11):<BR>
> > ERROR: bad config file (9 errors)<BR>
> ><BR>
> ><BR>
> > #<BR>
> > # $Id: openser.cfg,v 1.6.2.1 2006/07/17 15:51:03 klaus_darilion Exp $<BR>
> > #<BR>
> > # simple quick-start config script<BR>
> > #<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>
> > alias=ip<BR>
> > /* Uncomment these lines to enter debugging mode<BR>
> > fork=no<BR>
> > log_stderror=yes<BR>
> > */<BR>
> ><BR>
> > check_via=no # (cmd. line: -v)<BR>
> > dns=no # (cmd. line: -r)<BR>
> > rev_dns=no # (cmd. line: -R)<BR>
> > port=5060<BR>
> > children=4<BR>
> > fifo="/tmp/openser_fifo"<BR>
> ><BR>
> > #<BR>
> > # uncomment the following lines for TLS support<BR>
> > #disable_tls = 0<BR>
> > #listen = tls:your_IP:5061<BR>
> > #tls_verify_server = 1<BR>
> > #tls_verify_client = 1<BR>
> > #tls_require_client_certificate = 0<BR>
> > #tls_method = TLSv1<BR>
> > #tls_certificate = "/usr/local/etc/openser/tls/user/user-cert.pem"<BR>
> > #tls_private_key = "/usr/local/etc/openser/tls/user/user-privkey.pem"<BR>
> > #tls_ca_list = "/usr/local/etc/openser/tls/user/user-calist.pem"<BR>
> ><BR>
> > # ------------------ module loading ----------------------------------<BR>
> ><BR>
> > # Uncomment this if you want to use SQL database<BR>
> > loadmodule "/usr/local/lib/openser/modules/mysql.so"<BR>
> ><BR>
> > loadmodule "/usr/local/lib/openser/modules/sl.so"<BR>
> > loadmodule "/usr/local/lib/openser/modules/tm.so"<BR>
> > loadmodule "/usr/local/lib/openser/modules/rr.so"<BR>
> > loadmodule "/usr/local/lib/openser/modules/maxfwd.so"<BR>
> > loadmodule "/usr/local/lib/openser/modules/usrloc.so"<BR>
> > loadmodule "/usr/local/lib/openser/modules/registrar.so"<BR>
> > loadmodule "/usr/local/lib/openser/modules/textops.so"<BR>
> ><BR>
> > # Uncomment this if you want digest authentication<BR>
> > # mysql.so must be loaded !<BR>
> > #loadmodule "/usr/local/lib/openser/modules/auth.so"<BR>
> > #loadmodule "/usr/local/lib/openser/modules/auth_db.so"<BR>
> ><BR>
> > # ------------------ logs -------------------------------------------<BR>
> ><BR>
> > log_facility=LOG_LOCAL7<BR>
> > #Add the xlog module:<BR>
> > loadmodule "/usr/local/lib/openser/modules/xlog.so"<BR>
> ><BR>
> > # ----------------- setting module-specific parameters ---------------<BR>
> ><BR>
> > # -- usrloc params --<BR>
> ><BR>
> > modparam("usrloc", "db_mode", 0)<BR>
> ><BR>
> > # Uncomment this if you want to use SQL database<BR>
> > # for persistent storage and comment the previous line<BR>
> > #modparam("usrloc", "db_mode", 2)<BR>
> ><BR>
> > # -- auth params --<BR>
> > # Uncomment if you are using auth module<BR>
> > #<BR>
> > #modparam("auth_db", "calculate_ha1", yes)<BR>
> > #<BR>
> > # If you set "calculate_ha1" parameter to yes (which true in this<BR>
> config),<BR>
> > # uncomment also the following parameter)<BR>
> > #<BR>
> > #modparam("auth_db", "password_column", "password")<BR>
> ><BR>
> > # -- rr params --<BR>
> > # add value to ;lr param to make some broken UAs happy<BR>
> > modparam("rr", "enable_full_lr", 1)<BR>
> ><BR>
> > # ------------------------- request routing logic -------------------<BR>
> > # main routing logic<BR>
> ><BR>
> > route{<BR>
> ><BR>
> > /* ********* ROUTINE CHECKS <BR>
> ********************************** */<BR>
> ><BR>
> > # filter too old messages<BR>
> > if (!mf_process_maxfwd_header("10")) {<BR>
> > log("LOG: Too many hops\n");<BR>
> > sl_send_reply("483","Too Many Hops");<BR>
> > return;<BR>
> > };<BR>
> > if (len_gt( max_len )) {<BR>
> > sl_send_reply("513", "Wow -- Message too large");<BR>
> > return;<BR>
> > };<BR>
> ><BR>
> > /* ********* RR ********************************** */<BR>
> ><BR>
> > /* grant Route routing if route headers present */<BR>
> > if (loose_route()) { t_relay(); return; };<BR>
> ><BR>
> > /* record-route INVITEs -- all subsequent requests must visit<BR>
> > us */<BR>
> > if (method=="INVITE") {<BR>
> > record_route();<BR>
> > };<BR>
> ><BR>
> > # now check if it really is a PSTN destination which should be<BR>
> > handled<BR>
> > # by our gateway; if not, and the request is an invitation,<BR>
> > drop it --<BR>
> > # we cannot terminate it in PSTN; relay non-INVITE requests --<BR>
> > it may<BR>
> > # be for example BYEs sent by gateway to call originator<BR>
> > if (!uri=~"sip:\+?[0-9]+@.*") {<BR>
> > if (method=="INVITE") {<BR>
> > sl_send_reply("403", "Call cannot be served<BR>
> > here");<BR>
> > } else {<BR>
> > forward(uri:host, uri:port);<BR>
> > };<BR>
> > return;<BR>
> > };<BR>
> ><BR>
> > # account completed transactions via syslog<BR>
> > setflag(1);<BR>
> ><BR>
> > # authorize only for INVITEs -- RR/Contact may result<BR>
> > in weird<BR>
> > # things showing up in d-uri that would return our<BR>
> > logic; our<BR>
> > # major concern is INVITE which causes PSTN costs<BR>
> ><BR>
> > if (method=="INVITE") {<BR>
> ><BR>
> > # does the authenticated user have a<BR>
> > permission for local<BR>
> > # calls (destinations beginning with a single<BR>
> > zero)?<BR>
> > # (i.e., is he in the "local" group?)<BR>
> > if (uri=~"sip:0[1-9][0-9]+@.*") {<BR>
> > if (!is_user_in("credentials",<BR>
> "local")) {<BR>
> > sl_send_reply("403", "No<BR>
> > permission for local calls");<BR>
> > return;<BR>
> > };<BR>
> > # the same for long-distance (destinations<BR>
> > begin with two zeros")<BR>
> > } else if (uri=~"sip:00[1-9][0-9]+@.*") {<BR>
> > if (!is_user_in("credentials", "ld")) {<BR>
> > sl_send_reply("403", " no<BR>
> > permission for LD ");<BR>
> > return;<BR>
> > };<BR>
> > # the same for international calls (three zeros)<BR>
> > } else if (uri=~"sip:000[1-9][0-9]+@.*") {<BR>
> > if (!is_user_in("credentials", "int")) {<BR>
> > sl_send_reply("403",<BR>
> > "International permissions needed");<BR>
> > return;<BR>
> > };<BR>
> > # everything else ( e.g., interplanetary<BR>
> > calls) is denied<BR>
> > } else {<BR>
> > sl_send_reply("403", "Forbidden");<BR>
> > return;<BR>
> > };<BR>
> ><BR>
> > }; # INVITE to authorized PSTN<BR>
> ><BR>
> > }; # authorized PSTN<BR>
> ><BR>
> > # if you have passed through all the checks, let your call go<BR>
> > to GW!<BR>
> ><BR>
> > rewritehostport("ip:5060");<BR>
> ><BR>
> > # forward the request now<BR>
> > if (!t_relay()) {<BR>
> > sl_reply_error();<BR>
> > return;<BR>
> > };<BR>
> ><BR>
> > }<BR>
> > bash-3.00#<BR>
> ><BR>
> >------------------------------------------------------------------------<BR>
> ><BR>
> >_______________________________________________<BR>
> >Users mailing list<BR>
> >Users@openser.org<BR>
> ><A HREF="http://openser.org/cgi-bin/mailman/listinfo/users">http://openser.org/cgi-bin/mailman/listinfo/users</A><BR>
> ><BR>
> ><BR>
><BR>
><BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>