aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-06 15:55:40 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-06 15:55:40 +0000
commit1bc657efc4e2ec87ba6303156575050916e5f798 (patch)
treeb23b946b32d248fd2553609dd5717ae7592daf71
parente20d42804f910c76f70bf0d5e09bd359a66cee56 (diff)
Small IAX fixes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2638 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_iax2.c18
-rwxr-xr-xconfigs/iax.conf.sample2
2 files changed, 17 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index daf52eaf6..7f9c2cad7 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -5479,9 +5479,10 @@ static struct ast_channel *iax2_request(char *type, int format, void *data)
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,12 +5494,25 @@ static struct ast_channel *iax2_request(char *type, int format, void *data)
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, &notransfer, NULL, 0)) {
+ if (create_addr(&sin, &capability, &sendani, &maxtime, hostname, NULL, &trunk, &notransfer, 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");
diff --git a/configs/iax.conf.sample b/configs/iax.conf.sample
index 6c5015ae1..bf578468a 100755
--- a/configs/iax.conf.sample
+++ b/configs/iax.conf.sample
@@ -7,7 +7,7 @@
; local addresses).
;
[general]
-port=5036
+;port=5036
;bindaddr=192.168.0.1
;
; Set iaxcompat to yes if you plan to use layered