[OpenSER-Users-ES] Llamadas de Asterisk a OpenSER

andresdb at adinet.com.uy andresdb at adinet.com.uy
Thu Jan 24 18:50:12 CET 2008


Estimados amigos del foro,

Anteriormente había tenido problemas en hacer un forward desde SER a 
Asterisk, este
tema ya quedo resuelto.
El problema que estoy teniendo ahora es el siguiente, detallo la 
estructura de mi red.

cliente sip-------internet------OpenSER------Internet-----Asterisk-----
LAN

El efectuar una llamada desde  cliente sip que esta en internet con 
una ip publica hacia
un cliente sip que esta en la lan, esto funciona perfecto, en este 
caso el cliente
esta registrado en OpenSer; ahora cuando un cliente de la lan que esta 
registrado
en Asterisk quiere llamar a un cliente que esta registrado en open ser 
tengo problemas
de loop, porque el INVITE de open ser hay un rewritehostport("xxx.xxx.
xxx.xxx:5060");
al Asterisk.
La pregunta es como puedo llamar de mi Asterisk a clientes que estan 
registrados en Open
Ser.

Detallo config de OpenSER

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");
        exit;
    };
    if (msg:len >=  max_len ) {
        sl_send_reply("513", "Message too big");
        exit;
    };

    # we record-route all messages -- to make sure that
    # subsequent messages will go through our proxy; that's
    # particularly good if upstream and downstream entities
    # use different transport protocol
    if (!method=="REGISTER") record_route();

    # subsequent messages withing a dialog should take the
    # path determined by record-routing
    if (loose_route()) {
        # mark routing logic in request
        append_hf("P-hint: rr-enforced\r\n");
        route(1);
        exit;
    };

    if (!uri==myself) {
        # mark routing logic in request
        append_hf("P-hint: outbound\r\n");
        route(1);
        exit;
    };
    if (is_method("INVITE")) {
        #record_route(); ##
        #force_rtp_proxy(); ##

        rewritehostport("xxx.xxx.xxx.xxx:5060");
        #t_on_reply("1"); ##
        t_relay();
        return;
        #exit;
    }

    # if the request is for other domain use UsrLoc
    # (in case, it does not work, use the following command
    # with proper names and addresses in it)
    if (uri==myself) {
        if (method=="REGISTER") {
            # digest authentication
            if (!www_authorize("", "subscriber")) {
                www_challenge("", "0");
                exit;
            };

            save("location");
            exit;
        };

        lookup("aliases");
        if (!uri==myself) {
            append_hf("P-hint: outbound alias\r\n");
     route(1);
            exit;
        };

        # native SIP destinations are handled using our USRLOC DB
        if (!lookup("location")) {
            sl_send_reply("404", "Not Found");
            exit;
        };
    };
    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
    if (!t_relay()) {
        sl_reply_error();
    };               

Saludos,




More information about the Users-es mailing list