Peeraccount and linkedid same as accountcode and uniqueid in cdr

Hi,

I am using asterisk 13.7. In dialplan i use Dial as following
Dial(“PJSIP/stanchart_market_1_1001-00000002”, “PJSIP/stanchart_market_1_1002,40,txkTXK”)

in pjsip endpoint
stanchart_market_1_1001 has account code stanchart_market_1_1001
and
stanchart_market_1_1002 has account code stanchart_market_1_1002

But in my cdr i am getting both accountcode and peeraccount as stanchart_market_1_1001
and uniqueid and linkedid as the same value e.g 1481446192.2.

If i dial from stanchart_market_1_1002 both accountcode and peeraccount changes to stanchart_market_1_1002

Can you please help? Why is it the same and how to make it correct?

Please help.

Let me know if any more information is needed.
Party A calling party B, both are pjsip endpoint with their own account code. But cdr contains the account code of the caller for both ‘accountcode’ and ‘peeraccount’ in the cdr.
While in the definition of peeraccount from the specification it says “The account code of the Party B channel”.

Going through the asterisk log i found the party B had the correct accountcode —
"{
“variable”: “__TRANSFER_CONTEXT”,
“value”: “stanchart”,
“type”: “ChannelVarset”,
“timestamp”: “2016-12-11T12:06:33.431+0000”,
“channel”: {
“id”: “1481457993.18”,
“name”: “PJSIP/stanchart_market_1_1002-00000012”,
“state”: “Down”,
“caller”: {
“name”: “Khalid Bin Walid”,
“number”: “1002”
},
“connected”: {
“name”: “”,
“number”: “”
},
“accountcode”: “stanchart_market_1_1002”,
“dialplan”: {
“context”: “stanchart”,
“exten”: “s”,
“priority”: 1
},
“creationtime”: “2016-12-11T12:06:33.431+0000”,
“language”: “en”
},
“application”: “c3app”
}"

but in the next event the accountcode just changed ----

“{
“type”: “ChannelDialplan”,
“timestamp”: “2016-12-11T12:06:33.431+0000”,
“dialplan_app”: “AppDial”,
“dialplan_app_data”: “(Outgoing Line)”,
“channel”: {
“id”: “1481457993.18”,
“name”: “PJSIP/stanchart_market_1_1002-00000012”,
“state”: “Down”,
“caller”: {
“name”: “Khalid Bin Walid”,
“number”: “1002”
},
“connected”: {
“name”: “Line Number 1”,
“number”: “1001”
},
“accountcode”: “stanchart_market_1_1001”,
“dialplan”: {
“context”: “stanchart”,
“exten”: “extension_call”,
“priority”: 1
},
“creationtime”: “2016-12-11T12:06:33.431+0000”,
“language”: “en”
},
“application”: “c3app”
}”

why did just change from its correct accountcode to the party A’s accountcode!!