[Home]

Summary:ASTERISK-12421: [patch] segmentation fault with chan_h323 ast_rtp_new_source (rtp=0x0)
Reporter:nik600 (nik600)Labels:
Date Opened:2008-07-21 09:56:06Date Closed:2008-09-09 05:27:25
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Channels/chan_h323
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) patch.diff
Description:i've installed asterisk 1.4.21.1
and configured with Open H.323 version v1.18.0, PWLib v1.10.0.

I've installed them but i'm experiencing this problem:

i've configured in h323.conf 2 peers:
one to an 3.3 CCM Cisco
one to an 4.2 CCM Cisco

each CCM has the preferred codec set up as G711 ulaw.

I can forward calls from a SIP account on asterisk (using Xten-xlite
as softphone) to both the peers and talk with their extensions without
any problem.

I can forward calls from both the peers to Asterisk (and for example
place the call in queue or background some sound files)

BUT

when i try to call from the CCM 3.3 to Asterisk, and then dial from
the dialplan a SIP account, when the SIP user accept the call (using
Xten-xlite as softphone) asterisk dies with a segmentation fault
error.

This happend only with CCM 3.3, with 4.2 there is no problem.

I've temporarly patched it editing chan_h323.c in the function oh323_indicate at line 919 replacing
// ********* OLD CODE
case AST_CONTROL_SRCUPDATE:
ast_rtp_new_source(pvt->rtp);
res = 0;
break;

// ***********
with
// ********* NEW CODE
case AST_CONTROL_SRCUPDATE:
if(pvt->rtp!=NULL){
ast_rtp_new_source(pvt->rtp);
}
res = 0;
break;

// ***********

with these "patch" asterisk doesn't crash.

****** ADDITIONAL INFORMATION ******

I've got a backtrace of the error, it seems a codec problem, as the
parameter passed to ast_rtp_new_source is null.

#0 ast_rtp_new_source (rtp=0x0) at rtp.c:2002 2002 rtp->set_marker_bit
= 1; (gdb) bt
#0 ast_rtp_new_source (rtp=0x0) at rtp.c:2002
#1 0xb6cfc346 in oh323_indicate (c=0x8205ea0, condition=20, data=0x0,
datalen=0) at chan_h323.c:919
#2 0x08081ece in ast_indicate_data (chan=0x8205ea0, condition=20,
data=0x0, datalen=0) at channel.c:2372
#3 0x0808698c in ast_channel_bridge (c0=0x8205ea0, c1=0x820acf8,
config=0xb60e0de8, fo=0xb60dff38, rc=0xb60dff34) at channel.c:2358
#4 0xb6fad295 in ast_bridge_call (chan=0x8205ea0, peer=0x820acf8,
config=0xb60e0de8) at res_features.c:1422
ASTERISK-1 0xb6ae0893 in dial_exec_full (chan=0x8205ea0, data=0xb6ae26fb,
peerflags=0xb60e0ea4, continue_exec=0x0) at app_dial.c:1699
ASTERISK-2 0xb6ae1cd2 in dial_exec (chan=0x8205ea0, data=0xb60e2f18) at app_dial.c:1753
ASTERISK-3 0x080c6f36 in pbx_extension_helper (c=0x8205ea0, con=0x0,
context=0x8206020 "from-h323", exten=0x8206070 "54", priority=1,
label=0x0, callerid=0x8205830 "419", action=E_SPAWN) at pbx.c:537
ASTERISK-4 0x080c8fb5 in __ast_pbx_run (c=0x8205ea0) at pbx.c:2317
ASTERISK-5 0x080c9e7e in pbx_thread (data=0x8205ea0) at pbx.c:2636
ASTERISK-6 0x080f8fab in dummy_start (data=0x8205ce8) at utils.c:895
ASTERISK-7 0xb7f56383 in start_thread () from /lib/libpthread.so.0
ASTERISK-8 0xb731905e in clone () from /lib/libc.so.6
Comments:By: nik600 (nik600) 2008-07-21 10:04:15

