Just to clarify, I have no direct need for the t_load_contacts and t_next contacts. I am simply trying to follow the outbound modules recommend configuration.

As mentioned, if I simply skip them, clients can register. If they are not needed, that's fine by me.

Additionally, for the outbound suggestions, the following snippet from the proxy configuration causes issues.
The bolded area had to be added for registration to work.

The 'default' option of the '!loose_route' is always executed, so I guess 'loose_route' always fails. If I skip the 'default' and let the logic fall through to the route(RELAY), things work to a degree as I mentioned, but some SIP packets are still lost.

I am really just trying to get basic functionality with a central registrar and proxy sersers working.


        if (is_method("REGISTER")) {
                remove_hf("Route");
                append_hf("Supported: path, outbound\r\n");
                add_path();
                $du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
        } else {
                if (is_method("INVITE|SUBSCRIBE"))
                        record_route();

                if ($si == "REGISTRAR_IP" && $sp == "REGISTRAR_PORT") {
                        if (!loose_route()) {
                                switch($rc) {
                                case -2:
                                        sl_send_reply("403", "Forbidden");
                                        exit;
                                default:
                                        sl_reply_error();
                                        exit;
                                }
                        }

                        t_on_failure("FAIL_OUTBOUND");
                } else {
                        if ($rU == $null) {
                                sl_send_reply("484", "Address Incomplete");
                                exit;
                        }
                        remove_hf("Route");
                        $du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
                }
        }

        route(RELAY);



On Mon, Oct 21, 2013 at 4:20 PM, Coy Cardwell <coy.cardwell@gmail.com> wrote:
Yes

If either of the t_next_contacts are executed, they fail.

If they are removed from the routing logic, the calls are completing, but not reliably as, as the least, some SIP packets like BYE are being dropped.

 here is a snippet:
        $avp(oexten) = $rU;
        if (!lookup("location")) {
                $var(rc) = $rc;
                route(TOVOICEMAIL);
                t_newtran();
                switch ($var(rc)) {
                        case -1:
                        case -3:
                                send_reply("404", "2 Not Found");
                                exit;
                        case -2:
                                send_reply("405", "Method Not Allowed");
                                exit;
                }
        }

        if (!t_load_contacts()) {
                send_reply("500", "1 Server Internal Error");
                exit;
        }

       if (!t_next_contacts()) {
               send_reply("500", "2 Server Internal Error");
               exit;
       }

       t_on_failure("FAIL_OUTBOUND");

and another

# manage failure routing cases
failure_route[FAIL_OUTBOUND] {
        if (t_check_status("408|430")) {
                if (!t_next_contact_flows() && !t_next_contacts()) {
                        send_reply("500", "3 Server Internal Error");
                        exit;
                }
        } else if (!t_next_contacts()) {
                send_reply("500", "4 Server Internal Error");
                exit;
        }

        t_on_failure("FAIL_OUTBOUND");
        route(RELAY);
}


Thanks!

- Coy



On Mon, Oct 21, 2013 at 3:17 PM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
Hello,

before using t_load_contacts()/t_next_contacts(), you have to use lookup("location");

Do you have that one, too?

Cheers,
Daniel


On 10/17/13 11:40 PM, Coy Cardwell wrote:
Hello again.

Compiling from source, using the proxy-to-central registrar configurations outlined here http://www.kamailio.org/docs/modules/4.0.x/modules/outbound.html and adding in the additional "append_hf("Supported: path, outbound\r\n");" on the proxy, registration works.

However, when a call is made, the debug traces show problems when entering this area of the configuration outlined in the Outbound Module:

	if (!t_load_contacts()) {
		send_reply("500", "Server Internal Error");
		exit;
	}

	if (!t_next_contacts()) {
		send_reply("500", "Server Internal Error");
		exit;
	}
as shown here:
1(26960) ERROR: *** cfgtrace: c=[//etc/kamailio/kamailio.cfg] l=700 a=16 n=if
 1(26960) ERROR: *** cfgtrace: c=[//etc/kamailio/kamailio.cfg] l=695 a=24 n=t_load_contacts
 1(26960) DEBUG: tm [t_serial.c:166]: t_load_contacts(): nr_branches is 0
 1(26960) DEBUG: tm [t_serial.c:169]: t_load_contacts(): nothing to do - only one contact!
 1(26960) ERROR: *** cfgtrace: c=[//etc/kamailio/kamailio.cfg] l=705 a=16 n=if
 1(26960) ERROR: *** cfgtrace: c=[//etc/kamailio/kamailio.cfg] l=700 a=24 n=t_next_contacts
 1(26960) DEBUG: tm [t_serial.c:376]: t_next_contacts(): no contacts in contacts_avp - we are done!
 1(26960) ERROR: *** cfgtrace: c=[//etc/kamailio/kamailio.cfg] l=701 a=26 n=send_reply

The result from t_load_contacts seems to imply one contact exists, which would be correct as there should be one, but then t_next_contacts sees no cotacts and the sever returns an error, breaking the call.

Any ideas?



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Trainings - Berlin, Nov 25-28; Miami, Nov 18-20, 2013
  - more details about Kamailio trainings at http://www.asipto.com -

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users