Results 1 to 2 of 2

Thread: [RESOLVED] Parsing a string

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331

    Resolved [RESOLVED] Parsing a string

    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:

    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
    What is the best method to get the ip address?

    I was trying something like this:

    Code:
    char *ip_addr = NULL; 
    ip_addr = strstr(sdp_string, "c=") ; 
    if(ip_addr ! = NULL) { 
    printf("foundline: [%s]", ip_addr) ; 
    }
    Many thanks for any advice.
    Last edited by steve_rm; Dec 8th, 2011 at 12:24 PM.
    steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width