[Asterisk-cvs] asterisk/channels chan_iax2.c,1.136,1.137
markster at lists.digium.com
markster at lists.digium.com
Sun May 2 02:28:56 CDT 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv1368/channels
Modified Files:
chan_iax2.c
Log Message:
Merge Matteo's language setting code for iax2 (bug #1476)
Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- chan_iax2.c 2 May 2004 05:38:20 -0000 1.136
+++ chan_iax2.c 2 May 2004 06:36:31 -0000 1.137
@@ -108,6 +108,8 @@
static char context[80] = "default";
+static char language[MAX_LANGUAGE] = "";
+
static int max_retries = 4;
static int ping_time = 20;
static int lagrq_time = 10;
@@ -189,6 +191,7 @@
int authmethods;
char accountcode[20];
char inkeys[80]; /* Key(s) this user can use to authenticate to us */
+ char language[MAX_LANGUAGE];
int amaflags;
int hascallerid;
int delme;
@@ -409,7 +412,7 @@
/* Private key for outgoing authentication */
char outkey[80];
/* Preferred language */
- char language[80];
+ char language[MAX_LANGUAGE];
/* Hostname/peername for naming purposes */
char host[80];
/* Associated registry */
@@ -3445,6 +3448,8 @@
strncpy(iaxs[callno]->accountcode, user->accountcode, sizeof(iaxs[callno]->accountcode)-1);
if (user->amaflags)
iaxs[callno]->amaflags = user->amaflags;
+ if (strlen(user->language))
+ strncpy(iaxs[callno]->language, user->language, sizeof(iaxs[callno]->language)-1);
iaxs[callno]->notransfer = user->notransfer;
res = 0;
}
@@ -6017,6 +6022,7 @@
memset(user, 0, sizeof(struct iax2_user));
user->capability = iax2_capability;
strncpy(user->name, name, sizeof(user->name)-1);
+ strcpy(user->language, language);
while(v) {
if (!strcasecmp(v->name, "context")) {
con = build_context(v->value);
@@ -6059,6 +6065,8 @@
user->hascallerid=1;
} else if (!strcasecmp(v->name, "accountcode")) {
strncpy(user->accountcode, v->value, sizeof(user->accountcode)-1);
+ } else if (!strcasecmp(v->name, "language")) {
+ strncpy(user->language, v->value, sizeof(user->language)-1);
} else if (!strcasecmp(v->name, "amaflags")) {
format = ast_cdr_amaflags2int(v->value);
if (format < 0) {
@@ -6318,6 +6326,8 @@
} else if (!strcasecmp(v->name, "dbname")) {
strncpy(mydbname, v->value, sizeof(mydbname) - 1);
#endif
+ } else if (!strcasecmp(v->name, "language")) {
+ strncpy(language, v->value, sizeof(language) - 1);
} //else if (strcasecmp(v->name,"type"))
// ast_log(LOG_WARNING, "Ignoring %s\n", v->name);
v = v->next;
@@ -6380,6 +6390,7 @@
struct sockaddr_in dead_sin;
struct iax2_peer *peer;
strncpy(accountcode, "", sizeof(accountcode)-1);
+ strncpy(language, "", sizeof(language)-1);
amaflags = 0;
notransfer = 0;
srand(time(NULL));
More information about the svn-commits
mailing list