[Asterisk-Users] Changing caller id on transfer

Joseph Tanner joseph at thetechguide.com
Thu Mar 2 13:43:06 MST 2006


Hrm, well it depends exactly how you're transferring calls as to how
you'd write it in extensions.conf.  Is it being transferred to an
internal line or to an external line?  If external, then of course you
need to be able to set the outgoing callerid (you'd basically be
spoofing it, but that shouldn't be an issue).

I have done something similar, but not exactly like what you're
wanting.  I'm not sure what the best way to do it would be.  Perhaps
you could set the callerid early in asterisk in a variable (name it
something like, ${OUTGOINGCALLERID}).  Before making an outgoing call,
check asterisk's built-in callerid variable, if it's empty then set it
to your special variable.  If it's not empty, then use it (so a normal
outgoing call wouldn't already have callerid set, and would use your
value, but if an incoming call came in then the callerid variable
would be set, and we'd use that instead).

The way I did it would require that a user start off in a different
context based on whether they're receiving a call, or making an
outgoing call.  Perhaps you can check for a flash, or make them dial a
special extension to make an outgoing, transferred call?  I dunno, my
setup's unique and I'm not sure how you can adapt it to your needs. 
Anyways, if you can get them in a different context, then it's simple.
 In your normal outgoing context, the very first line should be what
sets the callerid.  In the special incoming then outgoing context, do
something like this:

exten => _1NXXNXXXXXX,8,Goto(cell-out,${EXTEN},2)

In this case, _1NXXNXXXXXX is the extension matched when I dial a
normal long-distance number (such as 1-931-555-1212).  It jumps to the
[cell-out] context (can name this anything you want, this is just my
setup with calling out via bluetooth), it keeps the extension the same
(so in [cell-out] we would need an extension of _1NXXNXXXXXX), and
goes to priority 2.  This bypasses the first priority, which is where
you set callerid for regular outgoing calls, so now you'll use the
existing value for the outgoing callerid, instead of changing it.

You could just as easily recreate your dialplan for outgoing calls
that are transferred, but I prefer to jump to an existing context,
that way I only have to change one part of extensions.conf.  I know
that if I can make a long-distance call from a local extension, then
it'll work when someone calls in and gets bridged, because the code is
exactly the same except for setting callerid.

Hope that helps more than it confuses.

Joseph Tanner

On 3/2/06, Cosmin Prund <cosmin at adicomsoft.ro> wrote:
> As usual, this is most likely a easy question, but here it goes any way:
>
> How can I change the caller id on a transferred call so the called party
> knows the call has been transferred from a colleague and it's not coming
> directly from our outside lines?
>
> The story goes like this:
> 1) Client calls. All phones ring.
> 2) Someone picks up the phone.
> 3) The phone gets transferred to someone.
> 4) The person that gets the transferred call sees the original caller id and
> doesn't know the call has been transferred. I'd like the person that gets
> the transfer to see the caller id with a digit prefix. Ex: Original
> caller-id: 0269123456; Caller id if the call has been transferred:
> 1*0269123456
>
> I know I can use SetCallerId(1*${CALLERIDNUM}) but how do I know I'm doing a
> transfer and not calling someone?
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>



More information about the asterisk-users mailing list