[OpenSIPS-Users] OpenSER as reverse proxy / relay, external to internal

Adam Goldberg ensnare at gmail.com
Thu Oct 16 19:25:11 CEST 2008


Hello -- thanks for the response.  My current config looks like this,
but I keep getting a server error.  Any help would be greatly
appreciated ...

# lower debug level for debugging purposes:
debug=5
log_stderror = yes
fork=yes
children=4
check_via=no
dns=no
mpath="/usr/lib/openser/modules/"
listen=10.90.80.70
port=5060
alias=external.example.com

loadmodule "sl.so"
loadmodule "textops.so"
loadmodule "rr.so"
loadmodule "tm.so"

modparam("rr", "enable_full_lr", 1)
modparam("rr", "enable_double_rr",0)

route {
        if (dst_ip==100.90.80.70) {
         force_send_socket(udp:10.0.0.1:5060);
         route(1);
        }
}

route[1] {

        rewritehostport("10.1.1.1:5060");
         exit;
}

-------------

U 2008/10/16 13:14:54.108589 100.90.80.70:5060 -> 167.206.128.5:1024
SIP/2.0 500 Server error occurred (2/TM).
Via: SIP/2.0/UDP
167.206.128.5:1026;rport=1024;branch=z9hG4bK0a000a650000002348f776721529e2e80000003e.
Call-ID: E26D4B26-1DD1-11B2-8DDC-A7CF6FB40770 at 10.1.1.1.
CSeq: 1 INVITE.
From: "Paris"<sip:167.206.128.5>;tag=111587218537562847.
To: <sip:5029 at external.example.com>;tag=bfc7b0e66e876caae82df7e488fd9e1d-5cbd.
Server: OpenSER (1.3.1-notls (x86_64/linux)).
Content-Length: 0.










On Thu, Oct 16, 2008 at 4:58 PM, Bogdan-Andrei Iancu
<bogdan at voice-system.ro> wrote:
> Hi Adam,
>
> you should do something like:
>
> if (dst_ip==100.90.80.70) {
>   force_send_socket(udp:10.1.1.1:5060);
>   .....
>   <change uri, do routing>
>   .....
> }
>
>
> Regards,
> Bogdan
>
> Adam Goldberg wrote:
>>
>> Hi -- I have a machine running openser 1.3.1-notls ... the machine has
>> two interfaces, one public (100.90.80.70) and one private (10.0.0.1)
>> ... We have a SIP gateway on our internal network with IP 10.1.1.1.
>> I'm trying to configure this so all calls to 100.90.80.70 are relayed
>> to 10.1.1.1.  My current config looks like this; but nothing is
>> working ... help would be much appreciated.
>>
>> Thanks in advance,
>> Adam
>>
>>
>>
>>
>> # lower debug level for debugging purposes:
>> debug=5
>> log_stderror = yes
>> fork=yes
>> children=4
>> check_via=no
>> dns=no
>> mpath="/usr/lib/openser/modules/"
>>
>> loadmodule "sl.so"
>> loadmodule "textops.so"
>> loadmodule "rr.so"
>> loadmodule "tm.so"
>> loadmodule "usrloc.so"
>> loadmodule "nathelper.so"
>> loadmodule "mediaproxy.so"
>> loadmodule "domain.so"
>>
>> modparam("rr", "enable_full_lr", 1)
>> modparam("rr", "enable_double_rr",0)
>>
>> route {
>>        if (msg:len >= 2048 ) {
>>                sl_send_reply("513", "Message too big");
>>                exit;
>>        };
>>
>>        if (loose_route()) {
>>                append_hf("P-hint: rr-enforced\r\n");
>>                route(1);
>>        };
>>
>>        if (!uri==myself) {
>>                append_hf("P-hint: outbound\r\n");
>>                route(1);
>>        };
>>
>>        route(1);
>> }
>>
>> route[1] {
>>        rewritehostport("10.1.1.1:5060");
>>        force_rtp_proxy();
>>        fix_nated_contact();
>>         if (!t_relay()) {
>>                sl_reply_error();
>>        };
>>         exit;
>> }
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>



More information about the Users mailing list