[Asterisk-Dev] Patch: SIP accountcode, amaflags

Brancaleoni Matteo mbrancaleoni at espia.it
Thu Apr 24 17:40:30 MST 2003


Since amaflags and account code was
already in chan_sip , but not passed
to the cdr, this small patch fix that,
so we can have account code & amaflags
also in chan_sip.

Matteo Brancaleoni
Espia Sys Admin
http://www.espia.it

-------------- next part --------------
--- asterisk/channels/chan_sip.c	2003-04-25 01:35:17.000000000 +0200
+++ myasterisk/channels/chan_sip.c	2003-04-25 02:32:28.000000000 +0200
@@ -202,7 +202,7 @@
 	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 @@
 	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 @@
 		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;


More information about the asterisk-dev mailing list