ARI - How to set the From: field when making a call

I’m using ARI to place a call and want to set the caller id number.

My SIP trunk provider says that I need to set the From field in the SIP invite to the caller id. How can I do that programmatically on the ARI POST /channels/create? The “callerId” field is setting the number in the SIP Inviter Remote Part ID field.

This is how my dial command looks like:

/ari/channels?endpoint=PJSIP/1234@SipTrunk&app=MyAppId&channelId=MyChannelId&callerId=MyName<callerIDNumber>&timeout=0&appArgs=internal

Will I need to pass the number as a variable to the dialplan when passing it to Stasis? What other alternatives do I have?

What’s in your pjsip.conf? I suspect you are overriding the From header there.

Is this the funny provider that uses From for caller ID and remote-party-id for the account code? In that case, they are broken and you will need to look back a couple of months to see if anyone found a work around for them. (The normal expectation is that, if you have both, From is the account code and remote-party-id is the caller ID.

Why are you enabling remote party id, at all?

Here’s the pertinent portion:

[SIPTrunkprovider]
type = endpoint
transport=transport-udp
allow= !all,ulaw,alaw
aors = SipTrunkProviderOutbound
direct_media=no
context=voice-otp
from_domain=Our Public IP
from_user=+MyPhoneNumber
send_rpid=yes
rtp_symmetric=yes
force_rport=yes
timers=no

So yes! Thanks a lot. That did the trick. Once I removed the from_user field, it worked as expected.

As for the remote-party-id field, we were setting it following SIP Remote Party ID and RPID Privacy for Outbound Calls

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.