[Serusers] *bangs head* Struggling with simple SER+SEMS..

Dave Bath dave at fuuz.com
Mon Apr 18 16:41:23 CEST 2005


Hey guys.... 

I'm really struggling with this.  It was working perfectly yesterday and now I must have made a small change and I just cannot find what I've done wrong.

Bascially, this is a very very simple unauthenticated SER front end to SEMS... all I want to be able to do is use the conference facilities.  Incidentally, when I say unauthenticated I mean also without registering... so all a user has to do is send an INVITE.  To that end, I am trying to just redirect sip URI's beginning with 600.  It seems that the initial redirect goes through... but then something screwy is happening because SER never appears to receive the ACKs correctly.. and it starts sending two sets of 200 messages.. one with no SDP descriptor and then a second batch with a valid SDP descriptor.  Because of this weirdness with the ACKs, the client and SER fight for a while sending out millions of repeat 200s and ACKs.  Meanwhile, because the initial redirect to SEMS worked, the conference has actually been created...

The same story with BYE.. the client sends it, but SER doesn't even appear to receive it (note all the debugging log lines).   In fact, there' something rather dodgy up, because I don't even get the debug lines inside the route[1] block.... 

It sort of points to me that perhaps I've done something very stupid with the transactions.. that for some reason they don't match up ... but I can't find it.  Attached is my ser.cfg.  Any help would be so very much appreciated.

I don't think it's a basic connectivity problem, because as I said, a very similar file was working perfectly yesterday... I've just stupidly changed it slightly somewhere.

Many many thanks in advance.

Dave


listen=<publicip>
check_via=yes   # (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
#port=5060
#children=4
fifo="/tmp/ser_fifo"

# ------------------ module loading ----------------------------------

# Uncomment this if you want to use SQL database
#loadmodule "/lib/ser/modules/mysql.so"

loadmodule "/lib/ser/modules/sl.so"
loadmodule "/lib/ser/modules/tm.so"
loadmodule "/lib/ser/modules/rr.so"
loadmodule "/lib/ser/modules/maxfwd.so"
loadmodule "/lib/ser/modules/usrloc.so"
loadmodule "/lib/ser/modules/registrar.so"
loadmodule "/lib/ser/modules/textops.so"

# -- usrloc params --

modparam("usrloc", "db_mode",   0)

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

# -------------------------  request routing logic -------------------

# main routing logic

route{

        # initial sanity checks -- messages with
        # max_forwards==0, or excessively long requests
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                break;
        };
        if (msg:len >=  max_len ) {
                sl_send_reply("513", "Message too big");
                break;
        };

        if (!method=="REGISTER") record_route();

        if (loose_route()) {
                log(1,"Loose routing block");
                append_hf("P-hint: rr-enforced\r\n");
                route(1);
                break;
        };

        if (!uri==myself) {
                log(1,"Got a request for an extenal domain");
                # mark routing logic in request
                append_hf("P-hint: outbound\r\n");
                route(1);
                break;
        };

        if (uri==myself) {

          # switch to stateful mode:
          if (!t_newtran()){
            sl_send_reply("500","could not create transaction");
            break;
         };

         if (method=="REGISTER") {
            save("location");
            break;
          };

          if (method=="ACK") {
            # absorb ACKs
            log(1,"Absorbing ACK");
            break;
          };

          lookup("aliases");
          if (!uri==myself) {
            log(1,"Resolving external request");
            append_hf("P-hint: outbound alias\r\n");
            route(1);
            break;
          };

          # prevent timeout on the other side:
          t_reply("100","Trying - just wait a minute !");

          if (method=="INVITE") {
              save("location");
              if (uri=~"sip:600.*@") {
                  log(1,"-> Redirecting conference to SEMS");
                  if(!t_write_unix("/tmp/am_sock","conference")) {
                  t_reply("500","error contacting sems");
                  };
                 break;
              } ;
              break;
           }
           else if (method=="BYE" || method=="CANCEL") {
               log(1,"-> Sending BYE to SEMS");
               if(!t_write_unix("/tmp/am_sock","bye")) {
                   t_reply("500","error contacting sems");
               };
           };

       # native SIP destinations are handled using our USRLOC DB
        if (!lookup("location")) {
                sl_send_reply("404", "Not Found");
                break;
        };
    };

     append_hf("P-hint: usrloc applied\r\n");
     route(1);
}

route[1]
{
        # send it out now; use stateful forwarding as it works reliably
        # even for UDP2TCP
        log(1, "Attempting stateful forward...");
        if (!t_relay()) {
                log(1,"... failure");
                sl_reply_error();
        };
        log(1, "... success");
}


_______________________________________________
Serusers mailing list
serusers at lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers







More information about the sr-users mailing list