Output of h323 set trace:

Here there is the output of h323 debug

tstask01*CLI>
1:54.003LI>     H323 Listener:81af928   transports.cxx(1559)  H323TCP
Started connection:  host=192.168.55.10:56896, if=192.168.55.18:1720,
handle=35
1:54.003LI>       H225 Answer:81f6d00   transports.cxx(595)   H225
Started incoming call thread
1:54.003          H225 Answer:81f6d00   transports.cxx(1161)  H225
Awaiting first PDU
1:54.004        H323 Listener:81af928   transports.cxx(1356)  TCP
Waiting on socket accept on ip$192.168.55.18:1720
1:54.005LI>       H225 Answer:81f6d00      h323pdu.cxx(553)   H225
Receiving PDU [ip$192.168.55.18:1720/ip$192.168.55.10:56896] :
{
 q931pdu = {
   protocolDiscriminator = 8
   callReference = 14
   from = originator
   messageType = Setup
   IE: Bearer-Capability = {
     80 90 a2                                           ...
   }
   IE: Display = {
     4d 61 73 73 69 6d 6f 20  50 6f 6e 74 61 72 61      Caller name
   }
   IE: Calling-Party-Number = {
     00 81 36 35 34                                     ..654
   }
   IE: Called-Party-Number = {
     80 35 34                                           .54
   }
   IE: User-User = {
     20 b0 06 00 08 91 4a 00  02 01 40 0e 00 4d 00 61    .....J...@..M.a
     00 73 00 73 00 69 00 6d  00 6f 00 20 00 50 00 6f   .s.s.i.m.o. .P.o
     ...
   }
 }
 h225pdu = {
   h323_uu_pdu = {
     h323_message_body = setup {
       protocolIdentifier = 0.0.8.2250.0.2
       sourceAddress = 1 entries {
         [0]=h323_ID  15 characters {
           004d 0061 0073 0073 0069 006d 006f 0020   Caller
           0050 006f 006e 0074 0061 0072 0061        Name
         }
       }
       sourceInfo = {
         terminal = {
         }
         mc = FALSE
         undefinedNode = FALSE
       }
       destinationAddress = 1 entries {
         [0]=dialedDigits "54"
       }
       activeMC = FALSE
       conferenceID =  16 octets {
         80 fc c8 bd e0 72 e1 1d  0e 00 00 00 c0 a8 01 a2   .....r..........
       }
       conferenceGoal = create <<null>>
       callType = pointToPoint <<null>>
       sourceCallSignalAddress = ipAddress {
         ip =  4 octets {
           c0 a8 37 0a                                        ..7.
         }
         port = 1720
       }
       callIdentifier = {
         guid =  16 octets {
           80 fc c8 bd e0 72 e1 1d  0e 00 00 00 c0 a8 01 a2   .....r..........
         }
       }
       mediaWaitForConnect = FALSE
       canOverlapSend = FALSE
     }
     h245Tunneling = FALSE
     nonStandardControl = 1 entries {
       [0]={
         nonStandardIdentifier = h221NonStandard {
           t35CountryCode = 181
           t35Extension = 0
           manufacturerCode = 18
         }
         data =  7 octets {
           80 44 04 00 01 01 00                               .D.....
         }
       }
     }
   }
 }
}
1:54.008          H225 Answer:81f6d00   transports.cxx(1170)  H225
Incoming call, first PDU: callReference=14
1:54.008          H225 Answer:81f6d00      rfc2833.cxx(81)    RFC2833
Handler created
     == New H.323 Connection created.
