From 3cf4974cfeb96f8faf7040d7f90064b2655795dc Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Fri, 25 Apr 2003 03:56:46 +0000
Subject: [PATCH] AMAflags and account code honored in SIP

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_sip.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 8f88315d70..8458f3a816 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -202,7 +202,7 @@ static struct sip_pvt {
 	char peersecret[81];
 	char callerid[256];					/* Caller*ID */
 	char via[256];
-	char accountcode[256];				/* Account code */
+	char accountcode[20];				/* Account code */
 	char our_contact[256];				/* Our contact header */
 	char realm[256];				/* Authorization realm */
 	char nonce[256];				/* Authorization nonce */
@@ -247,7 +247,7 @@ struct sip_user {
 	char context[80];
 	char callerid[80];
 	char methods[80];
-	char accountcode[80];
+	char accountcode[20];
 	unsigned int callgroup;
 	unsigned int pickupgroup;
 	int nat;
@@ -1162,6 +1162,10 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
 		tmp->pvt->bridge = ast_rtp_bridge;
 		tmp->callgroup = i->callgroup;
 		tmp->pickupgroup = i->pickupgroup;
+                if (strlen(i->accountcode))
+                        strncpy(tmp->accountcode, i->accountcode, sizeof(tmp->accountcode)-1);
+                if (i->amaflags)
+                        tmp->amaflags = i->amaflags;
 		if (strlen(i->language))
 			strncpy(tmp->language, i->language, sizeof(tmp->language)-1);
 		i->owner = tmp;
-- 
GitLab