[asterisk-dev] Re: Read custom SIP header from Manager API?

Tony Mountifield tony at softins.clara.co.uk
Thu Mar 22 04:48:57 MST 2007


In article <46025C64.4030901 at tedsoft.de>,
Sven Jacobs <jacobs at tedsoft.de> wrote:
> Dear Asterisk developers,
> 
> I'm currently writing an application which displays incoming calls in a 
> popup window. The application connects to an Asterisk 1.4 server via the 
> Manager API and listens for dial events.
> 
> On the Asterisk side I want to enrich the SI protocol with an additional 
> custom header which contains, for example, the extension which has been 
> dialed by using the SIPAddHeader() command in the dial plan.
> 
> The client application should display the following information on an 
> incoming call:
> 
> From: <CALLERID(name)>
> Number: <CALLERID(num)>
> To: <X-CUSTOMHEADER(extension)>
> Date: <NOW>
> 
> The question is whether it's possible to extract custom headers from the 
> Manager API? The dial event does not contain such information.

Look at the UserEvent dialplan application, e.g.

exten => _X.,n,UserEvent(SIP|SIPHdr: ${YOURSIPHEADER})

You would probably put this just before your Dial() statement.

Then you could watch for this event over the AMI and store the header
against the channel.

Hope this helps.

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org


More information about the asterisk-dev mailing list