[Home]

Summary:ASTERISK-02169: inet_addr is not good to find out gw name is dotted ip or not ...
Reporter:litw (litw)Labels:
Date Opened:2004-08-01 07:14:02Date Closed:2008-01-15 15:04:18.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:                                                                                                                        
/* SC: modified for reload support */                                                                                    
static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)                                              
{                                                                                                                        
....
          /* SC: check if the name is numeric ip */                                                                    
           if (inet_addr(gw->name) != INADDR_NONE)                                                                      
               gw->isnamedottedip = 1;                                                                                  

if you will call your phone with only digits - inet_addr always return that it is valid ip address ... better use inet_pton


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

for example
mgcp.conf:

[100]
host = 192.168.161.242
context = tech
musiconhold=default
pickupgroup=0
callgroup=0
callwaiting=0
cancallforward=1
transfer=1
mailbox=100
callerid="Helpdesk" <100>
threewaycalling=1
canreinvite=0
slowsequence=yes
line => aaln/1

chan_mgcp always send aaln/1@[100] not aaln/1@100 as needed ...
Comments:By: Mark Spencer (markster) 2004-08-01 14:40:40

Fixed in CVS

By: Digium Subversion (svnbot) 2008-01-15 15:04:18.000-0600

Repository: asterisk
Revision: 3562

U   trunk/channels/chan_mgcp.c

------------------------------------------------------------------------
r3562 | markster | 2008-01-15 15:04:18 -0600 (Tue, 15 Jan 2008) | 2 lines

Make sure it's really a dotted IP (bug ASTERISK-2169)

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

http://svn.digium.com/view/asterisk?view=rev&revision=3562