[OpenSIPS-Devel] Getting header field values as single

Gürkan Aslan gurkan.aslan at comturk.com
Wed Sep 24 16:12:31 CEST 2008


Hi Bogdan,

I tried to use these parser functions before send the message and ask
this question to mailing list. parser_from_uri function returns a
sip_uri struct and i tried to reach each parameter of result data. Some
of the parameters are empty (NULL) and some of them includes whole data
as you can see below;

(There is the sample code;

    struct sip_uri tst;

    tst = *parse_from_uri(rq);
    LM_ERR("user: %s, user_param: %s, user_param_val: %s",
            tst.user.s, tst.user_param.s, tst.user_param_val.s);

I coded these lines to modules/acc/acc.c file as in acc_log_request
function. What is my mistake?)

There is the result of tst.user.s:

124 at 192.168.2.143>;tag=c3d3328ef6c9225ao1
To: <sip:123 at 192.168.2.143>
Call-ID: e5d88d9e-6e45028a at 192.168.2.86
CSeq: 102 INVITE
Max-Forwards: 69
Proxy-Authorization: Digest
username="124",realm="192.168.2.143",nonce="48da495800000000fdc52515acf7a7bc89625e1f46409c6c",uri="sip:123 at 192.168.2.143",algorithm=MD5,response="feb4e0f3987225036222dfc8cd68eaf0"
Contact: outeger2 <sip:124 at 192.168.2.86:5061>
Expires: 240
User-Agent: Linksys/PAP2T-3.1.15(LS)
Content-Length: 444
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: x-sipura
Content-Type: application/sdp

v=0
o=- 2044177 2044177 IN IP4 192.168.2.86
s=-
c=IN IP4 192.168.2.86
t=0 0
m=audio 16430 RTP/AVP 0 2 4 8 18 96 97 98 100 101
a=rtpmap:0 PCMU/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:4 G723/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729a/8000
a=rtpmap:96 G726-40/8000
a=rtpmap:97 G726-24/8000
a=rtpmap:98 G726-16/8000
a=rtpmap:100 NSE/8000
a=fmtp:100 192-193
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:30
a=sendrecv

Sal, 2008-09-23 tarihinde 11:05 +0300 saatinde, Bogdan-Andrei Iancu
yazdı:
> Hi Gürkan,
> 
> Use the :
> 
> struct sip_uri *parse_from_uri(struct sip_msg *msg);
> 
> function from parser/parse_from.h and
> 
> struct sip_uri *parse_to_uri(struct sip_msg *msg);
> 
> from parser/parse_to.h .
> 
> Regards,
> bogdan
> 

-- 
Gürkan Aslan
Senior Developer
Komturk Iletisim Ltd. Sti
Phone: +90 212 275 88 99 ext 125




More information about the Devel mailing list