Thank you so much for writing me back. I did subsequently call pjsip_endpt_create_pool but still crashes. Any ideas? here is the output from my code snippet 16:25:21.208 os_core_unix.c pjlib 1.8 for POSIX initialized 16:25:21.209 sip_endpoint.c Creating endpoint instance... 16:25:21.209 pjlib select() I/O Queue created (0xa1a7730) 16:25:21.209 sip_endpoint.c Module "mod-msg-print" registered 16:25:21.209 sip_transport. Transport manager created. 16:25:21.209 sip.c The message size is 41 16:25:21.210 os_core_unix.c pjlib 1.8 for POSIX initialized 16:25:21.210 sip.cpp Error in pjlib_util_init(): Object already exists (PJ_EEXISTS) [status=70015] [root at localhost bin]# <-CODE SNIP-> status = pj_init(); if (status != PJ_SUCCESS) error_exit("Error in pj_init()", status); status = pjlib_util_init(); if (status != PJ_SUCCESS) error_exit("Error in pjlib_util_init()", status); pj_caching_pool_init(&cp, &pj_pool_factory_default_policy,8000); status = pjsip_endpt_create(&cp.factory, NULL, &g_endpt); if (status != PJ_SUCCESS) error_exit("Error in pjsip_endpt_create()", status); pool = pjsip_endpt_create_pool(g_endpt, NULL, 8000, 8000); if (status != PJ_SUCCESS) error_exit("Error in pjsip_endpt_creat_pool()", status); pj_list_init(&err); int len = strlen(testmsg); PJ_LOG(1,("sip.c", "The message size is %d",len)); pjsip_msg *msg = pjsip_parse_msg(pool,testmsg, len, &err); <--END CODE--> -----Original Message----- From: pjsip-bounces@xxxxxxxxxxxxxxx on behalf of Benny Prijono Sent: Tue 10/19/2010 10:33 AM To: pjsip list Subject: Re: seg faulting while using pjsip_parse_msg Did you forget to create the pool? Best regards, ?Benny On Tue, Oct 19, 2010 at 12:25 AM, Thomas Tavaris J (Tavaris) <tjthomas at lgsinnovations.com> wrote: > Hello, > > I am new to pjsip and unsuccessfully trying (for days) to use pjsip to parse > a sip message contained in a char* buffer. I have looked at sample source > code for assistance but I am still getting seg faults. (google'ing hasnt > provided much help either) > My program doesn't need to do anything elaborate, just parse the data for > the SIP message and print it to the screen. In my case I have simple pcap > file with a SIP registration contained within it and would like pjsip to > parse it. Thank you so much for your help. If you need any additional info > please let me know. > > -t > > When I run my program I get the following output: > ?12:01:15.705 os_core_unix.c? pjlib 1.8 for POSIX initialized > ?12:01:15.716 sip_endpoint.c? Creating endpoint instance... > ?12:01:15.717????????? pjlib? select() I/O Queue created (0x1ef4d730) > ?12:01:15.717 sip_endpoint.c? Module "mod-msg-print" registered > ?12:01:15.717 sip_transport.? Transport manager created. > ?12:01:15.717????????? sip.c? The message size is 529 > Segmentation fault > [root at localhost bin]# > > When I run my program through gdb I get the following: > (gdb) run register.pcap > Starting program: /root/upe/bin/gm register.pcap > [Thread debugging using libthread_db enabled] > ?12:03:17.587 os_core_unix.c? pjlib 1.8 for POSIX initialized > ?12:03:17.587 sip_endpoint.c? Creating endpoint instance... > ?12:03:17.587????????? pjlib? select() I/O Queue created (0x88c730) > ?12:03:17.587 sip_endpoint.c? Module "mod-msg-print" registered > ?12:03:17.587 sip_transport.? Transport manager created. > ?12:03:17.587????????? sip.c? The message size is 529 > > Program received signal SIGSEGV, Segmentation fault. > 0x00000000004b15a1 in pjsip_msg_create () > (gdb) > > my code is below: > > ??? status = pj_init(); > ??? if (status != PJ_SUCCESS) error_exit("Error in pj_init()", status); > > ??? status = pjlib_util_init(); > ??? if (status != PJ_SUCCESS) error_exit("Error in pjlib_util_init()", > status); > > ??? pj_caching_pool_init(&cp, &pj_pool_factory_default_policy,8000); > > ??? status = pjsip_endpt_create(&cp.factory, NULL, &g_endpt); > ??? if (status != PJ_SUCCESS) error_exit("Error in pjsip_endpt_create()", > status); > > ??? pj_list_init(&err); > ??? np::dout << "THe message size is: " << msgsize << " bytes." << endl; > ??? PJ_LOG(4,("sip.c", "The message size is %d",msgsize)); > > > ??? pjsip_msg *msg = pjsip_parse_msg(pool,(char*) buf, msgsize, &err); > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip at lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 4745 bytes Desc: not available URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20101019/941a47f1/attachment-0001.bin>