[asterisk-dev] enhancing the usbb2k patch

Sam Liddicott sam at liddicott.com
Wed Feb 18 09:58:49 CST 2009


I want to extend Richard Taylors patch for asterisk 1.6 (here 
http://www.artaylor.co.uk/usbb2k.html)
which allows my yealink usb-b3g "skype forwarder" to work with asterisk.
The device works as a USB ALSA sound card with some USB controls which can:

1. connect the FXS to either the FXO or the USB sound card using a relay
2. when in USB mode, join the FXO and FXS
3. ring the FXS

Currently his patch supports the FXS side of the device and treats the 
attached analogue telephone as a Phone type channel (which incidentally 
conflicts with chan_phone.so) so that the telephone can be used to make 
calls via asterisk. It also supports key-pad activated pass-through so 
that the phone is directly connected to the PSTN.

I want to extend the patch to support the FXO side so that the PSTN side 
of these yealink devices can be used by asterisk to receive or place 
calls via the PSTN.

The one complication is that the FXS and FXO sides are not fully 
independent - there being only one sound card between them. This may 
break the ideal asterisk model somewhat, but will not actually break the 
expectations of the user of such a device.

In such a case, the telephone will hardly be used, and if it is picked 
up it will be with the intention to listen in or intercept any active 
calls on the line - which is what will happen anyway.

Certainly I ought to be able to treat it purely as an FXO, although some 
combination of FXS/FXO is possible...

These restrictions must, of course, apply...
1. if the FXS is in use, then the FXO will be unavailable to make calls.
1a. Unless asterisk wishes to use the FXO to place a call on behalf of 
the FXS in which case it can dial and then join FXS to FXO (or click the 
relay) - or generally unless the FXS and FXO are participating in the 
same call.  Asterisk will not need to forward audio between the FXS and FXO

2. if there is an incoming call on the FXO then the FXS cannot be used
2a unless asterisk wishes to attach the FXS to the incoming call, using 
the same means as above

3. asterisk cannot process any incoming calls on the FXO PSTN if the FXS 
handset is in use. It will get the ring notification but should not answer.

However I'm not too worried about case 1a and 2a to start with, I'll be 
happy just to get the FXO working alone with pass-through support for 
the real handset.

So my first question is:
 Does it matter what channel type I register the channel as?

Currently the patch registers as channel type "Phone" but it seems like 
only one channel of a given type can be registered as this conflicts 
with chan_phone.so

Sam



More information about the asterisk-dev mailing list