Remove plus + sign (+7000 to 7000) from external calling

Hello guys:

I am very new to pbx, so please excuse me if I say anything stupid below.
My FreePBX currently setup with another SIP system. When the request incoming, log as below
From: <sip:201 @. xxxxx>;tag=gK08061f3e
To: <sip:+7000 @. xxxxx>;tag=a968c9f3-683a-4ddf-b67e-95672966d819

I have an extension setup as 7000, since the incoming request is +7000, obviously it does not exist. Is there a way I can remove the + sign here when external system sends + even for internal extension calling?

Thank you very much!

One option is to set SIP Alias for extension 7000 to
+7000
and the call should then be accepted. If you have many extensions, you could use Bulk Handler to set them up.

Another approach is custom dialplan to delete the +. For example, add to /etc/asterisk/extensions_custom.conf

[from-internal-plus]
exten => _.,1,goto(from-internal,${EXTEN:1},1)

then change Context for your trunk from from-internal to from-internal-plus.
This just deletes the first character from all destinations received by the trunk. You may need something more complex to deal with external calls, emergency calls, etc.

1 Like

When using the standard initial contexts, FreePBX does not use the To: header; it uses the request URI, the one immediately after “INVITE”. If that is the same as the one in the To: header, the previous replies are still valid.

1 Like

Thank you Stewart1.
Does the alias solution work for legacy chan_sip as well? Or just for pjsip?
And the alias should be created under Misc application?

Thank you again

SIP Alias is an Advanced setting for the extension, available for both pjsip and chan_sip.

However, if you’re setting up a new system, there is probably no reason to create anything with chan_sip.

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