1
votes

Friendly greetings, everyone !

I set up two Asterisk boxes : one with 2000 to 2999 extensions, the other with 5000 to 5999 extensions. On both, I have SIP users : 2005 and 2025 on one, 5002 and 5025 on the other.

I set up an IAX trunk between the two, using Asterisk-GUI : on my trunks, the user's extensions are 2999 and 5999. The trunks are registered, everything is OK on this matter.

Let's say user SIP 2005 (on one side) wants to call user SIP 5002 (on the other side). I make the call, the call is normally relayed (I can join the other side) but, on 5002's phone, the displayed Caller ID is "2999" (trunk ID), which is bothersome.

Is there a way to keep the original Caller ID (so, in my example, 2005) and display it on 5002's phone ?

I consulted Asterisk's doc and voip-info.org, but I haven't found my answer as of yet.

2

2 Answers

0
votes

That mean you trunk have callerid= or fromuser= in definition. If you remove it, will be original callerid.

Also please note, you should use dial command with "o" flag when calling trunk.

o([x]): If <x> is not provided, specify that the CallerID that was
    present on the *calling* channel be stored as the CallerID on the *called*
    channel. This was the behavior of Asterisk 1.0 and earlier. If <x> is
    provided, specify the CallerID stored on the *called* channel. Note that
    o(${CALLERID(all)}) is similar to option o without the parameter.
0
votes

Not sure which version of Asterisk your using but you need to set the caller id in the dial plan. That way you can send whatever you like rather than being fixed to sending 1 caller ID for any call on that trunk.

In extensions.conf you should have something like this (taken from my conf)

[to_hq]
exten => _7900.,1,Set(CALLERID(num)=7000${CALLERID(num)})
exten => _7900.,2,Dial(IAX2/to_hq/${EXTEN:4})

In my config I dial 7900 to access the iax trunk then the remote ext I'm trying to reach. The caller id sends and displays on the remote phone as 7000xxxx where xxxx=the local ext I'm calling from.

7000 in my config is my local trunk code so that when I call a remote user they can call me back without having to dial the routing code.

The other side of the config on the remote node would look like this;

[to_me]
exten => _7000.,1,Set(CALLERID(num)=7900${CALLERID(num)})
exten => _7000.,2,Dial(IAX2/to_me/${EXTEN:4})