[asterisk-bugs] [Asterisk 0018670]: chan_h323.c:977 __oh323_rtp_create: Unable to create RTP session: Address family not supported by protocol

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Jan 25 05:24:13 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18670 
====================================================================== 
Reported By:                dread
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18670
Category:                   Channels/chan_h323
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.8.2.2 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-01-24 14:56 CST
Last Modified:              2011-01-25 05:24 CST
====================================================================== 
Summary:                    chan_h323.c:977 __oh323_rtp_create: Unable to create
RTP session: Address family not supported by protocol
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
====================================================================== 

---------------------------------------------------------------------- 
 (0130990) mthawk (reporter) - 2011-01-25 05:24
 https://issues.asterisk.org/view.php?id=18670#c130990 
---------------------------------------------------------------------- 
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 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 in will be useful and bugless :^) 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-25 05:24 mthawk         Note Added: 0130990                          
======================================================================




More information about the asterisk-bugs mailing list