Hello
g++ (GCC) 4.6.2
I have a string that I need parse. The string is sdp information. I am trying to seperate each of the elements into seperate strings. Basically the string would contain some thing like this:
What is the best method to get the ip address?Code:v=0 o=sip_user IN 10230 22472 IP4 NET.CAT.NTBC s=SIP_CALL c=IN IP4 10.10.10.44 m=audio 49152 RTP/AVP 0 8 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000
I was trying something like this:
Many thanks for any advice.Code:char *ip_addr = NULL; ip_addr = strstr(sdp_string, "c=") ; if(ip_addr ! = NULL) { printf("foundline: [%s]", ip_addr) ; }




Reply With Quote