[asterisk-users] "automatic call bridging when destination is available" feature

Vieri rentorbuy at yahoo.com
Sat Mar 14 05:12:34 CDT 2009


Hi,

I'd like to implement the following:

Extension 101 calls 102 but 102 is busy and has no voicemail so 101 is sent to a custom IVR that says something like "extension $EXTEN is $DIALSTATUS. Please try again later or dial $CODE now to notify you as soon as $EXTN is available.".

So the "notification" part is what I'm trying to figure out.

The extensions are SIP (but not all have displays) and I would like to do more than just  a sendtext() when the hint of SIP/102 changes. Besides, the SIP protocol doesn't seem to allow me to query the "real" availability of an extension unless I invite it and ring it (OPTIONS doesn't tell me if DND is set on the "client's side" - especially on softphones).

So what I would prefer to do is a two-step call bridging of 102 (dst) with 101 (src):

1) periodically check via events (until globally-set timeout) via hints/ExtensionState that both dst and src are "available"/not in use.

2) when 1) is true then "originate" two simultaneous calls to both dst and src (or maybe just one call to dst). Upon answered, the originated calls should say something like "Automatic call bridging service: please wait while we connect $SRC to $DST". At this point extensions src and dst should be able to talk.

I was thinking of making a call file just for extension dst and send it to a context which Dial()'s extension src. It could happen that extension src suddenly switches to "uanvailable" or "DND on the client's side" or "busy" right when the context the dst extension is sent to (via call file) tries to Dial(SIP/src). In that case, if DIALSTATUS is anything but ANSWERED then the "Automatic call bridging service" would have to say to extension dst something like "Sorry, failed to connect. Will try again later".

Anyway, instead of starting to implement my custom solution, I would like to know if such a "service" already exists or if someone could share their thoughts. I know that some legacy PBX already have this but I don't know how they call it. Usually, when a caller finds a busy destination, they can dial *6 and the PBX will take care of bridging the two extensions as soon as both are "free".

Can Asterisk already do this? Or is there a simple way of implementing it?

Thanks,

Vieri



      



More information about the asterisk-users mailing list