1:54.008          H225 Answer:81f6d00       h323ep.cxx(2456)  H323
Created new connection: ip$192.168.55.10:56896/14
Received non-standard Cisco extension data  7 octets {
80 44 04 00 01 01 00                               .D.....
}
H323_UU_NonStdInfo = {
callMgrParam = {
 interclusterVersion = 1
 enterpriseID =  0 octets {

 }
}
}
1:54.009          H225 Answer:81f6d00         h323.cxx(1876)  H225
Handling PDU: Setup callRef=14
1:54.009          H225 Answer:81f6d00         h323.cxx(1918)  H225
Set remote application name: "Cisco IOS 12.x    181/18"
     --Received SETUP message
[Jul 18 17:27:52] DEBUG[6986]: chan_h323.c:2056 setup_incoming_call:
Setting up incoming call for ip$192.168.55.10:56896/14
 -- Setting up Call
 --          Call token:  [ip$192.168.55.10:56896/14]
 --          Calling party name:  [Caller Name]
 --          Calling party number:  [654]
 --          Called party name:  [54]
 --          Called party number:  [54]
 --          Calling party IP:  [192.168.55.10]
[Jul 18 17:27:52] DEBUG[6986]: chan_h323.c:1560 find_user: Could not
find user by name Caller or address 192.168.55.10
[Jul 18 17:27:52] DEBUG[6986]: chan_h323.c:2121 setup_incoming_call:
Sending Caller@192.168.55.10 to context [from-h323] extension 54
1:54.010          H225 Answer:81f6d00      h323neg.cxx(340)   H245
Stopping MasterSlaveDetermination: state=Idle
1:54.010          H225 Answer:81f6d00      h323neg.cxx(572)   H245
Stopping TerminalCapabilitySet: state=Idle
1:54.010          H225 Answer:81f6d00     ast_h323.cxx(1215)  H225
Fast Start DISABLED!
1:54.010          H225 Answer:81f6d00         h323.cxx(2142)  H225
Set protocol version to 2 and implying H.245 version 3
[Jul 18 17:27:52] DEBUG[6986]: chan_h323.c:2421
set_local_capabilities: Setting capabilities for connection
ip$192.168.55.10:56896/14
Setting capabilities to 0xc (ulaw|alaw)
Capabilities in preference order is (alaw|ulaw)
1:54.010          H225 Answer:81f6d00     h323caps.cxx(2143)  H323
Added capability: G.711-ALaw-64k <1>
1:54.010          H225 Answer:81f6d00     h323caps.cxx(2143)  H323
Added capability: G.711-uLaw-64k <2>
1:54.010          H225 Answer:81f6d00     h323caps.cxx(2143)  H323
Added capability: UserInput/hookflash <3>
1:54.010          H225 Answer:81f6d00     h323caps.cxx(2143)  H323
Added capability: UserInput/RFC2833 <4>
1:54.011          H225 Answer:81f6d00     h323caps.cxx(2143)  H323
Added capability: UserInput/dtmf <5>
Allowed Codecs:
      Table:
G.711-ALaw-64k <1>
G.711-uLaw-64k <2>
UserInput/hookflash <3>
UserInput/RFC2833 <4>
UserInput/dtmf <5>
Set:
0:
  0:
    G.711-ALaw-64k <1>
    G.711-uLaw-64k <2>
  1:
    UserInput/hookflash <3>
  2:
    UserInput/RFC2833 <4>
    UserInput/dtmf <5>

