Re: Using ARI to set callerid for an outdial using pjsip?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

If you look at the Channel option (https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Channels+REST+API#Asterisk15ChannelsRESTAPI-create) 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.

Hope this helps.  If not, let me know and I'll try again.

Regards,
Phil Mickelson


On Fri, Sep 15, 2017 at 4:00 AM, Richard Frith-Macdonald <richard.frith-macdonald@xxxxxxxxxxxxxxxx> wrote:
Help please  ... I've spent a couple of days experimenting and trawling documentation and the web in general about this, without success.

I'm initiating an out-dial using ARI, and want to set the callerid number for that outgoing call.
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).

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.

The pjsip endpoint config Iooks like this:

[devtest]
type=endpoint
context=default
disallow=all
allow=ulaw
outbound_auth=devtest
trust_id_outbound=yes
send_pai=yes
send_rpid=yes
auth=devtest
aors=devtest

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

If I edit my pjsip.conf to set 'from_num=777',  I see
Contact: <sip:777@127.0.0.1:5060>
but my expectation was that leaving 'from_num' unset the value from CALLERID(num) should appear there.
In fact if I leave it unset I see
Contact: <sip:asterisk@127.0.0.1:5060>

The sequence of ARI operations I'm using is really simple:
1. channels/create (with app = myapp, channelId = "XXX, endpoint = PJSIP/123456@devtest)
2. channels/XXX/variable (with variable=CALLERID(num) and value=777)
3. channels/XXX/dial (with timeout=30)

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.
Thanks.


_______________________________________________
asterisk-app-dev mailing list
asterisk-app-dev@lists.digium.com
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev

_______________________________________________
asterisk-app-dev mailing list
asterisk-app-dev@xxxxxxxxxxxxxxxx
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev

[Index of Archives]     [Asterisk SS7]     [Asterisk Announcements]     [Asterisk Users]     [PJ SIP]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Linux API]

  Powered by Linux