Ticket #5766 (new Feature Requests)

Opened 1 year ago

Last modified 1 year ago

Macro dialout-trunk clears CALLERID(number) when failing through to other trunks

Reported by: athoik Assigned to: p_lindheimer
Priority: minor Milestone: 2.11
Component: Core - Trunks/Routing Version: 2.8-branch
Keywords: callerid, ampuser Cc:
Confirmation: Need testing Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

Macro dialout-trunk clears CALLERID(number) when failing through to other trunks if the call is routed from one trunk to another.

The Asterisk is used to connect two sites and route the calls between them.

Site A <---> Asterisk <---> Site B

Trunks from Site A or B to Asterisk have context=from-internal.

Outbound Routes from Asterisk to the Sites have more than one trunk (using trunk sequence).

When one trunk fail Asterisk will try other trunks executes the following:

exten => continue,n(noreport),Noop(TRUNK Dial failed due to ${DIALSTATUS} HANGUPCAUSE: ${HANGUPCAUSE} - failing through to other trunks)
exten => continue,n,Set(CALLERID(number)=${AMPUSER})

But ${AMPUSER} is empty causing the CALLERID(number) to be cleared. Adding an ExecIf? to check if ${AMPUSER} is not empty solves the problem.

exten => continue,n,ExecIf($["${AMPUSER}" != ""]?Set(CALLERID(number)=${AMPUSER}))

Attachments

callerid.log (18.1 kB) - added by athoik on 04/07/12 15:17:10.
macro-dialout-trunk clears CALLERID(number) when failing through to other trunks
callerid_from_local.txt (18.9 kB) - added by athoik on 04/08/12 06:59:40.
macro-dialout-trunk from local extension
callerid_intra_company.log (14.3 kB) - added by athoik on 04/08/12 13:16:31.
macro-dialout-trunk intra-company route
callerid_set_var_keepcid_true.log (18.4 kB) - added by athoik on 04/08/12 13:17:15.
macro-dialout-trunk set var keepcid true

Change History

04/07/12 15:17:10 changed by athoik

  • attachment callerid.log added.

macro-dialout-trunk clears CALLERID(number) when failing through to other trunks

04/07/12 18:36:45 changed by p_lindheimer

  • confirmation changed from Unreviewed to Need Feedback.

Questions:

  • are you running in extensions mode or deviceanduser mode?
  • is the call being initiated by an extensions and does the trace you added represent the first instruction from the call attempt?
  • does the phone being used to make the call have a user logged in to it or is it a device with no user

These are the suspect lines in the trace:

[Apr  6 07:13:32] VERBOSE[19414] pbx.c:     -- Executing [s@macro-user-callerid:4] Set("SIP/siteA-00000068", "AMPUSER=") in new stack
6	[Apr  6 07:13:32] VERBOSE[19414] pbx.c:     -- Executing [s@macro-user-callerid:5] Set("SIP/siteA-00000068", "AMPUSERCIDNAME=") in new stack

They seem to indicate that the call is being made from a device with no user logged in. Please clarify on these questions and any other relevant information that may come to mind in looking at this.

04/08/12 06:58:07 changed by athoik

The asterisk is only used to pass calls from one site to another.

Site A <---> Asterisk <---> Site B

Site A is a Cisco Call Manager PBX and Site B is a Avaya PBX.

The Asterisk has no extensions or users at all, it does only routing between two sites.

SiteA Peer Details are the following:

[siteA] ;(SIP)
host=IP_ADDRESS_OF_SITE_A
qualify=yes
type=friend
disallow=all
allow=ulaw&alaw
insecure=very
canreinvite=no
context=from-internal

SiteB peer details are the following:

[siteB] ;(SIP) 
host=IP_ADDRESS_OF_SITE_B
qualify=yes
type=friend
transport=tcp
context=from-internal

