How to show callerid on a intercepted call

Hello again friends,
i am using the pickup application to intercept calls, the way i have it configured is that any phone can intercept this on particular extension. i am trying to figure out how to show the caller id of the callee on the phone at intercepted the call

incoming
call—>*----->extension to be intercepted
|
|
|--------> phone that will intercept call (display caller id of call here)

i have tried to use share, but since i dont know the name of the channel the call is coming from, that didnt work particularly well. also using channel.CALLERID(“name”):set(“value”) doesn’t seem to be having any affect.

thanks as always.

This should work out of the box if you have sendrpid set to yes or pai, and the phone supports it.

I it is just possible that you will need an interception macro )https://wiki.asterisk.org/wiki/display/AST/Manipulating+Party+ID+Information). I suppose it could be an edge case that doesn’t work.

is this a channel var i need to set on the extension i am setting the pickup mark on, or extension that is doing the pickup?

do i set it here?

extensions[default][100]= function(context,exten)
     	channel._PICKUPMARK = "intercept"
        app.dial("PJSIP/100")
end

or here?

extensions[default][888] = function(context,exten)
	app.pickup("intercept@PICKUPMARK")		
end

I don’t recognize that syntax.

It marking something and there is only one channel that it makes sense to mark.

its lua, i think in normal asterisk dial plan it owuld be something like this

