On caller side display CID with EP id who answered

Hi,

if I call 999 which is an extension who will call PJSIP/123&PJSIP/321, I want to display on the caller screen 123 or 321 depending on which EP answered. All EPs connected on same asterisk.

Possible to do this ?

Short answer: Yes

Here are some links you might find helpful:

https://docs.asterisk.org/Configuration/Functions/Manipulating-Party-ID-Information/

The ASCII art in the party-id manipulation page is messed up since the migration to github documentaiton.

Hi

thanks for those links, it works perfectly for some devices like SNOM ok but not for others eg GrandStream GXV3175

Thanks for your help.

I think I was to enthusiastic. Simple example, all EPs having send_rpid and send_pai setted to yes. 105 is calling 633 which will ring 104 and 115. The last one answer the call

-- PJSIP/tootai_115-000000c8 answered PJSIP/tootai_105-000000c6
-- PJSIP/tootai_115-000000c8 Internal Gosub(setWhoAnswered,s,1) start
-- Executing [s@setWhoAnswered:1] Set("PJSIP/tootai_115-000000c8", "__CHANNELEXTEN=PJSIP/tootai_115") in new stack
-- Executing [s@setWhoAnswered:2] Set("PJSIP/tootai_115-000000c8", "__CHANNELENDPOINT=tootai_115") in new stack
-- Executing [s@setWhoAnswered:3] Set("PJSIP/tootai_115-000000c8", "CONNECTEDLINE(num,i)=tootai_115") in new stack
-- Executing [s@setWhoAnswered:4] Set("PJSIP/tootai_115-000000c8", "CONNECTEDLINE(name,i)=PJSIP/tootai_115") in new stack
-- Executing [s@setWhoAnswered:5] Set("PJSIP/tootai_115-000000c8", "CONNECTEDLINE(num-pres,i)=allowed") in new stack
-- Executing [s@setWhoAnswered:6] Set("PJSIP/tootai_115-000000c8", "CONNECTEDLINE(name-pres,i)=allowed") in new stack
-- Executing [s@setWhoAnswered:7] Set("PJSIP/tootai_115-000000c8", "REDIRECTING(from-num,i)=PJSIP/tootai_115") in new stack
-- Executing [s@setWhoAnswered:8] Set("PJSIP/tootai_115-000000c8", "REDIRECTING(to-num,i)=tootai_115") in new stack
-- Executing [s@setWhoAnswered:9] Set("PJSIP/tootai_115-000000c8", "CALLERID(num)=tootai_115") in new stack
-- Executing [s@setWhoAnswered:10] Set("PJSIP/tootai_115-000000c8", "CALLERID(name)=PJSIP/tootai_115") in new stack
-- Executing [s@setWhoAnswered:11] Return("PJSIP/tootai_115-000000c8", "") in new stack

== Spawn extension (from_to-OFFICE, , 1) exited non-zero on ‘PJSIP/tootai_115-000000c8’
– PJSIP/tootai_115-000000c8 Internal Gosub(setWhoAnswered,s,1) complete GOSUB_RETVAL=
<— Transmitting SIP request (745 bytes) to UDP:192.168.12.105:51927 —>
UPDATE sip:tootai_105@192.168.12.105:51927 SIP/2.0
Via: SIP/2.0/UDP 10.0.70.12:5060;rport;branch=z9hG4bKPja85e0349-8f16-4948-a869-ad4e228b75db
From: sip:633@server.example.org;user=phone;tag=1128468d-9f65-4a53-b731-8ceaec363e10
To: “Labo” sip:tootai_105@server.example.org;tag=kpnhuv0juu
Contact: sip:10.0.70.12:5060
Call-ID: 313730383631333539353230363030-mnhrmrfaazam
CSeq: 24971 UPDATE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 3600;refresher=uas
Min-SE: 90
P-Asserted-Identity: “Tootai” sip:0033123456789@server.example.org;user=phone
Remote-Party-ID: “Tootai” sip:0033123456789@server.example.org;user=phone;party=called;privacy=off;screen=no

On the screen from calling phone, 633 is replaced by the value of Remote-Party-ID insteed of the value setted in CONNECTEDLINE.

Where is the mistake ?

i - If set, this will prevent the channel from sending out protocol messages because of the value being set

