Display name of dialed internal number

Yes, on each friend section.

Hi!!
What asterisk are you using?
I’m using the out of the box clean one. :slight_smile:
The call to the database is the asterisk one?

Best Regards,

Jose

I’m using Asterisk 14.2. The advantage of using connectedline is that you do not have to wait for anything and the name will be displayed right after dialing . It was a feature that our old NEC PBX had that we did not want to loose.

Tried but does not work.
For now it’s ok but I will prefer a way to have the name of the called number during ring. :slight_smile:

You where amazing, thanks so much for your help.

Best Regards,

Jose

Hi phonefxg!!

Thanks for your answer.
You are using pjsip and I’m not. Do you have the same approach for the plain asterisk with a standard sip module?

I saw you called a database function:

;Function in func_odbc
[CALLEE_NAME_ASTERISK]
prefix=GET
dsn=asterisk
readsql=SELECT phone_name FROM ps_endpoints WHERE extension = ‘${ARG1}’

Is this a pjsip database or one you installed?
Do you populate this database with the numbers and names or this is an asterisk database populated by the sip.conf or extensions.conf?

Sorry but I started not long ago with asterisk.

For now I applied the jcolp solution but on the originator set the name of the destination only appears when he answers.

I would appreciate your guidance.

Thanks so munch in advance.

Best Regards,

Jose

It’s a custom function that I made just for looking up the callee name. I’m using the ps_endpoints table that you need if you are using PJSP realtime . I have added two columns to the existing database but you could do it differently.

It’s a database that YOU populate instead of using a sip.conf file.It’s called ARA: Home - Asterisk Documentation

If you do not want to use realtime with a database, I guess you could use something like sed or awk to lookup the name in your sip.conf file.

You could do a test with a static name, and see if it satisfy your needs, and then make some kind of AGI or bash script to lookup the name in sip.conf :

exten => 2000,1,NoOp()
same => n,Set(CONNECTEDLINE(all,i)=“Joe Black <${EXTEN}>”)
same => n,Dial(PJSIP/${EXTEN},15,I)
same => n,Hangup()

There’s a lot of advantages when using realtime, I also use the connectedline function to display the outgoing town on outgoing calls by looking up the prefix and area code.

Hi!!!

Thanks for your help but it didn’t worked for me.

Didn’t show any name :frowning:

[macro-standardextensiondial]
;
; Standard extension macro (with call forwarding):
; ${ARG2} - Device(s) to ring
; ${temp} = cfw target
; ${ARG1} = calling extension
;
;Check if CFW is configured
exten => s,1,Set(temp=${DB(CFW_ALL/${ARG1})}) ; Get CFW_ALL key, if not existing, goto next line
same => n,NoOp(CheckCallForward)
same => n,GotoIf(${temp}?:Check-BusyFWD,1)
same => n,NoOp(CallForwardActivated)
same => n,GotoIf($["${temp}"="${CALLERID(num):3}"]?No-Forward,1); if cfw target and calling are equal then allow to dial the source extension
same => n,Dial(Local/${temp}@phones,240) ; Unconditional forward
same => n,Hangup

;Check if CFW_BUSY is configured
exten => Check-BusyFWD,1,NoOp(CheckBusyFWD)
same => n,NoOp(CheckCallForwardBusy)
same => n,Set(temp=${DB(CFW_BUSY/${ARG1})}) ; Get CFW_BUSY key, if not existing, goto 105
same => n,GotoIf(${temp}?:Check-noanFWD,1)
same => n,NoOp(Busy CallForwardActivated)
same => n,Dial(Local/${temp}@phones/n) ; Forward on busy or unavailable
same => n,Hangup

;Check if CFW_NOAN is configured
exten => Check-noanFWD,1,NoOp(ChecknoanFWD)
same => n,NoOp(CheckCallForwardNoan)
same => n,Set(temp=${DB(CFW_NOAN/${ARG1})}) ; Get CFW_NOAN key, if not existing, goto 105
same => n,GotoIf(${temp}?:No-Forward,1)
same => n,NoOp(noan CallForwardActivated)
same => n,Set(CALLERID(num)=${CALLERID(num):3});gets the caller ID and removes the ext to present the correct CLID
same => n,Dial(${ARG2},20) ;dial first the estension then
same => n,Dial(Local/${temp}@phones,240) ; Forward on noan
same => n,Hangup

; No CFW key so dial the extension
exten => No-Forward,1,NoOp(Dial extension)
same => n,Set(CONNECTEDLINE(all,i)=“Joe Black <${ARG1}>”)
same => n,Dial(${ARG2},240,|) ; 240sec timeout
same => n,Hangup

[phones]

exten => 7000,1,NoOp(a marcar…)
same => n,Macro(standardextensiondial,7000,SIP/ext7000) ; SIP connection

exten => 7001,1,NoOp(a marcar…)
same => n,Macro(standardextensiondial,7000,SIP/ext7000) ; SIP connection

exten => 7010,1,NoOp(a marcar…)
same => n,Macro(standardextensiondial,7000,SIP/ext7000) ; SIP connection

With the solution given by jcolp works but only after the destination answers the call.

Best Regards,

Jose

What about if you move the connectedline right before going into the macro?

