Detecting Zap-channel DTMF in C


This is a C-code problem. I am writing some special code for
handling SIP/MESSAGES and handling of DTMF tone on ZAP.

Asterisk version:

[ul]1. SIP/MESSAGE comes in[/ul]
[ul]2. Message content parsed in channels/chan_sip.c [i]reveive_message/i[/ul]
[ul]3. Depending on the message content I want to :
[list]a) If the Zap-channels has not been called
before (SIP/INVITE), call a number on a
Zap channel or group. This has been solved
by using ast_request_and_dial(…)[/ul]

[ul]b) Collect DTMF digits from the dialied Zap channel,
	The called ZAP reciever will send some 
	DTFM digits when it answers the call.[/ul]

I have no problems with the above scenario, when the caller (SIP-sender)
makes an INVITE and then sends the MESSAGE. In that case we have a
bridged connection between ZAP and SIP channels until either
of them disconnects.

My way of hooking into the DTMF-tone detection on the ZAP-side is to
check the DTMF tome coming in on channels/chan_sip.c sip_senddigit_end(…)

My problem:
Sometimes the caller (the SIP sender) doesn’t start a dialog
(ie doesn’t send any INVITE). It just sends a SIP/MESSAGE.
In this case I have to dial the ZAP number from my code.
I’m using ast_request_and_dial(…) and gets a connection ok.
But when the called Zap receiver sends DTMF I never gets them
as my “dtmf-parser-hook” is in channels/chan_sip.c sip_senddigit_end(…), and I don’t not have any bridged SIP-channel in this case.

How do I get the DTMF-tones from a called ZAP-channel without have
any bridged SIP-channels?

Many thanks
Roland Strålberg
roland @