ALTER TABLE kamailio.acc CHANGE COLUMN src_leg src_leg varchar(2048) DEFAULT NULL;
ALTER TABLE kamailio.acc CHANGE COLUMN dst_leg dst_leg varchar(2048) DEFAULT NULL;
ALTER TABLE accounting.acc CHANGE COLUMN src_leg src_leg varchar(2048) DEFAULT NULL;
ALTER TABLE accounting.acc CHANGE COLUMN dst_leg dst_leg varchar(2048) DEFAULT NULL;

ALTER TABLE accounting.cdr ADD COLUMN source_external_subscriber_id varchar(255) DEFAULT NULL AFTER source_provider_id;
ALTER TABLE accounting.cdr ADD COLUMN source_external_contract_id varchar(255) DEFAULT NULL AFTER source_external_subscriber_id;
ALTER TABLE accounting.cdr ADD COLUMN source_account_id int(11) unsigned NOT NULL DEFAULT '0' AFTER source_external_contract_id;

ALTER TABLE accounting.cdr ADD COLUMN destination_external_subscriber_id varchar(255) DEFAULT NULL AFTER destination_provider_id;
ALTER TABLE accounting.cdr ADD COLUMN destination_external_contract_id varchar(255) DEFAULT NULL AFTER destination_external_subscriber_id;
ALTER TABLE accounting.cdr ADD COLUMN destination_account_id int(11) unsigned NOT NULL DEFAULT '0' AFTER destination_external_contract_id;

ALTER TABLE accounting.cdr ADD COLUMN peer_auth_user varchar(255) DEFAULT NULL AFTER destination_domain_in;
ALTER TABLE accounting.cdr ADD COLUMN peer_auth_realm varchar(255) DEFAULT NULL AFTER peer_auth_user;
