Index: chan_iax2.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v retrieving revision 1.54 diff -u -u -r1.54 chan_iax2.c --- chan_iax2.c 30 Aug 2003 06:40:56 -0000 1.54 +++ chan_iax2.c 26 Jan 2004 22:20:16 -0000 @@ -4648,9 +4691,10 @@ int fmt, native; struct sockaddr_in sin; char s[256]; - char *st; + char *st, *hostname; struct ast_channel *c; char *stringp=NULL; + char *portno=NULL; int capability = iax2_capability; int trunk; int notransfer = 0; @@ -4662,12 +4706,25 @@ stringp=s; strsep(&stringp, "@"); st = strsep(&stringp, "@"); + if (!st) + { st = s; + } + + hostname = strsep(&st, ":"); + + if (st) { + portno = strsep(&st, ":"); + } + /* Populate our address from the given */ - if (create_addr(&sin, &capability, &sendani, &maxtime, st, NULL, &trunk, ¬ransfer, NULL, 0)) { + if (create_addr(&sin, &capability, &sendani, &maxtime, hostname, NULL, &trunk, ¬ransfer, NULL, 0)) { return NULL; } + if (portno) { + sin.sin_port = htons(atoi(portno)); + } callno = find_callno(0, 0, &sin, NEW_FORCE, 1); if (callno < 1) { ast_log(LOG_WARNING, "Unable to create call\n");