Hello,
I am trying to send a request from smf container to amf using this code but I got 500 null reference point
panic recovered:
amf | runtime error: invalid memory address or nil pointer dereference
Please can anyone help if the json object I am using it is correct.
curl --location --request POST ‘http://amf.free5gc.org:8000/namf-comm/v1/ue-contexts/imsi-208930000000003/n1-n2-messages’
–header ‘Accept: application/json’
–header ‘Content-Type: multipart/related; boundary=“296682a27b6906a337ac09b418a49b569315cf55b3804db921a4cb700e39”’
–data-raw ‘{
“n2InfoContainer”: {
“n2InformationClass”: “SM”,
“smInfo”: {
“pduSessionId”: 1,
“n2InfoContent”: {
“ngapIeType”: “PDU_RES_REL_CMD”,
“ngapData”: {
“contentId”: “N2SmInfo”
}
}
}
},
“pduSessionId”: 1
}’
or this json file
{
“n1MessageContainer”: {
“n1MessageClass”: “SM”,
“n1MessageContent”: {
“contentId”: “N1Msg”
}
},
“n2InfoContainer”: {
“n2InformationClass”: “SM”,
“smInfo”: {
“pduSessionId”: 10,
“n2InfoContent”: {
“ngapIeType”: “PDU_RES_SETUP_REQ”,
“ngapData”: {
“contentId”: “N2SmInfo”
}
},
“sNssai”: {
“sst”: 1,
“sd”: “010203”
}
}
},
“pduSessionId”: 10
}
Hi @nathalie21005
Can you share the whole error message ?
Hello,
This is the error message I got and 500 response.
Hi @nathalie21005,
Did you tried to use content type “application/json” and not the mime “multipart/related” ? (which seems off to me, please see RFC1341(MIME) : 7 The Multipart content type)
Hi @abousselmi,
Yes I tried with content-type= application/json, but I got this error message.
{“title”:“Malformed request syntax”,“status”:400,“detail”:"[Request Body] N1 and N2 datas are both Empty in N1N2MessgeTransfer"}
and here is my request:
curl --location --request POST ‘http://amf.free5gc.org:8000/namf-comm/v1/ue-contexts/imsi-208930000000003/n1-n2-messages’
–header ‘Accept: application/json’
–header ‘Content-Type: application/json’
–data-raw ‘{
“n1MessageContainer”: {
“n1MessageClass”: “SM”,
“n1MessageContent”: {
“contentId”: “N1Msg”
},
“nfId”:“1”,
“serviceInstanceId”:“1”
},
“n2InfoContainer”: {
“n2InformationClass”: “SM”,
“smInfo”: {
“pduSessionId”: 10,
“n2InfoContent”: {
“ngapIeType”: “PDU_RES_SETUP_REQ”,
“ngapData”: {
“contentId”: “N2SmInfo”
}
},
“sNssai”: {
“sst”: 1,
“sd”: “010203”
}
}
},
“mtData”:{
“contentId”:“N1Msg”
},
“skipInd”:true,
“pduSessionId”: 10
}’
Hi @abousselmi,
Do you have any json sample for this api “/namf-comm/v1/ue-contexts/imsi-208930000000003/n1-n2-messages”?
Hi @nathalie21005
Please try to review your structure based on this example that you can find (among others): https://forge.3gpp.org/rep/all/5G_APIs/tree/REL-15
POST /ue-contexts/{ueContextId}/n1-n2-messages
{
"n1MessageContainer": {
"n1MessageContent": {
"contentId": "string"
},
"nfId": "string",
"serviceInstanceId": "string"
},
"n2InfoContainer": {
"smInfo": {
"pduSessionId": 0,
"n2InfoContent": {
"ngapMessageType": 0,
"ngapData": {
"contentId": "string"
}
},
"sNssai": {
"sst": 0,
"sd": "string"
},
"subjectToHo": true
},
"ranInfo": {
"n2InfoContent": {
"ngapMessageType": 0,
"ngapData": {
"contentId": "string"
}
}
},
"nrppaInfo": {
"nfId": "string",
"nrppaPdu": {
"ngapMessageType": 0,
"ngapData": {
"contentId": "string"
}
},
"serviceInstanceId": "string"
},
"pwsInfo": {
"messageIdentifier": 0,
"serialNumber": 0,
"pwsContainer": {
"ngapMessageType": 0,
"ngapData": {
"contentId": "string"
}
},
"sendRanResponse": false,
"omcId": "string"
}
},
"skipInd": false,
"lastMsgIndication": true,
"pduSessionId": 0,
"lcsCorrelationId": "string",
"ppi": 0,
"arp": {
"priorityLevel": 0
},
"5qi": 0,
"n1n2FailureTxfNotifURI": "string",
"smfReallocationInd": false,
"areaOfValidity": {
"taiList": [
{
"plmnId": {
"mcc": "string",
"mnc": "string"
},
"tac": "string"
}
]
},
"supportedFeatures": "string",
"oldGuami": {
"plmnId": {
"mcc": "string",
"mnc": "string"
},
"amfId": "string"
}
}
I did not tested it.