Small IAX fixes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
Mark Spencer 22 years ago
parent 426bf55df2
commit d3bcf405c2

@ -5479,9 +5479,10 @@ static struct ast_channel *iax2_request(char *type, int format, void *data)
int fmt, native; int fmt, native;
struct sockaddr_in sin; struct sockaddr_in sin;
char s[256]; char s[256];
char *st; char *st, *hostname;
struct ast_channel *c; struct ast_channel *c;
char *stringp=NULL; char *stringp=NULL;
char *portno=NULL;
int capability = iax2_capability; int capability = iax2_capability;
int trunk; int trunk;
int notransfer = 0; int notransfer = 0;
@ -5493,12 +5494,25 @@ static struct ast_channel *iax2_request(char *type, int format, void *data)
stringp=s; stringp=s;
strsep(&stringp, "@"); strsep(&stringp, "@");
st = strsep(&stringp, "@"); st = strsep(&stringp, "@");
if (!st) if (!st)
{
st = s; st = s;
}
hostname = strsep(&st, ":");
if (st) {
portno = strsep(&st, ":");
}
/* Populate our address from the given */ /* 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; return NULL;
} }
if (portno) {
sin.sin_port = htons(atoi(portno));
}
callno = find_callno(0, 0, &sin, NEW_FORCE, 1); callno = find_callno(0, 0, &sin, NEW_FORCE, 1);
if (callno < 1) { if (callno < 1) {
ast_log(LOG_WARNING, "Unable to create call\n"); ast_log(LOG_WARNING, "Unable to create call\n");

@ -7,7 +7,7 @@
; local addresses). ; local addresses).
; ;
[general] [general]
port=5036 ;port=5036
;bindaddr=192.168.0.1 ;bindaddr=192.168.0.1
; ;
; Set iaxcompat to yes if you plan to use layered ; Set iaxcompat to yes if you plan to use layered

Loading…
Cancel
Save