[Jul 18 17:27:52] DEBUG[6986]: chan_h323.c:2434
set_local_capabilities: Capabilities for connection
ip$192.168.55.10:56896/14 is set
1:54.011          H225 Answer:81f6d00         h323.cxx(2249)  H225
Sending call proceeding PDU
1:54.012          H225 Answer:81f6d00      h323pdu.cxx(553)   H225
Sending PDU [ip$192.168.55.18:1720/ip$192.168.55.10:56896] :
{
 q931pdu = {
   protocolDiscriminator = 8
   callReference = 14
   from = destination
   messageType = CallProceeding
   IE: Display = {
     35 34 00                                           54.
   }
   IE: User-User = {
     21 80 06 00 08 91 4a 00  02 22 c0 09 00 00 3d 36   !.....J.."....=6
     54 68 65 20 4e 75 46 6f  6e 65 20 4e 65 74 77 6f   The NuFone Netwo
     ...
   }
 }
 h225pdu = {
   h323_uu_pdu = {
     h323_message_body = callProceeding {
       protocolIdentifier = 0.0.8.2250.0.2
       destinationInfo = {
         vendor = {
           vendor = {
             t35CountryCode = 9
             t35Extension = 0
             manufacturerCode = 61
           }
           productId =  55 octets {
             54 68 65 20 4e 75 46 6f  6e 65 20 4e 65 74 77 6f   The
NuFone Netwo
             72 6b 73 20 48 2e 33 32  33 20 43 68 61 6e 6e 65   rks
H.323 Channe
             ...
           }
           versionId =  26 octets {
             31 2e 30 2e 30 20 28 4f  70 65 6e 48 33 32 33 20
1.0.0 (OpenH323
             76 31 2e 31 38 2e 30 29  00 00                     v1.18.0)..
           }
         }
         terminal = {
         }
         mc = FALSE
         undefinedNode = FALSE
       }
       callIdentifier = {
         guid =  16 octets {
           80 fc c8 bd e0 72 e1 1d  0e 00 00 00 c0 a8 01 a2   .....r..........
         }
       }
     }
     h245Tunneling = FALSE
   }
 }
}
1:54.014          H225 Answer:81f6d00         h323.cxx(2288)  H225
Incoming call accepted
     =-= In OnAnswerCall for call 14
             - Progress Indicator: 0
             - Inserting PI of 0 into ALERTING message
[Jul 18 17:27:52] DEBUG[6986]: chan_h323.c:2177 answer_call: Preparing
Asterisk to answer for ip$192.168.55.10:56896/14
 -- Executing [54@from-h323:1]
Dial("H323/ip$192.168.55.10:56896/14", "SIP/maspo") in new stack
 -- Called maspo
1:54.017LI>       H225 Answer:81f6d00         h323.cxx(2792)  H323
Answering call: AnswerCallDeferredWithMedia
1:54.018LI>       H225 Answer:81f6d00   transports.cxx(1505)  H225
TCP Listen for H245 on 192.168.55.18:34810
1:54.018LI>              H245:82169a8   transports.cxx(620)   H245
Started thread
1:54.018LI>              H245:82169a8   transports.cxx(1712)  H245
TCP Accept wait
1:54.019LI>       H225 Answer:81f6d00      h323pdu.cxx(553)   H225
Sending PDU [ip$192.168.55.18:1720/ip$192.168.55.10:56896] :
{ask01*CLI>
 q931pdu = {
   protocolDiscriminator = 8
   callReference = 14
   from = destination
   messageType = Facility
   IE: Facility = {
tstask01*CLI>
   }1*CLI>
   IE: User-User = {
     26 80 06 00 08 91 4a 00  02 81 01 00 13 05 80 11   &.....J.........
     00 80 fc c8 bd e0 72 e1  1d 0e 00 00 00 c0 a8 01   ......r.........
     ...I>
   }1*CLI>
 }k01*CLI>
 h225pdu = {
   h323_uu_pdu = {
     h323_message_body = facility {
       protocolIdentifier = 0.0.8.2250.0.2
       reason = startH245 <<null>>
       callIdentifier = {
         guid =  16 octets {
           80 fc c8 bd e0 72 e1 1d  0e 00 00 00 c0 a8 01 a2   .....r..........
         }
       }I>
       h245Address = ipAddress {
         ip =  4 octets {
           c0 a8 37 12                                        ..7.
         }
         port = 34810
       }I>
       multipleCalls = FALSE
       maintainConnection = FALSE
     }CLI>
     h245Tunneling = FALSE
   }1*CLI>
 }k01*CLI>
}ask01*CLI>
1:54.030LI>       H225 Answer:81f6d00         h323.cxx(4374)  H323
InternalEstablishedConnectionCheck:
connectionState=AwaitingLocalAnswer fastStartState=FastStartDisabled
1:54.030LI>       H225 Answer:81f6d00         h323.cxx(4374)  H323
InternalEstablishedConnectionCheck:
connectionState=AwaitingLocalAnswer fastStartState=FastStartDisabled
1:54.031LI>       H225 Answer:81f6d00         h323.cxx(1816)  H225
Reading PDUs: callRef=14
 -- SIP/maspo-08208dd0 is ringing
