[OpenSER-Devel] No result using function parse_uri()
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Wed May 7 22:02:51 CEST 2008
Hi Matheus,
I was referring to the "uri" variable....Is it a typo in your reply? It
should be sip_uri* type :)
Check if the string you pass to "parse_uri" is not empty and try to see
if there are any fields set in the structure after parsing.
Regards,
Bogdan
Matheus Araújo Aguiar wrote:
> Hi Bogdan,
>
> I declare it like this: struct sip_msg* uri;
> before using, i allocate space for it using function pkg_malloc();
>
> cya
>
> On Mon, Apr 28, 2008 at 6:01 PM, Bogdan-Andrei Iancu
> <bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>> wrote:
>
> Hi Matheus,
>
> How do you declare the "uri" (third param) variable?
>
> Regards,
> Bogdan
>
> Matheus Araújo Aguiar wrote:
>
> Hello everyone,
>
> I'm coding an extension to OpenSER and I'm getting no result
> from the function parse_uri().
> The code is like this:
>
> struct to_body* b;
> ...
> b = (struct to_body*)msg->from->parsed; /* msg
> is the struct sip_msg received, the headers From and To have
> already been parsed, and i can show their uri on the screen
> without trouble */
>
> if(parse_uri(b->uri.s, b->uri.len, uri) < 0){
> ... (error msgs and etc) ...
> }
> else {
> user = uri->user;
> host = uri->host;
> LM_DBG("user %*.s host %*.s\n", user.len,
> user.s, host.len, host.s );
> }
>
> What I get on the screen after this "printout" is nothing, the
> strings user.s and host.s seem to be empty.
>
> I think that I'm doing everything right, and I cannot see what
> I'm doing wrong here. So I'd appreciate any kind of help with
> this problem.
>
> Best regards,
>
> --
> Matheus Araújo Aguiar
> Computer Science Student
> matheus.pit at gmail.com <mailto:matheus.pit at gmail.com>
> <mailto:matheus.pit at gmail.com <mailto:matheus.pit at gmail.com>>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Devel mailing list
> Devel at lists.openser.org <mailto:Devel at lists.openser.org>
> http://lists.openser.org/cgi-bin/mailman/listinfo/devel
>
>
>
>
>
>
> --
> Matheus Araújo Aguiar
> Computer Science Student
> matheus.pit at gmail.com <mailto:matheus.pit at gmail.com>
More information about the Devel
mailing list