[OpenSIPS-Users] Modify Invite

Brad Bendy brad.bendy at benganetworks.com
Fri Apr 30 16:10:35 CEST 2010


Hi,

Im bringing this back up again.

Ive had to switch our INVITE format as some upstreams parse the INVITE
differently, I just need to change the order of variables around.

Now the weird thing is, I set the $ru and then when I check to see what
$ru is set to, it's been set correct, the order and all variables are
correct, but then openSIPs sends the INVITE out it fails to modify it at
all.

I was using:
$ru='sip:' + $rU + '@' + $rd + ';npdi=yes' + ';rn=' + $avp(s:lrn);

now
$ru='sip:' + $rU + ';npdi=yes' + ';rn=+1' + $avp(s:lrn) + '@' + $rd;

Before the INVITE would look like:

INVITE sip:+11235559999 at 1.1.1.1;npdi=yes;rn=+11235559999 SIP/2.0

but now it should look like INVITE sip:+11235559999;npdi=yes;rn=
+11235559999 at 1.1.1.1 SIP/2.0

it currently looks like INVITE sip:+11235559999 at 1.1.1.1 SIP/2.0.

Any ideals why just the positions of the AVPs and the other text would
matter? I think it's weird when I use xlog() to print what $ru is set to
it shows the correct value just OpenSIPs does not modify the INVITE. Not
sure if anyone else has ran into this on the list or not.

Thanks!


On Mon, 2010-02-22 at 13:21 -0700, Brad Bendy wrote:

> I just did: 
> $ru='sip:' + $rU + '@' + $rd + ';npdi=yes' + ';rn=' + $avp(s:lrn);
> 
> That works like a champ, thanks for help on this, rewriting the ru
> direct took care of it!
> 
> Thanks again
> 
> On Mon, 2010-02-22 at 18:24 +0200, Bogdan-Andrei Iancu wrote: 
> 
> > Brad,
> > 
> > the function does not support variables as parameters :(.
> > 
> > But a simple workaround, if you want to add a parameter to the RURI is:
> >     $ru = $ru + ";rn=" + $avp(s:foo) ;
> > 
> > Regards,
> > Bogdan
> > 
> > Brad Bendy wrote:
> > > Hi Bogdan,
> > >
> > > I just tried the add_uri_param() but when a avp since I need to pass a 
> > > dynamic value to it, and it errors out with a syntax error. If I try 
> > > with double quotes around the avp it then literally displays 
> > > "$avp(s:foo)" when it adds to the URI.
> > >
> > > Something im missing?
> > >
> > > Thanks
> > >
> > > On Mon, 2010-02-22 at 10:45 +0200, Bogdan-Andrei Iancu wrote:
> > >> Hi Brad,
> > >>
> > >> Maybe http://www.opensips.org/html/docs/modules/1.6.x/uri.html#id270649 ?
> > >>
> > >> Regards,
> > >> Bogdan
> > >>
> > >> Brad Bendy wrote:
> > >> > Hi list,
> > >> >
> > >> > I need to add npdi=yes;rn=xxxxxxxxxx when I send a INVITE out. Ive 
> > >> > looked and don't really see any way to do this exactly. Is their a 
> > >> > module im missing to do this, or some sort of method? I thought this 
> > >> > would be in textops maybe but I do not see it in that module either.
> > >> >
> > >> > Any help or pointers would be great.
> > >> >
> > >> > Thanks!
> > >> > ------------------------------------------------------------------------
> > >> >
> > >> > _______________________________________________
> > >> > Users mailing list
> > >> > Users at lists.opensips.org <mailto:Users at lists.opensips.org>
> > >> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> > >> >   
> > >>
> > >>
> > >>     
> > >
> > > ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > Users mailing list
> > > Users at lists.opensips.org
> > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> > >   
> > 
> > 
> 
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100430/c7be3ddc/attachment.htm 


More information about the Users mailing list