[Home]

Summary:ASTERISK-17278: [patch] chan_h323.c:977 __oh323_rtp_create: Unable to create RTP session: Address family not supported by protocol
Reporter:dread (dread)Labels:
Date Opened:2011-01-24 14:56:25.000-0600Date Closed:2011-09-19 08:34:40
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_h323
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) h323-1.8_rtp_only.patch
( 1) h323-1.8_rtp.patch
( 2) res_rtp_asterisk_correct.patch
( 3) res_rtp_asterisk.c.patch
Description:

[Jan 20 19:10:46] WARNING[9920]: res_rtp_asterisk.c:422 create_new_socket: Unable to allocate RTP socket: Address family not supported by protocol
[Jan 20 19:10:46] WARNING[9920]: chan_h323.c:977 __oh323_rtp_create: Unable to create RTP session: Address family not supported by protocol

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

in 1.4

h323 show version
[Jan 24 23:46:27] H.323 version: 1.18.0
asterisk-2*CLI>

h323.conf

[general]
port=1720
bindaddr = 192.168.3.9
disallow=all
allow=g729
dtmfmode=rfc2833
gatekeeper = DISABLE
context=incoming
AcceptAnonymous = yes
progress_setup = 3
progress_alert = 8
tunneling=cisco
h245Tunneling = yes
jbenable = yes
jbimpl = adaptive

[h323_t1]
type=friend
host=192.168.254.67
port=1720
disallow=all
allow=g729
dtmfmode=rfc2833
faststart=no



[Jan 24 20:44:22]     -- Executing [xxxxxxxxxxx@h323_out:33] Set("Local/xxxxxxxxxxx@h323_out-e66f;2", "CALLERID(num)=xxxxxxxxxxx") in new stack
[Jan 24 20:44:22]     -- Executing [xxxxxxxxxxx@auto_dial:34] Dial("Local/xxxxxxxxxxx@h323_out-e66f;2", "H323/h323_t1/xxxxxxxxxxx,15,g") in new stack
[Jan 24 20:44:22] WARNING[11612]: res_rtp_asterisk.c:422 create_new_socket: Unable to allocate RTP socket: Address family not supported by protocol
[Jan 24 20:44:22] WARNING[11612]: chan_h323.c:977 __oh323_rtp_create: Unable to create RTP session: Address family not supported by protocol


in version 1.4, all fine
The error occurs when you try to set the outgoing and incoming call
Open H.323 version v1.18.0, PWLib v1.10.0
gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)
Comments:By: Max Litvinov (mthawk) 2011-01-25 03:40:47.000-0600

Have the same trouble.

*CLI> h323 show version
*CLI> H.323 version: 1.18.0
*CLI> core show version
Asterisk 1.8.1.1 built by root @ asterisk on a i686 running Linux on 2011-01-20 16:06:32 UTC

---- h.323.conf ---
[general]
port = 1720
bindaddr = X.Y.Z.W
disallow=all
allow=g729
dtmfmode=rfc2833:101
gatekeeper = DISABLE
FastStart=yes
H245Tunneling=yes
AllowGKRouted = no
AcceptAnonymous = yes
UserByAlias=no
context=default
progress_setup = 3
progress_alert = 8
hold=h450

Here what I have in CLI during incoming call (h323 trace on, h323 debug on):

*CLI>   == New H.323 Connection created.                                                                                                                      
       --Received SETUP message                                                                                                                              
   -- Setting up Call                                                                                                                                        
   --          Call token:  [ip$A.B.C.D:20644/720]                                                                                                    
   --          Calling party name:  [addpac_22]                                                                                                              
   --          Calling party number:  [XXXXXX]                                                                                                              
   --          Called party name:  [456]                                                                                                                    
   --          Called party number:  [456]                                                                                                                  
   --          Calling party IP:  [A.B.C.D]                                                                                                          
Setting capabilities to 0x100 (g729)                                                                                                                          
Capabilities in preference order is (g729)                                                                                                                    
DTMF mode is 1                                                                                                                                                
Allowed Codecs for ip$A.B.C.D:20644/720 (ip$A.B.C.D:1720):                                                                                      
        Table:                                                                                                                                              
  G.729A <1>                                                                                                                                                
  G.729 <2>                                                                                                                                                  
  UserInput/hookflash <3>                                                                                                                                    
  UserInput/dtmf <4>                                                                                                                                        
Set:                                                                                                                                                        
  0:                                                                                                                                                        
    0:                                                                                                                                                      
      G.729A <1>                                                                                                                                            
      G.729 <2>                                                                                                                                              
    1:                                                                                                                                                      
      UserInput/hookflash <3>                                                                                                                                
    2:                                                                                                                                                      
      UserInput/dtmf <4>                                                                                                                                    

