Re: [reSIProcate] can not output user param in URI
Yes it is very helpfull :-)
The use case is simply that I must code a getParameterNames() method to
comply with some specifications...
So instead of creating a parser, since I am already using reSiprocate, I
was hoping that there was a way to do that
For now I will do has you suggested and parse from encodeParameters
Thank you again for your help
Julien
> You aren't really supposed to do that. The assumption is that the set
> of extension parameters is known at runtime. If you can share your use
> case, we might be able to suggest a more SIP friendly alternative.
>
> However, if you insist, you can get to the parameters as a string with:
>
> std::ostream& encodeParameters(std::ostream& str) const;
>
> called on the header, and then look for the unknown parameters
> yourself in the resulting string.
>
> The unknown parameters happen to be at the end of the string, but that
> is not forward compatible. Pretty icky. Alternatively, you could
> modify the source and break up encodeParameters into encodeParameters
> and encodeUnknownParameters. Slightly less icky.
>
> Hope that helps.
>
> david
>
>
> On 8/21/06, julien <julien@xxxxxxxxxxx> wrote:
>> Ok sorry for the confusion between user-parameter and extension
>> parameter,
>> I am sorry I am still a bit confused with SIP
>> If there is no way to iterate through the parameters,
>> how can I get the name of the unknown extension parameters?
>> (I am sorry it's probably a dumb question)
>> for ex:
>> "sip:user:password@host:4242;ttl=15;user="me";paf=pouf;pif =plof"
>> So if I need to get the values of paf and pif...
>> I guess I would need to do something like:
>> cout << uri.param(UnknownParameterType("paf"));
>> cout << uri.param(UnknownParameterType("pif"));
>> but how do I get "paf" and "pif" in the first place? :-(
>>
>> Thank you for your help
>> Best Regards,
>>
>> Julien
>> > But, the x-v17 is a user parameter, so we should be parsing that. Now,
>> > the question is, when we call Uri::user(), should we be getting the
>> > user parameters with it, or not?
>> >
>> > Best regards,
>> > Byron Campen
>> >
>> >> "foo" would be considered an extension parameter...
>> >>
>> >> http://wiki.resiprocate.org/wiki/index.php?title=Use_Overview#Uri
>> >> http://wiki.resiprocate.org/wiki/index.php?title=Uris
>> >>
>> http://wiki.resiprocate.org/wiki/index.php?title=Use_Overview#Extension_
>> >> parameters
>> >>
>> >> There is no way to iterate through the parameters.
>> >>
>> >> Scott
>> >>
>> >>> -----Original Message-----
>> >>> From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx
>> >>> [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of
>> >>> julien
>> >>> Sent: Monday, August 21, 2006 5:24 AM
>> >>> To: resiprocate-devel
>> >>> Subject: [reSIProcate] can not output user param in URI
>> >>>
>> >>> Hello everyone,
>> >>> I am having troubles getting the user-parameters from a URI, I do :
>> >>>
>> >>> Uri uri("sip:user;x-v17:password@xxxxxxxx:5555;foo=bar");
>> >>> cout << "user!!" << uri.user() << endl;
>> >>> cout << "password!!" << uri.password() << endl; cout <<
>> "userParams!!"
>> >>> << uri.userParameters() << endl;
>> >>>
>> >>> On the output I get this :
>> >>> user!!user;x-v17
>> >>> password!!password
>> >>> userParams!!
>> >>>
>> >>> I don't get any userParams on the output I tried this using
>> >> testUri.cxx
>> >>> Is this test correct?
>> >>> I am trying to get "foo"="bar" or equivalent, (actually I need to
>> get
>> >>> all the parameters name and values one by one)
>> >>>
>> >>> I am using : reSIPprocate-1.0-RC1 (I checked out the latest version
>> >>> because it was not working either with my previous version) on
>> windows
>> >>> XP sp2, and VS2005 (compiling in /Mtd mode)
>> >>>
>> >>> Please I really need this! Any help or suggestion welcome Thank
>> you in
>> >>> advance
>> >>>
>> >>> --
>> >>> Julien
>> >>>
>> >>>
>> >>> _______________________________________________
>> >>> resiprocate-devel mailing list
>> >>> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
>> >>> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
>> >>
>> >> _______________________________________________
>> >> resiprocate-devel mailing list
>> >> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
>> >> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
>> >
>>
>>
>> --
>> Julien Saito
>> ジュリアン 齋藤
>> julien@xxxxxxxxxxx
>>
>>
>> _______________________________________________
>> resiprocate-devel mailing list
>> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
>> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
>
>
--
Julien Saito
ジュリアン 齋藤
julien@xxxxxxxxxxx