Like this:
exten => 7000,1,NoOp(a marcar…)
same => n,Set(CONNECTEDLINE(all,i)=“Joe Black <${EXTEN}>”)
same => n,Macro(standardextensiondial,7000,SIP/ext7000) ; SIP connection

By the way macros are deprecated you should use sub routine instead.

Hi!!
Thanks for your reply, but didnt work.
Didnt saw any name on either display.

asterisk*CLI>
== Using SIP RTP CoS mark 5
– Executing [7020@National_Access:1] Goto(“SIP/ext7010-00000018”, “phones,7020,1”) in new stack
– Goto (phones,7020,1)
– Executing [7020@phones:1] NoOp(“SIP/ext7010-00000018”, “a marcar…”) in new stack
– Executing [7020@phones:2] Set(“SIP/ext7010-00000018”, “CONNECTEDLINE(all,i)=“Joe Sec <7020>””) in new stack
– Executing [7020@phones:3] Macro(“SIP/ext7010-00000018”, “standardextensiondial,7020,SIP/ext7020”) in new stack
– Executing [s@macro-standardextensiondial:1] Set(“SIP/ext7010-00000018”, “temp=”) in new stack
– Executing [s@macro-standardextensiondial:2] NoOp(“SIP/ext7010-00000018”, “CheckCallForward”) in new stack
– Executing [s@macro-standardextensiondial:3] GotoIf(“SIP/ext7010-00000018”, “?:Check-BusyFWD,1”) in new stack
– Goto (macro-standardextensiondial,Check-BusyFWD,1)
– Executing [Check-BusyFWD@macro-standardextensiondial:1] NoOp(“SIP/ext7010-00000018”, “CheckBusyFWD”) in new stack
– Executing [Check-BusyFWD@macro-standardextensiondial:2] NoOp(“SIP/ext7010-00000018”, “CheckCallForwardBusy”) in new stack
– Executing [Check-BusyFWD@macro-standardextensiondial:3] Set(“SIP/ext7010-00000018”, “temp=”) in new stack
– Executing [Check-BusyFWD@macro-standardextensiondial:4] GotoIf(“SIP/ext7010-00000018”, “?:Check-noanFWD,1”) in new stack
– Goto (macro-standardextensiondial,Check-noanFWD,1)
– Executing [Check-noanFWD@macro-standardextensiondial:1] NoOp(“SIP/ext7010-00000018”, “ChecknoanFWD”) in new stack
– Executing [Check-noanFWD@macro-standardextensiondial:2] NoOp(“SIP/ext7010-00000018”, “CheckCallForwardNoan”) in new stack
– Executing [Check-noanFWD@macro-standardextensiondial:3] Set(“SIP/ext7010-00000018”, “temp=”) in new stack
– Executing [Check-noanFWD@macro-standardextensiondial:4] GotoIf(“SIP/ext7010-00000018”, “?:No-Forward,1”) in new stack
– Goto (macro-standardextensiondial,No-Forward,1)
– Executing [No-Forward@macro-standardextensiondial:1] NoOp(“SIP/ext7010-00000018”, “Dial extension”) in new stack
– Executing [No-Forward@macro-standardextensiondial:2] Verbose(“SIP/ext7010-00000018”, “3,The state of SIP/ext7020 is NOT_INUSE”) in new stack
– The state of SIP/ext7020 is NOT_INUSE
– Executing [No-Forward@macro-standardextensiondial:3] Dial(“SIP/ext7010-00000018”, “SIP/ext7020,240”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/ext7020
– SIP/ext7020-00000019 is ringing
– SIP/ext7020-00000019 answered SIP/ext7010-00000018
– Channel SIP/ext7020-00000019 joined ‘simple_bridge’ basic-bridge <39447982-1ab2-48e1-a94e-8da5c42fcdf5>
– Channel SIP/ext7010-00000018 joined ‘simple_bridge’ basic-bridge <39447982-1ab2-48e1-a94e-8da5c42fcdf5>
– Channel SIP/ext7020-00000019 left ‘native_rtp’ basic-bridge <39447982-1ab2-48e1-a94e-8da5c42fcdf5>
– Channel SIP/ext7010-00000018 left ‘native_rtp’ basic-bridge <39447982-1ab2-48e1-a94e-8da5c42fcdf5>
== Spawn extension (macro-standardextensiondial, No-Forward, 3) exited non-zero on ‘SIP/ext7010-00000018’ in macro ‘standardextensiondial’
== Spawn extension (phones, 7020, 3) exited non-zero on ‘SIP/ext7010-00000018’

Best Regards,

Jose

I tested the connectedline function on 3 different phones (Aastra,Cisco,Polycom) and it is working.
However. it is not working with my softphone (Phoner,Zoiper).
I’m running out of ideas…

It’s up to the phone to support it. We can’t force a phone to do something it can’t or won’t.

1 Like

Yeah, I guess I wonder what they call this feature…

Thanks all for your great help.

I’m using Grandstream GXP2124 and GXP1405.

For the moment is ok; there is the small issue that the user who dials dont see the name before the other side answers.

I will try to set another solution (maybe ldap name search) but I want not to be dependent of the phone behavior regarding external database search and so on; as long I cal work only with asterisk, fine by me :slight_smile:

Best Regards,
Jose