[Users] Re: Multiple invites

Klaus Darilion klaus.mailinglists at pernau.at
Mon Apr 23 16:02:52 CEST 2007



raviprakash sunkara wrote:
> Hi Klaus ,
> Thanks for replying ,
> 
> if(method=="INVITE" && uri=~"sip:B at xx.xxx.xx ")
> {
>            setuser("C");
>            append_branch()
>            t_relay();
> };

# if someone calls B, the call should be forwarded to C too.
#
if(method=="INVITE" && uri=~"sip:B at xx.xxx.xx ")
{
	# copy the current branch (branches[0]) into
	# a new branch (branches[1])
	append_branch();
	# all URI manipulation functions work on branches[0]
	# thus, URI manipulation does not touch the
	# appended branch (branches[1])
         seturi("sip:C at domain");

	# now: branch 0 = C at domain
	#      branch 1 = B at xx.xx.xx.xx

	# and if you need a third destination ...

	# copy the current branch (branches[0]) into
	# a new branch (branches[2])
	append_branch();

	# all URI manipulation functions work on branches[0]
	# thus, URI manipulation does not touch the
	# appended branch (branches[1-2])
         seturi("sip:D at domain");

	# now: branch 0 = D at domain
	#      branch 1 = B at xx.xx.xx.xx
	#      branch 2 = C at domain

	t_relay();
	exit;
};

You could also use append_branch("sip:C at domain") which adds a branch 
with the new URI:


if(method=="INVITE" && uri=~"sip:B at xx.xxx.xx ")
{
	# append a new branch with the second destionation
	append_branch("sip:user at domain");
	# now: branch 0 = B at xx.xx.xx.xx
	# now: branch 1 = C at domain

	t_relay();
	exit;
};

regards
klaus


> 
> The B's Information is override by C , But Call goes to C , only,
> 
> When A invites B, then B and C has ring parallel.
> 
> On 4/23/07, Klaus Darilion <klaus.mailinglists at pernau.at> wrote:
>>
>> Take a look at append_branch(). (core documentation)
>>
>> regards
>> klaus
>>
>> raviprakash sunkara wrote:
>> > Hello Users,
>> >
>> > For My Sip Servicing, There is Call Hunting Features
>> >
>> > This had done , When I forwarded the Asterisk Server.
>> > But I want to implements in  OpenSER itself,
>> >
>> > When A Calls to B, the proxy has to send to invites to B and C, So that
>> B
>> > and C rings simultaneously
>> >
>>
> 
> 
> 




More information about the sr-users mailing list