Forked or Parallel processes

As a result of receiving an incoming call, how can I make two outgoing calls in parallel with different CLID info.

The first call needs to call my office sip phone and present the CLID of the original caller.

The second call needs to call my cell phone and present the CLID of the number that the caller called rather than their own CLID.

I just need some form of branching, forking command.

Thanks in advance.

You dont want to make two outgoing calls, technically you want to establish a bridge initiated TO 2 external phones.

I mention it cause it is a huge diff.

If you want to use an incoming call as a “trigger” to make two (independent) calls outgoing, you would simply fire up a script on the incoming call, generating two callfiles.

But, since you want to ANSWER this incoming call (bridging when answered!), you cant set the CLID cause the dial to the outsidephones is made in one step, NO further processing possible after the DIAL command has been executed.

So what i would do IS, to “mark” the CLID with a prefix, appended by the original CLID.

Like 9999-REAL-ORIGINAL-CLID.

A script for that could be:
exten…conf:
General section:
JohnsHome=5556699
JohnsCell=0177589632

exten => 5554433,1,Set(newclid=9999-${CALLERID(number)})
exten => 5554433,2,Set(CALLERID(number)=${newclid})
exten => 5554433,3,Dial(Zap/g1/johnsCell&Zap/g1/JohnsHome)
exten => 5554433,4,Congestion
exten => 5554433,102,voicemail(bJohnsmailbox)
exten => 5554433,103,Congestion

That way, the call is forwarded to johns home and cellphone and the call is “identified” by a leading 9999-

I am using exactly this “trick” here in our company, where one guy has only a cheap wireless handset only capable to disply numbers.
Since there is a second “VIP” line routed on his phone, i indicate such calls with leading 9999- so he can SEE that this call is coming from the VIP line.

but using 9999 does not tell me which company (mine or my wifes) was called (it just gives me the CLI of the caller), as I would like to answer the phone accordingly.

if they are different inbound numbers, you’d have different extensions setup for each, so you could prepend your number with ‘9999’ and your wifes with ‘123’, or whatever you choose.

basically, you duplicate the code above for each inbound number.

[quote=“whoiswes”]if they are different inbound numbers, you’d have different extensions setup for each, so you could prepend your number with ‘9999’ and your wifes with ‘123’, or whatever you choose.

basically, you duplicate the code above for each inbound number.[/quote]

Exactly !

Can we have a BIT more selfcreativity please, marro ? :stuck_out_tongue:

You have everything you need:
The line the call came in…the line we want to go out.
Easy to “brand” each call individually now.

So please, do the happy dance for being clued into the genius tricks of asterisk…hehehe :laughing: :laughing:

Believe me I’m trying, but I think we are slightly at cross purposes.

when a call comes in I want to ring both my desk SIP phone and my cell phone.

I would like the outgoing calls placed to my cell phone to use a seperate CLI for my each of the DIDs we have ie

my company Sales,
my company accounts,
my company support
my personal DID etc

and the same for my wifes company

wifes company Sales
wifes company accounts,
wifes company support
wifes personal DID etc

BUT if I simply change the CLID of the outgoing call to my cell phone to the number of the DID that the caller called, I will no longer be able to see the callers CLID on my office SIP phone.

In short I am trying to show the originating callers CLID on my SIP phone AND at the same time call my cellphone showing the number that the caller called, this way I can use the address book functionality of my cell phone to give me the name of the department being called so that I can answer appropriately without having to resort to remembering what CLID prefix refers to which department.

You can also “Build” this info like i did in my example.

Simply fake the outgoing call to your phones to
exten+"-"+callerid(number)

That way the call would show on your phones like
Callednumber+Originatingnumber.

Im sorry, but i cant see any other way to do it.

[quote=“marro”]As a result of receiving an incoming call, how can I make two outgoing calls in parallel with different CLID info.

The first call needs to call my office sip phone and present the CLID of the original caller.

The second call needs to call my cell phone and present the CLID of the number that the caller called rather than their own CLID.

I just need some form of branching, forking command.

Thanks in advance.[/quote]

If I understand well what you want, that is possible to do something like this:

[context]
exten => 5554433,1,Dial(Local/fork-to-cell@context&Local/fork-to-home@context)
exten => 5554433,2,Hangup

exten => fork-to-cell,1,Set(CALLERID(number)=${newclid})
exten => fork-to-cell,2,Dial(Zap/g1/johnsCell)
exten => fork-to-cell,3,Hangup

exten => fork-to-home,1,Dial(Zap/g1/JohnsHome)
exten => fork-to-home,2,Hangup

It works fine for me…
Hope this helps.

WOOT !

Dial(Local/fork-to-cell@context&Local/fork-to-home@context)

is a little genius piece of code…it offers a great new way to have a call “multitasking” - cuz i can “misuse” one “leg” of the fork to do many more things then just dial…5 STARS !!

[quote=“RichardHH”]WOOT !

Dial(Local/fork-to-cell@context&Local/fork-to-home@context)

is a little genius piece of code…it offers a great new way to have a call “multitasking” - cuz i can “misuse” one “leg” of the fork to do many more things then just dial…5 STARS !![/quote]

I’m glad to see its useful for you :slight_smile:

BTW: I use it a lot and - like you wrote - not only for regular calling…

Have a nice day!