Hope you are having amazing time. I am using Asterisk ARI with Java statis application to build my IVR/OBD solution. I am trying to make outbound call using Channel with ID ARI API with following request body:
“callerId”: “CALLER_NAME <CALLER_NUMBER>”
The issue is that I am always getting following contact header in INVITE packet:
Is there any way to change it dynamically using ARI only? I am using PJSIP driver and following is the pjsip.conf endpoint configuration:
when I use contact_user, contact header is changed to hardcoded value but I want dynamic contact header in below format
I tried sending sip_headers in JSON request body, tried sending variable also in JSON but didn’t get any success. Can anyone suggest if it is possible to change dynamically using Statis application only? By the way, I’m using Asterisk version 18.8.0 on CentOS
The only ability to set it dynamically ANYWHERE is by enabling the use_callerid_contact option in global, and using callerid.
If you need to do this, the other endpoint is broken.
Thank you @jcolp. It’s working as expected.
I’m testing this change for all my use cases and seems it’s fine for my use cases to implement this change. Will ask again if I face any issue.
Thanks for your support.
I’m facing one more issue. For outbound calls made via ARI (using Channel with ID), asterisk is not sending ACK for 200 OK (INVITE) message. Could you please guide me how this issue can be fixed. Contact header one is working like a charm, just this issue is remaining.
Due to this, call is not getting terminated properly on statis application end. Do I need to enable/disable something in pjsip.conf to make it work or other information is required for my end? Asterisk configuration is similar to above one.
Thanks in advance for your support…
There is no configuration specifically for ACK. It is commonly a result of networking configuration, NAT, firewall, or SIP ALG. You would need to actually show a SIP trace (pjsip set logger on), including if Asterisk is receiving the 200 OK.
Yes, asterisk is receiving 200 OK (INVITE) from other end but it is not sending ack for the same. Due to confidential data, I won’t be able to share SIP trace
Hi, there is one more issue. I enabled p-asserted-header to sent in outbound call but it is being sent in different format than expected one. following is the request body which I am sending to originate with id ARI endpoint.
final Map<String, Object> body = new HashMap<>();
body.put(“callerId”, getCallerId(callerName, callerNumber));
final Map<String, Object> channelVars = new HashMap<>();
channelVars.put("P-Asserted-Identity", "<tel:" + callerNumber + ">");
Currently, I’m getting following PAI header:
Could you please guide on this issue.
Resolved. send_pai=yes in pjsip.conf was overwriting the header sent to originate ARI api.