Connected line updates are implemented using remote party ID.

OK, my bad. Removing i (empty value) did the job for the callee but not on the caller side who still gets the original CID.

Is a datatype dedicated to send to the caller ? Is their somewhere definition for all datatype from this page CONNECTEDLINE - Asterisk Documentation?

You have to run it on the right channel.

Here I’m lost :wink: How can I get it and update it ?
I capture channel before dialing

Executing [s@setWhoCall:1] Set(“PJSIP/tootai_105-000000f3”, “__oriCHANNEL=PJSIP/tootai_105-000000f3”) in new stack
– Executing [s@setWhoCall:2] Set(“PJSIP/tootai_105-000000f3”, “__oriCHANNELEXTEN=PJSIP/tootai_105”) in new stack
– Executing [s@setWhoCall:3] Set(“PJSIP/tootai_105-000000f3”, “__oriCHANNELENDPOINT=tootai_105”) in new stack
– Executing [s@setWhoCall:4] Return(“PJSIP/tootai_105-000000f3”, “”) in new stack

then start DIAL process

Executing [633@from_to-OFFICE:21] Dial(“PJSIP/tootai_105-000000f3”, “PJSIP/tootai_104&PJSIP/tootai_115,U(setWhoAnswer)”) in new stack

In setWhoAnswer I see
PJSIP/tootai_115-000000f5 answered PJSIP/tootai_105-000000f3
– PJSIP/tootai_115-000000f5 Internal Gosub(setWhoAnswer,s,1) start
– Executing [s@setWhoAnswer:1] Set(“PJSIP/tootai_115-000000f5”, “__CHANNELEXTEN=PJSIP/tootai_115”) in new stack
– Executing [s@setWhoAnswer:2] Set(“PJSIP/tootai_115-000000f5”, “__CHANNELENDPOINT=tootai_115”) in new stack
– Executing [s@setWhoAnswer:3] Set(“PJSIP/tootai_115-000000f5”, “CONNECTEDLINE(num,)=tootai_115”) in new stack
– Executing [s@setWhoAnswer:4] Set(“PJSIP/tootai_115-000000f5”, “CONNECTEDLINE(name,)=PJSIP/tootai_115”) in new stack
– Executing [s@setWhoAnswer:5] Return(“PJSIP/tootai_115-000000f5”, “”) in new stack

RPID is setted on channel 000000f5 which is OK but how to run CONNECTEDLINE() on channel 000000f3 -the caller one- to update RPID ?

Nobody have an idea how to achieve this ?

I try with originate and bridge:

exten = 633,20(Start),Gosub(getWhoCall,s,1)
 same = n,Set(CALLERID(num)=${oriCHANNELENDPOINT})
 same = n,Set(CALLERID(name)=${oriCHANNELEXTEN})
 same = n,Originate(PJSIP/tootai_115,exten,from_to-OFFICE,6331,1,,c(105)n(MyCID)b(from_to-OFFICE,6332,1))
 same = n,NoOp(Ori ${oriCHANNEL})
 same = n,NoOp(Out ${outCHANNEL})
 same = n,Hangup

exten = 6331,1,NoOp(En cours ${CHANNEL})
 same = n,NoOp(Ori .... ${oriCHANNEL})
 same = n,Bridge(${oriCHANNEL})
 same = n,Playback(2tai-busy-all-call-later)
 same = n,Hangup

exten = 6332,1,NoOp(En cours ${CHANNEL})
 same = n,NoOp(Ori .... ${oriCHANNEL})
 same = n,Set(__outCHANNEL=${CHANNEL})
 same = n,Return

and

[getWhoCall]
;
exten = s,1,Set(__oriCHANNEL=${CHANNEL})
 same = n,Set(__oriCHANNELID=${CUT(oriCHANNEL,-,2)})
 same = n,Set(__oriCHANNELEXTEN=${CUT(oriCHANNEL,-,1)})
 same = n,Set(__oriCHANNELENDPOINT=${CUT(oriCHANNELEXTEN,/,2)})
 same = n,Return

