Hmmm, according to your refs, none really apply to this situation. CALLERID dialplan function
The CALLERID function has been around for quite a while and its use is straightforward. It is used to examine and alter the caller information that came into the dialplan with the call. Then the call with it's caller information passes on to the destination using the Dial() or Queue() application. The CALLERID information is passed during the initial call setup. However, depending on the channel technology, the caller name may be delayed. Q.SIG is an example where the caller name may be delayed so your dialplan may need to wait for it. CONNECTEDLINE dialplan function The CONNECTEDLINE function does the opposite of the CALLERID function. CONNECTEDLINE can be used to setup connected line information to be sent when the call is answered. You can use it to send new connected line information to the remote party on the channel when a call is transferred. The CONNECTEDLINE information is passed when the call is answered and when the call is transferred. Icon It is up to the channel technology to determine when to act upon connected line updates before the call is answered. ISDN will just store the updated information until the call is answered. SIP will immediately update the caller with a Re-INVITE. Since the connected line information can be sent while a call is connected, you may need to prevent the channel driver from acting on a *partial* update. The 'i' option is used to inhibit the channel driver from sending the changed information immediately. the callerid of the target phone is set in the pjsip channel driver config, not in my dialplan (the same as chan_sip): And, my dialplan doesn't care about the callerid info for the phone you are dialing... in chan_sip, I get it via the 180 Ringing, but in pjsip, I am given useless information instead. I don't need it to change the sip exchanges to a re-invite, either. The phone is able to pick it up from the 180 Ringing just fine. Here is the config for the endpoints, a little cut down: [t12] ; Yealink T49G mac=00:15:65:... type=endpoint auth=t12 transport=transport-udp aors=t12 <snip> callerid="Steve" <101> [t13] ; Yealink T48G mac=00:15:65:... type=endpoint auth=t13 transport=transport-udp aors=t13 <snip> callerid="s2 test" <102> Since the config holds the callerids for each endpoint, I don't have any code to do lookups to get the callerid of the target. chan_sip has been fine providing it to the phone via the 180 Ringing... Right now, I'm running the exact same dialplan for chan_sip and pjsip. Are you telling me that I have to change the dialplan for pjsip? Can you give me a solid example of what I'd need to do in the dialplan to get the same effect? As a matter of fact, I run the two channel drivers on two different ports, and I have phones on pjsip, and phones on chan_sip at the same time... murf On Mon, May 15, 2017 at 10:27 AM, Richard Mudgett <[email protected]> wrote: > > > On Mon, May 15, 2017 at 10:45 AM, Steve Murphy <[email protected]> wrote: > >> Hello-- >> >> I've got complaints that the phones are presenting the wrong info when >> making an outgoing call... instead of displaying the called party info, >> it's displaying the caller's info, which is highly uninteresting. I've been >> looking at the behavior with Yealink phones, but I'm told that ALL phones >> have the problem, and comparing with the sip channel driver. >> >> I'm working with asterisk (and pjsip) at version 13.15.0, so this is >> pretty much current behavior. >> >> I traced it down to the 180 Ringing message sent to the phone from >> Asterisk, in the course of making an outgoing call from the Yealink, in >> this case, to another extension on the same phone system. >> >> In the old chan_sip world, I see this: >> >> [May 13 13:10:58] <--- Transmitting (NAT) to 67.215.23.186:28762 ---> >> [May 13 13:10:58] SIP/2.0 180 Ringing >> [May 13 13:10:58] Via: SIP/2.0/UDP 192.168.134.126:5060;branch=z9 >> hG4bK1785363097;received=67.291.23.186;rport=28762 >> [May 13 13:10:58] From: "Steve Murphy" <sip:[email protected]:5060 >> >;tag=2559859725 >> [May 13 13:10:58] To: <sip:[email protected]:5060>;tag=as0a66b2c7 >> [May 13 13:10:58] Call-ID: [email protected] >> [May 13 13:10:58] CSeq: 2 INVITE >> [May 13 13:10:58] Server: nexVortex Inc Hosted 3.0 PBX >> [May 13 13:10:58] Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, >> SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE >> [May 13 13:10:58] Supported: replaces, timer >> [May 13 13:10:58] Contact: <sip:[email protected]:5060> >> [May 13 13:10:58] Remote-Party-ID: "Shifting Sands" < >> sip:[email protected]>;party=called;privacy=off;screen=no >> [May 13 13:10:58] Content-Length: 0 >> [May 13 13:10:58] >> >> Note, that Asterisk serves up callerid info from the target extension in >> this header, providing not only the number of the target extension, but the >> callerid NAME info, also, which is pretty nice! >> >> But, in the PJSIP world, I see this instead (on a different test system): >> >> [May 13 08:21:59] <--- Transmitting SIP response (597 bytes) to UDP: >> 192.168.134.102:5060 ---> >> [May 13 08:21:59] SIP/2.0 180 Ringing >> [May 13 08:21:59] Via: SIP/2.0/UDP 192.168.134.102:5060;rport=506 >> 0;received=192.168.134.102;branch=z9hG4bK1705376406 >> [May 13 08:21:59] Call-ID: [email protected] >> [May 13 08:21:59] From: "Steve" <sip:[email protected]>;tag=3119644064 >> [May 13 08:21:59] To: <sip:[email protected]>;tag= >> c7988cae-0380-49b4-84e6-0a03b656ab85 >> [May 13 08:21:59] CSeq: 2 INVITE >> [May 13 08:21:59] Server: nexVortex SoupedUp Asterisk Hybrid >> [May 13 08:21:59] Contact: <sip:192.168.134.227:57969> >> [May 13 08:21:59] Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, >> ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER >> [May 13 08:21:59] Remote-Party-ID: "Steve" <sip:[email protected]>;priv >> acy=off;screen=no >> [May 13 08:21:59] Content-Length: 0 >> >> >> In this instance, it just looks like the rpid is a copy of the "From:" >> header. This isn't so interesting, as I already know my own name and >> extension number! >> >> I traced this down to the add_rpid_header() func in the >> res/res_pjsip_caller_id module... but I suspect that the connected line >> updates play a role here, and I'm too much a nube to know where the "right" >> information is. >> >> Am I hallucinating? Got a bad config? Or is there a bug here? >> > > There isn't much to determine why the wrong party information [1] is being > used here. > I do think this is a configuration or dialplan issue and not a bug. Maybe > you are using > CALLERID when you should be using CONNECTEDLINE on the PJSIP channel? > > This could be a configuration issue caused by the difference between how > chan_sip > and chan_pjsip do things. Since chan_sip predates pre-dial handlers you > had to setup > information in inheritable channel variables and the SipAddHeader > application before > dialing the destination so the outgoing channel gets created with expected > information. > For PJSIP channels you need to use pre-dial handlers [2] to setup > information on the > actual outgoing channel before the call gets placed. > > Richard > > [1] https://wiki.asterisk.org/wiki/display/AST/Manipulating+ > Party+ID+Information > [2] https://wiki.asterisk.org/wiki/display/AST/Pre-Dial+Handlers > [3] http://blogs.asterisk.org/2017/03/29/dialplan-handler- > routines-allow-customization/ > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-dev mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-dev > -- Steve Murphy ParseTree Corporation 57 Lane 17 Cody, WY 82414 ✉ murf at parsetree dot com ☎ 307-899-0510
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