[Jul 18 17:27:52] DEBUG[6987]: chan_h323.c:879 oh323_indicate: OH323:
Indicating 3 on ip$192.168.55.10:56896/14
     Sending alerting
1:54.123      ThreadID=0xb603eb90             h323.cxx(2792)  H323
Answering call: AnswerCallPending
1:54.123      ThreadID=0xb603eb90             h323.cxx(2881)  H225
Sending Alerting PDU
1:54.123      ThreadID=0xb603eb90          h323pdu.cxx(553)   H225
Sending PDU [ip$192.168.55.18:1720/ip$192.168.55.10:56896] :
{
 q931pdu = {
   protocolDiscriminator = 8
   callReference = 14
   from = destination
   messageType = Alerting
   IE: Display = {
     35 34 00                                           54.
   }
   IE: User-User = {
     23 80 06 00 08 91 4a 00  02 22 c0 09 00 00 3d 36   #.....J.."....=6
     54 68 65 20 4e 75 46 6f  6e 65 20 4e 65 74 77 6f   The NuFone Netwo
     ...
   }
 }
 h225pdu = {
   h323_uu_pdu = {
     h323_message_body = alerting {
       protocolIdentifier = 0.0.8.2250.0.2
       destinationInfo = {
         vendor = {
           vendor = {
             t35CountryCode = 9
             t35Extension = 0
             manufacturerCode = 61
           }
           productId =  55 octets {
             54 68 65 20 4e 75 46 6f  6e 65 20 4e 65 74 77 6f   The
NuFone Netwo
             72 6b 73 20 48 2e 33 32  33 20 43 68 61 6e 6e 65   rks
H.323 Channe
             ...
           }
           versionId =  26 octets {
             31 2e 30 2e 30 20 28 4f  70 65 6e 48 33 32 33 20
1.0.0 (OpenH323
             76 31 2e 31 38 2e 30 29  00 00                     v1.18.0)..
           }
         }
         terminal = {
         }
         mc = FALSE
         undefinedNode = FALSE
       }
       callIdentifier = {
         guid =  16 octets {
           80 fc c8 bd e0 72 e1 1d  0e 00 00 00 c0 a8 01 a2   .....r..........
         }
       }
     }
     h245Tunneling = FALSE
   }
 }
}
1:54.125      ThreadID=0xb603eb90             h323.cxx(4374)  H323
InternalEstablishedConnectionCheck:
connectionState=AwaitingLocalAnswer fastStartState=FastStartDisabled
[Jul 18 17:27:52] DEBUG[6987]: chan_h323.c:931 oh323_indicate: OH323:
Indicated 3 on ip$192.168.55.10:56896/14, res=-1

By: Sergey Tamkovich (sergee) 2008-07-22 04:49:58

that is proper patch, please upload it as a diff to ease life for bug marshals, thanks.

By: nik600 (nik600) 2008-07-22 06:40:11

i've uploaded it

By: Mark Michelson (mmichelson) 2008-09-09 05:27:21

It appears that when I fixed issue ASTERISK-12529, I didn't realize that I also had fixed this issue as well. As a result I'm closing this. Sorry I didn't notice until now that this issue had been fixed for so long.