[Jan 25 10:58:09] WARNING[2158]: res_rtp_asterisk.c:422 create_new_socket: Unable to allocate RTP socket: Address family not supported by protocol
[Jan 25 10:58:09] WARNING[2158]: chan_h323.c:977 __oh323_rtp_create: Unable to create RTP session: Address family not supported by protocol      
[Jan 25 10:58:09] ERROR[2158]: chan_h323.c:1943 external_rtp_create: No RTP stream is available for call ip$A.B.C.D:20644/720 (720)      ERROR: on_external_rtp_create failure                                                                                                                                      
[Jan 25 10:58:09] WARNING[2158]: res_rtp_asterisk.c:422 create_new_socket: Unable to allocate RTP socket: Address family not supported by protocol            
[Jan 25 10:58:09] WARNING[2158]: chan_h323.c:977 __oh323_rtp_create: Unable to create RTP session: Address family not supported by protocol                  
[Jan 25 10:58:09] ERROR[2158]: chan_h323.c:1943 external_rtp_create: No RTP stream is available for call ip$A.B.C.D:20644/720 (720)      ERROR: on_external_rtp_create failure                                                                                                                                      
       =-= In OnAnswerCall for call 720                                                                                                                      
               - Progress Indicator: 0                                                                                                                      
               - Inserting PI of 8 into ALERTING message                                                                                                    
[Jan 25 10:58:09] WARNING[2158]: res_rtp_asterisk.c:422 create_new_socket: Unable to allocate RTP socket: Address family not supported by protocol            
[Jan 25 10:58:09] WARNING[2158]: chan_h323.c:977 __oh323_rtp_create: Unable to create RTP session: Address family not supported by protocol                  
       -- Started logical channel: sending G.729                                                                                                            
               -- channelsOpen = 1                                                                                                                          
               External RTP Session Starting                                                                                                                
               RTP channel id 1 parameters:                                                                                                                  
   -- Executing [456@default:1] Answer("H323/ip$A.B.C.D:20644/720", "") in new stack                                                                  
Segmentation fault.

Here Asterisk crashes.

By: Max Litvinov (mthawk) 2011-01-25 05:24:13.000-0600

I discovered that in file res_rtp_asterisk.c:414 in function int create_new_socket(const char *type, int af)
variable af comes with value -1
So i made a few fixes (disabled the ipv4 / ipv6 check and set static ipv4 use) in res_rtp_asterisk.c and there is no more crashes.

Here the patch file with changes I made:

---- res_rtp_asterisk_diff.patch ---
422c422
<               ast_log(LOG_WARNING, "Unable to allocate %s socket: %s\n", type, strerror(errno));
---
>               ast_log(LOG_WARNING, "Unable to allocate %s socket with %d domain: %s\n", type, af, strerror(errno));
455,457c455
<            create_new_socket("RTP",
<                              ast_sockaddr_is_ipv4(addr) ? AF_INET  :
<                              ast_sockaddr_is_ipv6(addr) ? AF_INET6 : -1)) < 0) {
---
>            create_new_socket("RTP",AF_INET)) < 0) {
2350,2354c2348
<                    create_new_socket("RTCP",
<                                      ast_sockaddr_is_ipv4(&rtp->rtcp->us) ?
<                                      AF_INET :
<                                      ast_sockaddr_is_ipv6(&rtp->rtcp->us) ?
<                                      AF_INET6 : -1)) < 0) {
---
>                    create_new_socket("RTCP", AF_INET)) < 0) {

-----------------------

Hope it will be useful and bugless :)



By: David Woolley (davidw) 2011-01-25 05:43:30.000-0600

To submit a patch:

1) it needs to be in unified diff format;
2) you need to have granted an electronic licence to Digium (there will be a link at the top of the page if you haven't), and, after doing that, attached the patch, with the code or documentation box ticked.

By: Walter Doekes (wdoekes) 2011-01-25 05:44:17.000-0600

Patches should be attached using the file upload (legal reasons). They should also be in "unified diff" format (diff -u).

By: Max Litvinov (mthawk) 2011-01-25 08:33:42.000-0600

I'm sorry. The first file was with absolute path in filenames.
I can't delete it. Please leave the *correct* file only.

This patch removes the symptoms of trouble, but not the actual reason of it.

And it not suitable for servers working with IPv6!

By: Gregory Hinton Nietsky (irroot) 2011-03-02 00:06:31.000-0600

New patch uploaded simpler more correct ....

By: Gregory Hinton Nietsky (irroot) 2011-03-02 00:08:43.000-0600

OOPS my gatewayid patch has slipped in as well the second hunk is all thats required the gatewayid patch allows setting the systems main id for working with gateways ....

By: Gregory Hinton Nietsky (irroot) 2011-03-03 06:51:34.000-0600

Related to dup ASTERISK-17500