<div dir="ltr"><div><code class="gmail-bash gmail-plain" style="white-space:nowrap;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto;color:rgb(0,0,0)">Hi Dan,</code></div><div><code class="gmail-bash gmail-plain" style="white-space:nowrap;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto;color:rgb(0,0,0)"><br></code></div><div><code class="gmail-bash gmail-plain" style="white-space:nowrap;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto;color:rgb(0,0,0)">i would do something like this (it is not a copy of what we are doing but an example of how i would do it)</code></div><div><code class="gmail-bash gmail-plain" style="white-space:nowrap;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto;color:rgb(0,0,0)">Important here is the "--data" and "-H" Option as well as the "variables" section within the Body. I added the callerid function here as well as it is the sample in the asterisk wiki.</code></div><div dir="ltr"><code class="gmail-bash gmail-plain" style="white-space:nowrap;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto;color:rgb(0,0,0)"><br></code></div><div dir="ltr"><code class="gmail-bash gmail-plain" style="white-space:nowrap;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto;color:rgb(0,0,0)">curl -</code><code class="gmail-bash gmail-functions" style="white-space:nowrap;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto;color:rgb(255,20,147)">v</code><span style="color:rgb(51,51,51);font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;white-space:nowrap"> </span><span class="gmail-pun" style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">-</span><span class="gmail-pln" style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">H </span><span class="gmail-str" style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">"Content-Type: application/json"</span><span style="color:rgb(51,51,51);font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;white-space:nowrap"> </span><code class="gmail-bash gmail-plain" style="white-space:nowrap;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto;color:rgb(0,0,0)">-u asterisk:asterisk -X POST </code><code class="gmail-bash gmail-string" style="white-space:nowrap;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto;color:rgb(0,51,102)">"<a href="http://localhost:8088/ari/channels/1400609726.3/play?media=sound:hello-world" style="color:rgb(25,46,132);text-decoration-line:none;border-radius:0px;background:none;border:0px;float:none;height:auto;line-height:20px;margin:0px;outline:0px;overflow:visible;padding:0px;vertical-align:baseline;width:auto;box-sizing:content-box;min-height:auto">http://localhost:8088/ari/channels/newChannelId"</a> </code><span class="gmail-pun" style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">--</span><span class="gmail-pln" style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">data '</span><span style="color:rgb(51,51,51);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">{ "endpoint": "SIP/Alice", "variables": { "CALLERID(name)": "Alice" , "PJSIP_HEADER(add,P-Asserted-Identity":"foobar"} }</span><span style="color:rgb(51,51,51);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px">'</span></div><div><br></div><div>BR</div><div>Jöran</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 10, 2020 at 3:43 PM Dan Cropp <<a href="mailto:dan@amtelco.com">dan@amtelco.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_8398959278478309819WordSection1">
<p class="MsoNormal">Hi Jöran,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Would it be possible to see an example using curl of how you are passing the PAI Header through ARI create?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Dan<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> asterisk-users <<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>>
<b>On Behalf Of </b>Jöran Vinzens<br>
<b>Sent:</b> Friday, August 7, 2020 12:10 PM<br>
<b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion <<a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a>><br>
<b>Subject:</b> Re: [asterisk-users] With ARI, is it possible to create (originate) a call and pass both the caller id name and number?<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Dan,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">as far as PPI and PAI Header, we use the channel Vars in order to do that. In Latest Asterisk you can set Channel vars within the create command in the Body. Just set the PJSIP(add,PAI) as you would do it in Dialplan.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://blogs.asterisk.org/2020/07/22/ari-create-channel-with-variables/" target="_blank">https://blogs.asterisk.org/2020/07/22/ari-create-channel-with-variables/</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">BR<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Jöran<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Aug 7, 2020 at 7:06 PM Dan Cropp <<a href="mailto:dan@amtelco.com" target="_blank">dan@amtelco.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">An additional follow-up question, if I need to set the P-Asserted-Identity on the create (originate), is there a way to do this with ARI?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> asterisk-users <<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>>
<b>On Behalf Of </b>Dan Cropp<br>
<b>Sent:</b> Friday, August 7, 2020 11:51 AM<br>
<b>To:</b> '<a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a>' <<a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a>><br>
<b>Subject:</b> [asterisk-users] With ARI, is it possible to create (originate) a call and pass both the caller id name and number?<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I’m trying to transition from AMI to ARI.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Running into a small hiccup when I try to create (originate a call) with the caller id name and number<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I can pass the Name and Number if the name has no spaces in it and it shows up in my PhonerLite application.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">curl -v -u asterisk:asterisk -X POST
<a href="http://asterisk:astersk@localhost:8088/ari/channels/mycallerid.1?endpoint=PJSIP/1003@1003&app=hello-world&extension=1000&context=mycontext&priority=1&channelId=mycallerid.1&formats=ulaw&timeout=30&callerId=Dan%3c291" target="_blank">
http://asterisk:astersk@localhost:8088/ari/channels/mycallerid.1?endpoint=PJSIP/1003@1003&app=hello-world&extension=1000&context=mycontext&priority=1&channelId=mycallerid.1&formats=ulaw&timeout=30&callerId=Dan<291</a>><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">However, when the caller id name has a space in it, I can’t figure out how to pass the name and number successfully. The following only displays asterisk for the number and Dan
for the name <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">curl -v -u asterisk:asterisk -X POST
<a href="http://asterisk:astersk@localhost:8088/ari/channels/mycallerid.1?endpoint=PJSIP/1003@1003&app=hello-world&extension=1000&context=mycontext&priority=1&channelId=mycallerid.1&formats=ulaw&timeout=30&callerId=Dan" target="_blank">
http://asterisk:astersk@localhost:8088/ari/channels/mycallerid.1?endpoint=PJSIP/1003@1003&app=hello-world&extension=1000&context=mycontext&priority=1&channelId=mycallerid.1&formats=ulaw&timeout=30&callerId=Dan</a> Cropp<291><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Here is an example of how we do this with AMI successfully.<u></u><u></u></p>
<p class="MsoNormal">Action: Originate<u></u><u></u></p>
<p class="MsoNormal">ActionID: S40<u></u><u></u></p>
<p class="MsoNormal">Channel: PJSIP/1003@1003<u></u><u></u></p>
<p class="MsoNormal">Exten: createcall<u></u><u></u></p>
<p class="MsoNormal">Context: IS<u></u><u></u></p>
<p class="MsoNormal">Priority: 1<u></u><u></u></p>
<p class="MsoNormal">Timeout: 60000<u></u><u></u></p>
<p class="MsoNormal">CallerID: Dan Cropp <291><u></u><u></u></p>
<p class="MsoNormal">Variable: CALLERID(num-pres)=allowed_passed_screen,TrunkAllocateId=1,OriginateCallId=2<u></u><u></u></p>
<p class="MsoNormal">Async: true<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Dan<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">
http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" target="_blank">
https://community.asterisk.org/</a><br>
<br>
New to Asterisk? Start here:<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" target="_blank">
https://wiki.asterisk.org/wiki/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<pre>Jöran Vinzens - <a href="mailto:vinzens@sipgate.de" target="_blank">vinzens@sipgate.de</a><br>Telefon: +49 211-63 55 56-21<br>Telefax: +49 211-63 55 55-22<br><br>sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf<br>HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois<br>Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391<br><br><a href="http://www.sipgate.de" target="_blank">www.sipgate.de</a> - <a href="http://www.sipgate.co.uk" target="_blank">www.sipgate.co.uk</a><u></u><u></u></pre>
</div>
</div>
</div>
</div>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.org/</a><br>
<br>
New to Asterisk? Start here:<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><pre>Jöran Vinzens - <a href="mailto:vinzens@sipgate.de" target="_blank">vinzens@sipgate.de</a><br>Telefon: +49 211-63 55 56-21<br>Telefax: +49 211-63 55 55-22<br><br>sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf<br>HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois<br>Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391<br><br><a href="http://www.sipgate.de" target="_blank">www.sipgate.de</a> - <a href="http://www.sipgate.co.uk" target="_blank">www.sipgate.co.uk</a><br></pre></div></div></div>