---------- Forwarded message ---------- From: McAuther Bruce <brucegogogogo@xxxxxxxxx> Date: 2008/8/8 19:17 Subject: Fwd: Asterrisk and PJSIP0.9.0 about 500 Internal Server Error To: pjsip at lists.pjsip.org Hi , I have found the key problem loaction !! The problem is my embeded board will print "(null)" if use printf("%s",ptr); , ptr is a null pointer This will cause the problem that pjsip use "pj_ansi_snprintf(....)" , because the "(null)" will also type into the target string pointer or array !! Have any one ever eccounter this case ?? thanks !! ---------- Forwarded message ---------- From: McAuther Bruce <brucegogogogo@xxxxxxxxx> Date: 2008/8/8 16:07 Subject: Fwd: Asterrisk and PJSIP0.9.0 about 500 Internal Server Error To: pjsip at lists.pjsip.org I missed some information that Problem 2 When UA2 send "INVITE" to UA1 , UA1(PJSIP) will respond with "500 Internal Server Error" I trace code and found that the wrong place is from "pjsua_call_on_incoming" >>> "pjsip_dlg_create_uas" >>> ( /* Init local contact. */ ) "pjsip_parse_uri" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------- Forwarded message ---------- From: McAuther Bruce <brucegogogogo@xxxxxxxxx> Date: 2008/8/8 14:20 Subject: Asterrisk and PJSIP0.9.0 about 500 Internal Server Error To: pjsip at lists.pjsip.org Server : <1> Asterrisk in embeded board <2> IP : 10.10.10.105 UA1 : <1> PJSIP 0.9.0 in mips R3000 embeded board <2> ./cnofigure --disable-sound ; make <3> IP : 10.10.10.110 <4> Register : sip:8002 at 10.10.10.105 <sip%3A8002 at 10.10.10.105> UA2 : <1> Embeded board with other company developed SIP client and VOIP <2> IP : 10.10.10.86 <3> Register : sip:8003 at 10.10.10.105 <sip%3A8003 at 10.10.10.105> Enviriment : private IP with the same LAN I have browsed the mailing list and found that PJSIP with Asterrisk have many problems : Problem 1.When UA2 send "INVITE" to UA1 , Asterrisk will Modify "to" tag from "sip:8002 at 10.10.10.105 <sip%3A8002 at 10.10.10.105>" to " sip:8002 at 10.10.10.110 <sip%3A8002 at 10.10.10.110>" ! This behavior leads that PJSIP uses the default account ( sip:10.10.10.110 ) to accepte this call , I don't know whether is this carrect ?? Problem 2 When UA2 send "INVITE" to UA1 , UA1(PJSIP) will respond with "500 Internal Server Error" I trace code and found that the wrong place is from "pjsua_call_on_incoming" >>> "pjsip_dlg_create_uas" >>> "pjsip_parse_uri" And into "pjsip_parse_uri" , I cant understand why the code written in the last line in this function will return NULL !! It is not likely some error is occured here !! And if UA1 is replaced with my linux PC , it is working correct !! I used the same compiling configure beside of different gcc (mips vs. x86) !! Below is UA2 >>> INVITE >>> UA1 ( mips ) 00:09:46.620 pjsua_core.c RX 879 bytes Request msg INVITE/cseq=102 (rdata0x10075564) from UDP 10.10.10.105:5060: INVITE sip:8002 at 10.10.10.110:5060 SIP/2.0 Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK405d9f30;rport From: "8003" <sip:8003@10.10.10.105 <sip%3A8003 at 10.10.10.105> >;tag=as3671963f To: <sip:8002 at 10.10.10.110:5060> Contact: <sip:8003 at 10.10.10.105 <sip%3A8003 at 10.10.10.105>> Call-ID: 09a5f65f44738ca92f2a2d5d317b074d at 10.10.10.105 CSeq: 102 INVITE User-Agent: PBX Max-Forwards: 70 Date: Fri, 08 Aug 2008 03:48:25 GMT Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Content-Type: application/sdp Content-Length: 361 v=0 o=root 27412 27412 IN IP4 10.10.10.105 s=session c=IN IP4 10.10.10.105 b=CT:384 t=0 0 m=audio 15518 RTP/AVP 18 3 101 a=rtpmap:18 G729/8000 a=fmtp:18 annexb=no a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=silenceSupp:off - - - - a=ptime:20 a=sendrecv m=video 18582 RTP/AVP 96 a=rtpmap:96 MP4V-ES/90000 a=sendrecv --end msg-- 00:09:46.620 pjsua_media.c Media index 0 selected for call 3 >>>>>Check <1> >>>>>Status <171039> 00:09:46.650 pjsua_core.c TX 305 bytes Response msg 500/INVITE/cseq=102 (tdta0x10088a78) to UDP 10.10.10.105:5060: SIP/2.0 500 Internal Server Error Via: SIP/2.0/UDP 10.10.10.105:5060;rport=5060;received=10.10.10.105 ;branch=z9hG4bK405d9f30 Call-ID: 09a5f65f44738ca92f2a2d5d317b074d at 10.10.10.105 From: "8003" <sip:8003@10.10.10.105 <sip%3A8003 at 10.10.10.105> >;tag=as3671963f To: <sip:8002 at 10.10.10.110 <sip%3A8002 at 10.10.10.110>> CSeq: 102 INVITE Content-Length: 0 --end msg-- 00:09:46.650 pjsua_core.c RX 353 bytes Request msg ACK/cseq=102 (rdata0x10075564) from UDP 10.10.10.105:5060: ACK sip:8002 at 10.10.10.110:5060 SIP/2.0 Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK405d9f30;rport From: "8003" <sip:8003@10.10.10.105 <sip%3A8003 at 10.10.10.105> >;tag=as3671963f To: <sip:8002 at 10.10.10.110:5060> Contact: <sip:8003 at 10.10.10.105 <sip%3A8003 at 10.10.10.105>> Call-ID: 09a5f65f44738ca92f2a2d5d317b074d at 10.10.10.105 CSeq: 102 ACK User-Agent: PBX Max-Forwards: 70 Content-Length: 0 --end msg-- 00:09:46.660 sip_endpoint.c Message Request msg ACK/cseq=102 (rdata0x10075564) from 10.10.10.105:5060 was dropped/unhandled by any modules Below is UA2 >>> INVITE >>> UA1 ( x86 linux pc ) 10:08:40.412 pjsua_core.c RX 879 bytes Request msg INVITE/cseq=102 (rdata0x825dce4) from UDP 10.10.10.105:5060: INVITE sip:8002 at 10.10.10.130:5060 SIP/2.0 Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK5895efd9;rport From: "8003" <sip:8003@10.10.10.105 <sip%3A8003 at 10.10.10.105> >;tag=as383603b2 To: <sip:8002 at 10.10.10.130:5060> Contact: <sip:8003 at 10.10.10.105 <sip%3A8003 at 10.10.10.105>> Call-ID: 01ad097266fc84bc1a9292105dec94fe at 10.10.10.105 CSeq: 102 INVITE User-Agent: PBX Max-Forwards: 70 Date: Fri, 08 Aug 2008 02:17:00 GMT Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Content-Type: application/sdp Content-Length: 361 v=0 o=root 25155 25155 IN IP4 10.10.10.105 s=session c=IN IP4 10.10.10.105 b=CT:384 t=0 0 m=audio 16478 RTP/AVP 18 3 101 a=rtpmap:18 G729/8000 a=fmtp:18 annexb=no a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=silenceSupp:off - - - - a=ptime:20 a=sendrecv m=video 14734 RTP/AVP 96 a=rtpmap:96 MP4V-ES/90000 a=sendrecv --end msg-- 10:08:40.412 pjsua_media.c Media index 0 selected for call 1 10:08:40.413 pjsua_core.c TX 290 bytes Response msg 100/INVITE/cseq=102 (tdta0x82a74b8) to UDP 10.10.10.105:5060: SIP/2.0 100 Trying Via: SIP/2.0/UDP 10.10.10.105:5060;rport=5060;received=10.10.10.105 ;branch=z9hG4bK5895efd9 Call-ID: 01ad097266fc84bc1a9292105dec94fe at 10.10.10.105 From: "8003" <sip:8003@10.10.10.105 <sip%3A8003 at 10.10.10.105> >;tag=as383603b2 To: <sip:8002 at 10.10.10.130 <sip%3A8002 at 10.10.10.130>> CSeq: 102 INVITE Content-Length: 0 --end msg-- 10:08:40.413 pjsua_app.c Call 1 state changed to INCOMING 10:08:40.413 conference.c Port 2 (ring) transmitting to port 0 (/dev/dsp) 10:08:40.413 pjsua_app.c Incoming call for account 0! From: "8003" <sip:8003@10.10.10.105 <sip%3A8003 at 10.10.10.105>> To: <sip:8002 at 10.10.10.130 <sip%3A8002 at 10.10.10.130>> Press a to answer or h to reject call 10:08:40.415 sound_port.c EC activated a Answer with code (100-699) (empty to cancel): 200 10:08:46.271 strm0x82a8d74 VAD temporarily disabled 10:08:46.271 strm0x82a8d74 Encoder stream started 10:08:46.271 strm0x82a8d74 Decoder stream started 10:08:46.271 pjsua_media.c Media updates, stream #0: GSM (sendrecv) 10:08:46.271 conference.c Port 2 (ring) stop transmitting to port 0 (/dev/dsp) 10:08:46.271 conference.c Port 3 (sip:8003 at 10.10.10.105<sip%3A8003 at 10.10.10.105>) transmitting to port 0 (/dev/dsp) 10:08:46.271 conference.c Port 0 (/dev/dsp) transmitting to port 3 ( sip:8003 at 10.10.10.105 <sip%3A8003 at 10.10.10.105>) 10:08:46.271 pjsua_app.c Media for call 1 is active 10:08:46.271 pjsua_core.c TX 832 bytes Response msg 200/INVITE/cseq=102 (tdta0x82a74b8) to UDP 10.10.10.105:5060: SIP/2.0 200 OK Via: SIP/2.0/UDP 10.10.10.105:5060;rport=5060;received=10.10.10.105 ;branch=z9hG4bK5895efd9 Call-ID: 01ad097266fc84bc1a9292105dec94fe at 10.10.10.105 From: "8003" <sip:8003@10.10.10.105 <sip%3A8003 at 10.10.10.105> >;tag=as383603b2 To: <sip:8002 at 10.10.10.130 <sip%3A8002 at 10.10.10.130> >;tag=ShyBNhPhq9Tp4.JaWoQ-OTmQLzIgqety CSeq: 102 INVITE Contact: <sip:10.10.10.130:5060> Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE, OPTIONS Supported: replaces, 100rel, norefersub Content-Type: application/sdp Content-Length: 299 v=0 o=- 3427150120 3427150121 IN IP4 10.10.10.130 s=pjmedia c=IN IP4 10.10.10.130 t=0 0 a=X-nat:0 m=audio 4002 RTP/AVP 3 101 a=rtcp:4003 IN IP4 10.10.10.130 a=rtpmap:3 GSM/8000 a=sendrecv a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 m=video 0 RTP/AVP 96 a=rtpmap:96 MP4V-ES/90000 --end msg-- 10:08:46.272 pjsua_app.c Call 1 state changed to CONNECTING >>> 10:08:46.278 pjsua_core.c RX 385 bytes Request msg ACK/cseq=102 (rdata0x825dce4) from UDP 10.10.10.105:5060: ACK sip:10.10.10.130:5060 SIP/2.0 Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK1c5d7c87;rport From: "8003" <sip:8003@10.10.10.105 <sip%3A8003 at 10.10.10.105> >;tag=as383603b2 To: <sip:8002 at 10.10.10.130:5060>;tag=ShyBNhPhq9Tp4.JaWoQ-OTmQLzIgqety Contact: <sip:8003 at 10.10.10.105 <sip%3A8003 at 10.10.10.105>> Call-ID: 01ad097266fc84bc1a9292105dec94fe at 10.10.10.105 CSeq: 102 ACK User-Agent: PBX Max-Forwards: 70 Content-Length: 0 --end msg-- 10:08:46.278 pjsua_app.c Call 1 state changed to CONFIRMED 10:08:46.916 strm0x82a8d74 VAD re-enabled Thanks a lot !! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080809/4afb7911/attachment-0001.html