[siteBH323] ;(H323 using ooh323)
type=friend
context=default
host=IP_ADDRESS_OF_SITE_B ; IP Address of your CLAN
port=1720; port used to connect on CLAN it could be some others port regarding your configuration in signalling group.
disallow=all
allow=ulaw
canreinvite=no

Calls between the sites are working perfectly, the only problem is that CALLERID(number) is getting empty when failing through to other trunks, currently i have overridden the macro in extensions_override_freepbx.conf

The above is not happening for extensions inside Asterisk. I did a test with extension 8002 and the CALLERID(number) gets the value of the AMPUSER. Although this was only for testing purposes, log file from Asterisk extension calling Site B is also attached.

04/08/12 06:59:40 changed by athoik

  • attachment callerid_from_local.txt added.

macro-dialout-trunk from local extension

04/08/12 07:36:13 changed by p_lindheimer

  • confirmation changed from Need Feedback to Need testing.

Can you please try adding the following setting to your [siteA] sip configuration:

setvar=KEEPCID=TRUE

04/08/12 07:44:49 changed by p_lindheimer

Please run another test as well. With your current settings (no KEEPCID=TRUE), set your route to an Intra-Company trunk and test it. Once you've done that though, set it back how you had it (even if that fixes your issue) and test with the KEEPCID=TRUE change above and report back how that affects it.

04/08/12 13:15:10 changed by athoik

Both test were run and i am attaching the log files.

Using the Intra-Company i believe it makes no difference.

...
[Apr  8 14:56:27] VERBOSE[29144] pbx.c:     -- Executing [s@macro-user-callerid:19] Set("SIP/siteA-00000002", "CALLERID(number)=7000") in new stack
[Apr  8 14:56:27] VERBOSE[29144] pbx.c:     -- Executing [s@macro-user-callerid:20] Set("SIP/siteA-00000002", "CALLERID(name)=site A User") in new stack
...
[Apr  8 14:56:28] VERBOSE[29144] pbx.c:     -- Executing [continue@macro-dialout-trunk:4] Set("SIP/siteA-00000002", "CALLERID(number)=") in new stack
...

Using the set variable KEEPCID it seems to make a difference, but i have the feeling that i am loosing the CALLERID(name) this way.

...
[Apr  8 15:23:02] VERBOSE[29345] pbx.c:     -- Executing [s@macro-user-callerid:19] Set("SIP/siteA-00000006", "CALLERID(number)=7000") in new stack
[Apr  8 15:23:02] VERBOSE[29345] pbx.c:     -- Executing [s@macro-user-callerid:20] Set("SIP/siteA-00000006", "CALLERID(name)=site A User") in new stack
...
[Apr  8 15:23:02] VERBOSE[29345] pbx.c:     -- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/siteA-00000006", "1?Set(CALLERID(all)=7000)") in new stack
...
[Apr  8 15:23:02] VERBOSE[29345] pbx.c:     -- Executing [continue@macro-dialout-trunk:4] Set("SIP/siteA-00000006", "CALLERID(number)=") in new stack
...
[Apr  8 15:23:02] VERBOSE[29345] pbx.c:     -- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/siteA-00000006", "1?Set(CALLERID(all)=7000)") in new stack

I run the tests remotely so tomorrow i will know for sure if the set var is working.

Using the CALLERID(all)=7000 will clear the CALLERID(name) correct?

04/08/12 13:16:31 changed by athoik

  • attachment callerid_intra_company.log added.

macro-dialout-trunk intra-company route

04/08/12 13:17:15 changed by athoik

  • attachment callerid_set_var_keepcid_true.log added.

macro-dialout-trunk set var keepcid true

04/09/12 02:42:10 changed by athoik

I run the test again (localy) and the results show on the logs are confirmed.

Using Intra-Company makes no diffence. The CALLERID(number) clears when failing through to other trunks.

Using the KEEPCID variable makes a difference, but is not the desired result. Using the CALLERID(all) we clear this time the CALLERID(name).