[default]
exten=>100,s,SET(_PICKUPMARK="intercept")
exten=>100,1,Dial("PJSIP/100")
exten=>100,2,Hangup()
exten=>888,s,PICKUP(""intercept@PICKUPMARK")	(want to get the caller id here)

Even though it would be nice, it’s not a behavior I’ve seen in any phone system I’ve ever used. If you pick up the phone, you see whatever the pickup call requires (Eg. *8, 888 or whatever you need to dial)

You would need to make the phone that makes the outbound call, change it’s display. I’ve not seen any that does that either.

Instead of trying to figure out every thing all at once… Try making the phone show something when you dial out from it.

Eg. make a new extension, and try changing the caller ID fields one by one… Whenever your phone changes what it displays, you can move on to applying it to the call that’s got picked up. The available callerID files are listed here (For asterisk 17.)

It is going to be CONNECTEDLINE, not CALLERID, that has to be manipulated, here.

Oh… I somehow missed that function, and had the impression that CALLERID could change both. :wink:

Also I just made a few tests. And it appears it works, under certain conditions…

    -- Executing [<DialedNumber>@<privateInfoRemoved>-outbound-SIPDevices:2] Set("PJSIP/<privateInfoRemoved>-802-00000000", "CONNECTEDLINE(name)=Hello World") in new stack
    -- Executing [<DialedNumber>@<privateInfoRemoved>-outbound-SIPDevices:3] Set("PJSIP/<privateInfoRemoved>-802-00000000", "CONNECTEDLINE(num)=22222222") in new stack
<--- Transmitting SIP response (696 bytes) to UDP:<sipPhoneIP>:40561 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP <sipPhoneIP>:40561;rport=40561;received=<sipPhoneIP>;branch=z9hG4bK-mzw9scxl1yi7
Call-ID: 313630373431343930343230333231-1xmymoyfzuus
From: "Test (802)" <sip:<privateInfoRemoved>-802@<sipServer>>;tag=nn5kakvfsd
To: <sip:70704040@<sipServer>;user=phone>;tag=20216562-a90a-4b18-96d3-2b416970410e
CSeq: 1 INVITE
Server: Asterisk
Contact: <sip:<sipServerIP>:5060>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER
Remote-Party-ID: "Hello World" <sip:22222222@<sipServer>;user=phone>;party=called;privacy=off;screen=no
Content-Length:  0

I did however have to add the following to the device template in pjsip_wizard.conf

endpoint/send_connected_line          = yes
endpoint/connected_line_method        = invite
endpoint/send_rpid                    = yes
endpoint/rpid_immediate               = yes

I added all of them at once, so don’t know if they are all needed. But at least ONE of them is, as the remote party header did not appear with just the set lines in the dial plan.

The SNOM 720, I used to test the call, however, just ignored the information. :wink:

@Chano what does your dial plan look like?

I just set up a quick test, on my test system. So don’t have it anymore. But I did something like

same => n,Set(CONNECTEDLINE(name)=Hello World)
same => n,Set(CONNECTEDLINE(num)=22222222)

The rest of the dial plan was unrelated. Also I set the connected line data before the dial command. It could also be done in a pre-dial macro, however, I would expect that to affect the outgoing leg of the call not the originating leg.

i’m still not clear how i can get the CID of Phone A to Phone C, i see you are doing same, but which ext is the same associated with? the incoming one, or in the call pickup ext? i’ve tried both and read the link from david551, but am still failing to grok =|

in the extension that is setup to do the intercept, how to i get the CID of that inbound call so i can set the CONNECTLINE to that?

using my previous diagram

incoming (phone A)
call—————>extension to be intercepted (phone B)
|
|
|--------> phone C that will intercept call (display caller id of call of phone A here)

The extension I used was my outbound handler, the changes were placed just before the actual call to the Dial() application. But again, it depends on the phone, how the header is handled.

i guess my problem now isn’t changing the ID, but passing it from from one channel to another.

phone a and phone b have a channel between them, that channel is marked for pickup, a whole new channel from phone c is created from my understanding to pickup the call between a and b. its not clear how to get the info from the a/b channel over to this new channel so i can manipulate the cid info.

c becomes the bridged channel, so a connected line update will be initiated based on c.

Your problem is to make connected line update work, not to supply the right id.

@david551 i understand how to set the connected line info based on the examples provided, i’m not seeing how to get the info from call A where the caller id info i want is over to this bridged channel. this may be apparent to you, but i am missing a detail, maybe you can try this out yourself and then provide some guidance

this is whats in the channel A channel that is calling B

Dumping Info For Channel: PJSIP/cordless1-00000008:
================================================================================
Info:
Name=               PJSIP/cordless1-00000008
Type=               PJSIP
UniqueID=           1608922002.12
LinkedID=           1608922002.12
CallerIDNum=        801
CallerIDName=       Cordless 01
ConnectedLineIDNum= (N/A)
ConnectedLineIDName=(N/A)
DNIDDigits=         111
RDNIS=              (N/A)
Parkinglot=
Language=           en
State=              Ring (4)
Rings=              1
NativeFormat=       (g722|ulaw)
WriteFormat=        g722
ReadFormat=         g722
RawWriteFormat=     g722
RawReadFormat=      g722
WriteTranscode=     No
ReadTranscode=      No
1stFileDescriptor=  -1
Framesin=           0
Framesout=          0
TimetoHangup=       0
ElapsedTime=        0h0m0s
BridgeID=           (Not bridged)
Context=            incoming
Extension=          111
Priority=           1
CallGroup=
PickupGroup=
Application=        DumpChan
Data=               (Empty)
Blocking_in=        (Not Blocking)

Variables:
MYCALLERID="Cordless 01" <801>
PICKUPMARK=intercept

B never picks up, so how is the C channel supposed to get access to the A channel CID so we can try to set the connected line info
this is the info that i have in the c channel

Dumping Info For Channel: PJSIP/cordless2-0000000a:
================================================================================
Info:
Name=               PJSIP/cordless2-0000000a
Type=               PJSIP
UniqueID=           1608922018.14
LinkedID=           1608922018.14
CallerIDNum=        802
CallerIDName=       Cordless 02
ConnectedLineIDNum= (N/A)
ConnectedLineIDName=(N/A)
DNIDDigits=         57
RDNIS=              (N/A)
Parkinglot=
Language=           en
State=              Ring (4)
Rings=              1
NativeFormat=       (g722|ulaw)
WriteFormat=        g722
ReadFormat=         g722
RawWriteFormat=     g722
RawReadFormat=      g722
WriteTranscode=     No
ReadTranscode=      No
1stFileDescriptor=  -1
Framesin=           0
Framesout=          0
TimetoHangup=       0
ElapsedTime=        0h0m0s
BridgeID=           (Not bridged)
Context=            internal
Extension=          57
Priority=           1
CallGroup=
PickupGroup=
Application=        DumpChan
Data=               (Empty)
Blocking_in=        (Not Blocking)

Variables:

how the heck do i get that caller id info from A to so that i can set the connectedline info.

When you bridge the channels, I would hope the relevant macro, described in the document, should get triggered. You use the macro to update the connected line information on the newly connected channel.

I suppose it is possible that this particular case is broken. I’ve only tried very limited cases, in which using the macros wasn’t even needed.

This does require that senrpid be supported by the phone, and is enabled.

Hi david551,
thanks, that provided me the information i needed to get my stuff setup. correctly. i needed to add send_rpid=yes to the gateway device and phones that are doing the pickup, as well as changing the phones to use RPID-PAI-FROM for the CID info and things are set now.

cheers.