How to construct dialplan?

How to construct dialplan for PJSIP trunk to send a call as
From: anonymous
PAI: realNumber ?

From my observation PAI is getting directly from CALLERID.

Why would you want to do this? The normal reason for putting caller ID in PAI is that From: has to be the account name. The normal reason for having “anoymous”, is because you don’t want people to know who is calling.

Also, what is the difference between “real number” and “caller ID”. If enabled, PAI will use the caller ID, but the caller ID can be manipulated, using the CALLERID() function.

My SIP provider required from me that behavior for calls which have to hided ID. So called party see ‘anonymous’ but provider have knowledge real ID

That’s weird. The normal requirement is that the real (account) ID goes in From and the purported ID, goes in PAI, i.e. the opposite of what you are saying.

Asterisk supports the normal ways, but the only way I can see of handling your strange way is by having two different end points, for outgoing calls, or by faking PAI with add header type functions, although I’d normally advise against trying to set any header that Asterisk uses.

Have you idea how to remove the “number” from PAI? Below is INVITE packet which I send to my provider

P-Asserted-Identity:  "number" <sip:+48number@remoteIP>

If you mean the name, CALLERID(name).

However, if they are only using PAI to identify the account, why does it matter? They still have to handle the general syntax.

because sometimes i have name without prefix sometimes with prefix, so if I delete that part i will have less problems with calls

ok, so how properly hide a caller ID with dialplan? But still I need to send PAI to operator

How do you obfuscate the From header:

Have two end points defined, one with a from user setting with the obfuscated value and one without. Select which one to use depending on whether or not you want the From header obfuscated. When using the obfuscated one, still set CALLERID(num) to the account name.

However, this whole arrangement is so strange that I think you really need to double check with your provider as to what they require.

my operator will send my calls with presentation which is get from From field, so I can put here number or anonymous but he still need PAI with real number of caller (the part who start calls)

I understood that, but it isn’t how SIP is supposed to be used, which is why it is difficult to get the client to support it.

Given that manipulating the caller ID at all is something you are more likely to do from a PABX, than a phone, and Asterisk is widely used, I’d suggest asking the provider for their standard Asterisk configuration.

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