[OpenSER-Users] Openser as a conditional stateless proxy
Christian Schlatter
cs at unc.edu
Mon Nov 5 16:16:18 CET 2007
Padmaja wrote:
> Hi,
>
> Thanks for the reply,
> Could you provide me the example script for stateless forwarding of
> invite when a call is received from say a 911 operator to the server?
> I suppose this should be implemented by checking the From field of the
> invite and if it is from a certain 911, then it should be forwarded
> statelessly (or is this logic incorrect?). I am new to the Openser
> stuff, so I do not wish to change the script myself.
Your logic is correct, you can either check the From: header or the
request URI or any other part of an incoming SIP message to make the
routing decision.
A simple example looks like:
if (is_method('INVITE'))
{
# check if from URI domain equals 911operator.com
if ($fd == '911operator.com')
{
# relay stateless using request URI
forward();
exit;
}
else
{
# relay statefull using request URI
if (!t_relay())
{
sl_reply_error();
};
exit;
}
}
Please always CC users at lists.openser.org so that others can take
advantage of the discussion.
/Christian
>
> Thanks again,
> Padmaja
>
> ----- Original Message ----- From: "Christian Schlatter" <cs at unc.edu>
> To: "Padmaja" <padmaja.rv at vodcalabs.com>
> Cc: <users at lists.openser.org>
> Sent: Monday, November 05, 2007 4:53 AM
> Subject: Re: [OpenSER-Users] Openser as a conditional stateless proxy
>
>
>> Padmaja wrote:
>>> Hi all,
>>>
>>> Can any one tell me if the same running instance of Openser can be
>>> configured as a stateful proxy for some user accounts and for some
>>> numbers like emergency services, it acts like a stateless proxy, just
>>> forwarding the request to the destination?
>>
>> Yes, it only depends on what forwarding function is used in the
>> routing script:
>>
>> - t_forward(..) --> stateless
>>
>> - t_relay(..) --> stateful
>>
>> /Christian
>>
>
More information about the sr-users
mailing list