Display Only Caller Number When Picking Up Parked Call in Asterisk

Hi together!

In my Asterisk setup, I park calls on one parking spot (e.g., 799) and later retrieve them from another spot (e.g., 800). When retrieving the parked call, I want the caller’s phone number to be displayed.

When parking a call, I save the caller’s phone number and want to ensure that when retrieving the parked call, the phone number is shown on the display.

Greets

Are the phone picking up the calls correctly configured to receive connected line updates?

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

I park a call, for example, +1 23 45 67 89, on ParkingSlot 800. When I dial 800 again, I want the display to show +1 23 45 67 89 instead of 800. Did I explain my intention correctly?

Yes. But you didn’t answer the question. A sufficient reason for t he number not displaying is that the endpoint that made the request is not properly configured for connected line updates, or doesn’t support them, at all.

1 Like

Please excuse me, I was quite tired—it was a long night of programming.
I’m still stuck, though, and I don’t know which setting you mean. Should I make a configuration for this in pjsip.conf?

If you want to find people here who are able to debug the configuration, or you intend to upgrade (even just for security) Asteisk in the future, you should have fairly urgent plans to move to chan_pjsip. However, chan_sip does work with connected line updates, and if it turns out that a connected line update is failing to be triggered, that is channel driver agnostic.

But I am already using pjsip.conf, which uses the chan_pjsip driver, or have I misunderstood something?

I misidentified the target of “this”.

Connected line update requires PAI or RPID to be sent, and that has to be enabled in pjsip.conf.

It is enabled:

send_pai=yes
send_rpid=yes

Are you sure that there is any way to do that…?

Capture a SIP log and see if updated information is being sent. It is possible that the phone doesn’t support it, in which case you would have to change the phone.

If it isn’t being sent, and you are using a supported version of Asterisk, I think it might be a bug, as it seems to me that a parking pickup should propagate the connected line information for the parked channel. You will need the SIP protocol log, for any bug report.

(I’m assuming that send-PAI, etc, are set on endpoint for the device making the pickup, rather than, or as well as, that being picked up.)

It is definitely not the phone, but Asterisk, because it works with 3CX as well with the same phone. You have already responded to a similar issue here, and this is exactly the same problem!

What I need is to park Callee Num +1 23 456 789!

[parking]
exten => 799,1,Answer()
same => n,Set(CALLER_ID=${CALLERID(num)}) <— SET THE CALLEE NUMBER +1 23 456 789
same => n,Park(LocationA-parking,CALLER_ID,300)

[unpark]
exten => 800,1,Answer()
same => n,Transfer(sip:+1 23 456 789@parked)

[parked]
exten => _X.,1,Answer() ← FETCH PARKED CALLEE NUMBER

I am pretty sure that 3CX uses the same approach for this. I need to be able to create a virtual SIP URI!

I wouldn’t expect that to work at all. The documentation for Transfer makes no mention of any special treatment for the domain name “parked”. I would expect this to send a REFER request to the phone referring it to sip:…@parked, and the phone to start a new call, for which Asterisk would ignore the domain name. I’d expect that call to fail, as busy, as the callee was stuck in the parking lot (alternatively to result in a second line call, but not one that Asterisk would realise to be such). It’s also possible that the phone would not try to use Asterisk as an outbound proxy, in which case it would fail to resolve the domain name.

What was wrong with the standard way of handling parking, which is to include the system generated context, for the parking lot, into the context used by the unparker (and normally the parker, if 799 is dialled directly, by them)? Note that earlier replies in this thread assume that you are using parking in the normal way.

The referenced article doesn’t seem to me to be the same issue, and my only contribution seems to be to provide some extra background as to why To and request URI should be the same.

Ok, so as I understand it, it is not possible to retrieve the Callee ID of the parked call in Asterisk, so this is an xy-problem for me.

Did you mean Caller ID?

I’m not in a position to easily verify how it actually works (I’d probably do that from the code, but I have to find the right place first). As such, I can’t verify your assertion.

However, I can tell you that what your dialplan is doing is nothing like how calls are supposed to be unparked.

Either you have an unusual requirement, but you are assuming that it is a common one, so haven’t detailed it adequately, or you have not understood how parking and Transfer are used, in Asterisk.

I have now managed to get it working—many thanks for your link, David! I was running my head against the wall but didn’t give up…

As you already mentioned, it works like this:

pjsip.conf:

send_rpid=yes
subscribe_context=HINTS

(if using send_rpid=no the function conntectedline will not work)

extensions.conf:

[HINTS]

; Parking
exten => 800,hint,park:800@LocationA-parking-lot
exten => 801,hint,park:801@LocationA-parking-lot
exten => 802,hint,park:802@LocationA-parking-lot
exten => 803,hint,park:803@LocationA-parking-lot
exten => 804,hint,park:804@LocationA-parking-lot
exten => 805,hint,park:805@LocationA-parking-lot
exten => 806,hint,park:806@LocationA-parking-lot
exten => 807,hint,park:807@LocationA-parking-lot
exten => 808,hint,park:808@LocationA-parking-lot
exten => 809,hint,park:809@LocationA-parking-lot

[MyContext]
exten => 1000,1,NoOp()
same => n,Set(CONNECTEDLINE(num)=+1 23 45 678 9)
same => n,Set(CONNECTEDLINE(name)=Called Parkpos is 800)
same => n,Dial(Local/800@LocationA-parking)
same => n,Hangup()

My Cisco now displays both lines, i.e., num and name. However, since only name is displayed prominently, I will only use name and show the number there. This means I will use the num as name:

same => n,Set(CONNECTEDLINE(name)=+1 23 45 678 9)

Now I need to find a way to store the counterpart’s number “+1 23 45 678 9” when parking. I will probably use the Asterisk DB for this so that I can retrieve the value here:

same => n,Set(CONNECTEDLINE(name)= ### VALUE FROM AST DB ###)

I park the call directly on the parking positions ‘800’, ‘801’, ‘802’, etc. I don’t need ‘799’ at all and I don’t even know why it is being suggested! So this is my final dialplan:

[outgoing]
include => LocationA-parking-lot

; Park
exten => _80X,1,ExecIf($[“${EXTENSION_STATE(${EXTEN}@LocationA-parking-lot)}” = “INUSE”]?ParkedCall(LocationA-parking,${EXTEN}))

; Unpark (Pickup)
exten => _80X,n,Set(PARKED_CALLEE=${DB(forward/${CALLERID(num)})})
exten => _80X,n,Set(CONNECTEDLINE(name)=${PARKED_CALLEE})
exten => _80X,n,Set(PARKINGEXTEN=${EXTEN})
exten => _80X,n,Park(LocationA-parking,s,${CALLERID(num)},300)
exten => _80X,n,Set(DB(forward/${PARKED_CALLEE})=)

Now I am able to use the following result in my cisco ip settings to park/unpark and blf:

Line Key 10 extended func:
fnc=sd+blf;ext=800@192.xxx.xxx;sub=800@192.xxx.xxx.xxx

Line Key 11 extended func:
fnc=sd+blf;ext=801@192.xxx.xxx;sub=801@192.xxx.xxx.xxx

Line Key 12 extended func:
fnc=sd+blf;ext=802@192.xxx.xxx;sub=802@192.xxx.xxx.xxx

and so on…