[asterisk-bugs] [JIRA] (ASTERISK-28761) Assigning CallerIDNum from DNIDDigits to chan_pjsip

Kevin Harwell (JIRA) noreply at issues.asterisk.org
Tue Mar 3 13:15:25 CST 2020


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249880#comment-249880 ] 

Kevin Harwell commented on ASTERISK-28761:
------------------------------------------

For the caller ID number _app_dumpchan_ first checks to see if a "valid" caller id number is available for the channel. If so it uses that, otherwise it writes "N/A". So if you want that value written there you'd have to make sure no caller id number was present (or invalid).

However in your scenario if the caller id number is invalid then _app_queue_ tries to "guess" and fill it in. Here's the [section of code|https://github.com/asterisk/asterisk/blob/master/apps/app_queue.c#L4533] doing that:
{noformat}
	if (!ast_channel_caller(tmp->chan)->id.number.valid) {
		if (ast_channel_connected(qe->chan)->id.number.valid) {
			struct ast_party_caller caller;

			ast_party_caller_set_init(&caller, ast_channel_caller(tmp->chan));
			caller.id = ast_channel_connected(qe->chan)->id;
			caller.ani = ast_channel_connected(qe->chan)->ani;
			ast_channel_set_caller_event(tmp->chan, &caller, NLL);
		} else if (!ast_strlen_zero(ast_channel_dialed(qe->chan)->number.str)) {
			ast_set_callerid(tmp->chan, ast_channel_dialed(qe->chan)->number.str, NULL, NULL);
		} else if (!ast_strlen_zero(S_OR(ast_channel_macroexten(qe->chan), ast_channel_exten(qe->chan)))) {
			ast_set_callerid(tmp->chan, S_OR(ast_channel_macroexten(qe->chan), ast_channel_exten(qe->chan)), NULL, NULL);
		}
		tmp->dial_callerid_absent = 1;
	}
{noformat}
You can see if the number part is invalid then it first tries to use the connected line information. Barring that it tries to use the dialed channel info, which is the case here.

You'd have to find a way to invalidate the number after this part (I'm not sure if that's possible), but before dumping the channel. Or just specify "N/A" for the caller id number maybe.

Otherwise I don't think it can be done without a code change.

> Assigning CallerIDNum from DNIDDigits  to chan_pjsip
> ----------------------------------------------------
>
>                 Key: ASTERISK-28761
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28761
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_pjsip
>    Affects Versions: 16.8.0
>         Environment: CentOS 7
> Asterisk 16.8 (src)
>            Reporter: Vyrva Igor
>            Severity: Minor
>
> If the channel that responds to the Dial/Queue (dstchannel) call is running on chan_pjsip for it, the CallerIDNum parameter takes the value from the DNIDDigits parameter of the call Initiator (channel)
> Channel:
> {code}
> Name= SIP/423-00000031
> Type= SIP
> UniqueID= 1582885712.361
> LinkedID= 1582885712.361
> CallerIDNum= 423
> CallerIDName= AP-423
> ConnectedLineIDNum= (N/A)
> ConnectedLineIDName=(N/A)
> DNIDDigits= 300
> {code}
> Dstchannel:
> {code}
> Name= PJSIP/666-00000003
> Type= PJSIP
> UniqueID= 1582885712.364
> LinkedID= 1582885712.361
> CallerIDNum= 300
> CallerIDName= (N/A)
> ConnectedLineIDNum= 423
> ConnectedLineIDName= AP-423
> DNIDDigits= (N/A)
> {code}
> However, if the meeting works in chan_sip that happens
> Channel
> {code}
> Name= SIP/423-00000036 
> Type= SIP 
> UniqueID= 1582896505.420 
> LinkedID= 1582896505.420 
> CallerIDNum= 423 
> CallerIDName= AP-423 
> ConnectedLineIDNum= (N/A) 
> ConnectedLineIDName=(N/A) 
> DNIDDigits= 300
> {code}
> Dstchannel
> {code}
> Name= SIP/422-00000037 
> Type= SIP 
> UniqueID= 1582896505.423 
> LinkedID= 1582896505.420 
> CallerIDNum= (N/A) 
> CallerIDName= (N/A) 
> ConnectedLineIDNum= 423 
> ConnectedLineIDName=AP-423 
> DNIDDigits= (N/A)
> {code}
> If, before making a call, we delete the information from DNIDDigits, then for PJSIP we get in CallerIDNum=${EXTEN} from which the Dial/Queue is made
> Channel
> Executing [anonym11 at test-line:10] Set("SIP/423-00000038", "CALLERID(dnid)= ") in new stack
> {code}
> Name= SIP/423-00000038 
> Type= SIP 
> UniqueID= 1582896895.436 
> LinkedID= 1582896895.436 
> CallerIDNum= 423 
> CallerIDName= AP-423 
> ConnectedLineIDNum= (N/A) 
> ConnectedLineIDName=(N/A) 
> DNIDDigits= (N/A)
> {code}
> Dstchannel
> {code}
> Name= PJSIP/666-00000006 
> Type= PJSIP 
> UniqueID= 1582896895.439 
> LinkedID= 1582896895.436 
> CallerIDNum= anonym11 
> CallerIDName= (N/A) 
> ConnectedLineIDNum= 423 
> ConnectedLineIDName=AP-423 
> DNIDDigits= (N/A)
> {code}
> Is it really a bug or is it specifically made this way?
> If specifically-how to disable it?



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list