Output is

 Executing [633@from_to-OFFICE:20] Gosub("PJSIP/tootai_105-00000015", "getWhoCall,s,1") in new stack                                                    
    -- Executing [s@getWhoCall:1] Set("PJSIP/tootai_105-00000015", "__oriCHANNEL=PJSIP/tootai_105-00000015") in new stack                                     
    -- Executing [s@getWhoCall:2] Set("PJSIP/tootai_105-00000015", "__oriCHANNELID=00000015") in new stack                                                    
    -- Executing [s@getWhoCall:3] Set("PJSIP/tootai_105-00000015", "__oriCHANNELEXTEN=PJSIP/tootai_105") in new stack                                         
    -- Executing [s@getWhoCall:4] Set("PJSIP/tootai_105-00000015", "__oriCHANNELENDPOINT=tootai_105") in new stack                                            
    -- Executing [s@getWhoCall:5] Return("PJSIP/tootai_105-00000015", "") in new stack                                                                        
    -- Executing [633@from_to-OFFICE:21] Set("PJSIP/tootai_105-00000015", "CALLERID(num)=tootai_105") in new stack                                            
    -- Executing [633@from_to-OFFICE:22] Set("PJSIP/tootai_105-00000015", "CALLERID(name)=PJSIP/tootai_105") in new stack                                     
    -- Executing [633@from_to-OFFICE:23] Originate("PJSIP/tootai_105-00000015", "PJSIP/tootai_115,exten,from_to-OFFICE,6331,1,,c(105)n(Plop)b(from_to-OFFICE,6
332,1)") in new stack                                                                                                                                         
    -- PJSIP/tootai_115-00000016 Internal Gosub(from_to-OFFICE,6332,1) start                                                                                  
    -- Executing [6332@from_to-OFFICE:1] NoOp("PJSIP/tootai_115-00000016", "En cours PJSIP/tootai_115-00000016") in new stack
    -- Executing [6332@from_to-OFFICE:2] NoOp("PJSIP/tootai_115-00000016", "Ori .... ") in new stack
    -- Executing [6332@from_to-OFFICE:3] Set("PJSIP/tootai_115-00000016", "__outCHANNEL=PJSIP/tootai_115-00000016") in new stack
    -- Executing [6332@from_to-OFFICE:4] Return("PJSIP/tootai_115-00000016", "") in new stack
  == Spawn extension (from_to-OFFICE, s, 1) exited non-zero on 'PJSIP/tootai_115-00000016'
    -- PJSIP/tootai_115-00000016 Internal Gosub(from_to-OFFICE,6332,1) complete GOSUB_RETVAL=
    -- Called tootai_115                                                                                                                                      
    -- PJSIP/tootai_115-00000016 is ringing                                                                                                                   
    -- PJSIP/tootai_115-00000016 answered                                                                                                                     
    -- Executing [6331@from_to-OFFICE:1] NoOp("PJSIP/tootai_115-00000016", "En cours PJSIP/tootai_115-00000016") in new stack
    -- Executing [6331@from_to-OFFICE:2] NoOp("PJSIP/tootai_115-00000016", "Ori .... ") in new stack
    -- Executing [6331@from_to-OFFICE:3] Bridge("PJSIP/tootai_115-00000016", "") in new stack  
    -- Executing [6331@from_to-OFFICE:4] Playback("PJSIP/tootai_115-00000016", "2tai-busy-all-call-later") in new stack
[2024-02-27 18:25:12] WARNING[2258266][C-00000012]: mp3/interface.c:218 decodeMP3: Junk at the beginning of frame 49443304     
    -- <PJSIP/tootai_115-00000016> Playing '2tai-busy-all-call-later.slin' (language 'fr')
    -- Executing [633@from_to-OFFICE:24] NoOp("PJSIP/tootai_105-00000015", "Ori PJSIP/tootai_105-00000015") in new stack
    -- Executing [633@from_to-OFFICE:25] NoOp("PJSIP/tootai_105-00000015", "Out ") in new stack
    -- Executing [633@from_to-OFFICE:26] Hangup("PJSIP/tootai_105-00000015", "") in new stack
  == Spawn extension (from_to-OFFICE, 633, 26) exited non-zero on 'PJSIP/tootai_105-00000015'

each channel ${oriCHANNEL} being empty in 6331 & 6332, ${outCHANNEL} empty in 633 after originate so I can’t bridge those channels.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.