<div dir="ltr">I can't tell from your request what you're using to interface to ARI so let me tell you from what I have.  I use the Node ARI Client to talk to Asterisk and ARI.  However, I just looked up the information in the current Asterisk 15 docs and it appears to be the same.<div><br></div><div>If you look at the Channel option (<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Channels+REST+API#Asterisk15ChannelsRESTAPI-create">https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Channels+REST+API#Asterisk15ChannelsRESTAPI-create</a>) you see the originateWithId POST option.  I believe that's what you want.  And then you specify the caller id you want to use in the callerId query parameter.  It works like a champ.  I can change this easily for what ever customer I'm making the call for.</div><div><br></div><div>Hope this helps.  If not, let me know and I'll try again.</div><div><br></div><div>Regards,</div><div>Phil Mickelson</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 15, 2017 at 4:00 AM, Richard Frith-Macdonald <span dir="ltr"><<a href="mailto:richard.frith-macdonald@theengagehub.com" target="_blank">richard.frith-macdonald@theengagehub.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Help please  ... I've spent a couple of days experimenting and trawling documentation and the web in general about this, without success.<br>
<br>
I'm initiating an out-dial using ARI, and want to set the callerid number for that outgoing call.<br>
What I'm expecting to see is the number I specify in the Contact header of the SIP INVITE request asterisk is sending out (perhaps also in the From header ... I'm not actually sure where the callerid needs to be in the SIP request).<br>
<br>
My test rig is two instances of asterisk on the same box;  the one listening on port 5060 is making the out-dial, the other (listening on 5062) accepts the call and has a trivial dialplan to answer and playback a few words.  This works fine.<br>
<br>
The pjsip endpoint config Iooks like this:<br>
<br>
[devtest]<br>
type=endpoint<br>
context=default<br>
disallow=all<br>
allow=ulaw<br>
outbound_auth=devtest<br>
trust_id_outbound=yes<br>
send_pai=yes<br>
send_rpid=yes<br>
auth=devtest<br>
aors=devtest<br>
<br>
As you can see, I found various pages on the internet telling me to set trust_id_outbound, send_pai, and send_rpid to get callerid working<br>
<br>
If I edit my pjsip.conf to set 'from_num=777',  I see<br>
Contact: <<a href="http://sip:777@127.0.0.1:5060" rel="noreferrer" target="_blank">sip:777@127.0.0.1:5060</a>><br>
but my expectation was that leaving 'from_num' unset the value from CALLERID(num) should appear there.<br>
In fact if I leave it unset I see<br>
Contact: <<a href="http://sip:asterisk@127.0.0.1:5060" rel="noreferrer" target="_blank">sip:asterisk@127.0.0.1:5060</a>><br>
<br>
The sequence of ARI operations I'm using is really simple:<br>
1. channels/create (with app = myapp, channelId = "XXX, endpoint = PJSIP/123456@devtest)<br>
2. channels/XXX/variable (with variable=CALLERID(num) and value=777)<br>
3. channels/XXX/dial (with timeout=30)<br>
<br>
I'm hoping someone can easily spot my stupid mistake and tell me how ARI can set the callerid for an outbound call via pjsip.<br>
Thanks.<br>
<br>
<br>
______________________________<wbr>_________________<br>
asterisk-app-dev mailing list<br>
<a href="mailto:asterisk-app-dev@lists.digium.com">asterisk-app-dev@lists.digium.<wbr>com</a><br>
<a href="http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev" rel="noreferrer" target="_blank">http://lists.digium.com/cgi-<wbr>bin/mailman/listinfo/asterisk-<wbr>app-dev</a><br>
</blockquote></div><br></div>