Is your public IP dynamic? I am curious how other people handle the problem of
dynamic IP's within the context of openser. If you hard code an address in
the script it has to be manually changed whenever your IP changes.
On Friday 11 January 2008, Peter P GMX wrote:
I think it may have to do with the following point, which I found?
This is not a bug, but a known limitation of openser. In openser, message
rewriting is done at the end of the routing. All the openser.cfg functions
which manipulates the message generates "lumps". This lumps are applied at
just before sending out the message. Thus, all functions always see the
original received message even if another function already manipulated the
message (added a lump). Thus, if the same part of the message is rewritten
twice, the behavior is undefined.
In your case, the manipulate the Contact header 2 times:
2. fix_nated_contact() or fix_contact()
In my case after this replacement there is another fix_contact() and
then this function breaks.
How do I set the var?
Best regards Peter.
Robert Dyck schrieb:
> The example I gave works for me with openser 1.3.0 and I have not tried
> it with other versions.
> In the example the substring contained within the ( ) like (Contact:.+@)
> is supposed to be preserved by /\1whatever/ and the remainder of the left
> side should be discarded.
> It's too bad that openser is designed primarily for service providers
> With a few tweaks it would be easier for SIP users to set up. Like I
> mentioned earlier there is an old patched version of nathelper that did
> the contact mangling quite well. And the typical small user has to deal
> with dynamic IP's as well. I think the IP's of eth0 or whatever should be
> made available to the routing script like a pseudo var. Another nice
> thing would be a well thought example script that would serve the needs
> of a home or small business phone system. It's time to get off the soap
> I am curious, how do you go about setting $var(my_ip)?
> On Thursday 10 January 2008, Peter P GMX wrote:
>> I have a similar problem, but this regexp solution caused a strange
>> The original Contact Address, which shall replaced is:
>> with $var(my_ip)=22.214.171.124 (Example)
>> leads to
>> So the secod address is simply added.
>> I tried another way:
>> leads to
>> Contact: <sip:firstname.lastname@example.org>sip:email@example.com:5060
>> Best regards
>> Robert Dyck schrieb:
>>> I assume you are referring to a SIP message and not its IP wrapper. And
>>> I also assume you are using fix_nated_contact() from nathelper. This
>>> function is working as it was designed. I quote from the documentation
>>> "Rewrites Contact HF to contain request's source
>>> I believe nathelper was built to aid service providers who might
>>> receive SIP messages with unroutable contacts.
>>> In the past I have used a patched version of nathlper that let you
>>> specify the address you wanted in the Contact. I did not write the
>>> patch and I am not a programmer so I did not want to build a new patch
>>> for each new version of openser. I finally settled for a textops
>>> equivalent. $var(my_ip) is set elsewhere in the script.
>>> On Friday 28 December 2007, Alex Balashov wrote:
>>>> I have a strange problem using OpenSER 1.3.x with nathelper.
>>>> Two ethernet interfaces:
>>>> eth0 = 192.168.0.0/24
>>>> eth1 = outside.ip/29
>>>> For some reason, no matter what I do to mangle the requests with
>>>> nathelper's functions, the packet is *always* sent out of eth1 with
>>>> the *source address* of the machine's eth0. Obviously, the
>>>> from the far-end SIP peer never gets back.
>>>> The packet does physically go over eth1, I know that much from packet
>>>> captures. I don't even see how this is possible; when OpenSER
>>>> a packet, shouldn't it originate according to the machine's
>>>> table, take the most specific route, and consequently, adopt the right
>>>> source address?
>>>> What gives?
>>>> I have OpenSER 'listening' on both interfaces, and have tried
>>>> and off with this setting.
>>>> Alex Balashov
>>>> Evariste Systems
>>>> Web : http://www.evaristesys.com/
>>>> Tel : +1-678-954-0670
>>>> Direct : +1-678-954-0671
>>>> Users mailing list
>>> Users mailing list