[Asterisk-cvs] asterisk/channels chan_iax2.c,1.117,1.118
markster at lists.digium.com
markster at lists.digium.com
Tue Apr 6 11:55:18 CDT 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv27160/channels
Modified Files:
chan_iax2.c
Log Message:
Small IAX fixes
Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- chan_iax2.c 27 Mar 2004 06:50:12 -0000 1.117
+++ chan_iax2.c 6 Apr 2004 15:55:40 -0000 1.118
@@ -5479,9 +5479,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;
@@ -5493,11 +5494,24 @@
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) {
More information about the svn-commits
mailing list