[OpenSIPS-Users] opensips as client

chamo chamo4 at darksun.sk
Wed Jul 29 10:19:58 CEST 2009


Hello

i have question about opensips , to act like SIP client
i usualy use asterisk as sip proxy for my phones, but now i need to use
asterisk as proxy to sip account to another asterisk (at my sip provider)
but in this case asterisk cant act as common SIP client ( it was told on
asterisk forum )
so i am trying to use opensips as gateway between those asterisks, is it
the right way, or am i totally wrong ?

in debug i see, all is ok beetween my asterisk and opensips, but there
is no INVITE from opensips to providers asterisk


here is part of my config

port=5061

      if (!lookup("location")) {
                switch ($retcode) {
                        case 1: #i don't know why retcode is 1, but it
is just so
                                if(uri=~"^sip:1234567@") { #1234567 is
SIP phone on my asterisk
                                    rewritehostport("62.176.162.7:5060");
                                    append_hf("P-hint:
outbound-local-asterisk\r\n");
                                    route(1);
                                    return;

                                };

                                if (uri=~"^sip:[0-9]*@") {
                                     rewriteuser("0232661107"); #user on
providers asterisk
                                     rewriteuserpass("xxxxx"); #password
                                     rewritehostport("62.176.161.51:5060");
                                     append_hf("P-hint:
outbound-provider\r\n");
                                     route(1);
                                     return;


                                }
                        case -1:
.....

route[1] {
        # for INVITEs enable some additional helper routes
        if (is_method("INVITE")) {
                t_on_branch("2");
                t_on_reply("2");
                t_on_failure("1");
        }

        if (!t_relay()) {
                sl_reply_error();
        };
        exit;
}




More information about the Users mailing list