[asterisk-dev] dial url with sip

Matthew Jordan mjordan at digium.com
Mon Jun 2 07:39:54 CDT 2014


On Mon, Jun 2, 2014 at 3:39 AM, Dennis Guse <dennis.guse at qu.tu-berlin.de> wrote:
> If you are in control of the SIP-Phone, you could pass additional
> information via SIPAddHeader in your dialplan.
>
> On Jun 2, 2014 10:33 AM, "James Cloos" <cloos at jhcloos.com> wrote:
>>
>> Looking at app_dial.c and chan_sip.c, I get the impression that the url
>> in a dial string cannot get sent as part of the sip INVITE, yes?
>>
>> (I base that on sip_sendhtml().)

That is incorrect. The sip_sendhtml callback will update the url
stringfield on the SIP pvt. It then transmits a re-INVITE via
transmit_reinvite_with_sdp.

The url attribute is added to the outgoing request in the "Access-URL" header:

    if (!ast_strlen_zero(p->url)) {
        add_header(resp, "Access-URL", p->url);
        ast_string_field_set(p, url, NULL);
    }

>> Am I reading chan_sip correctly?  Will I need to change sip_sendhtml()
>> to send the url as part of the INVITE?
>>
>> A test call shows no url is sent.

"Test call" doesn't tell us much. Is the Access-URL header added to an
outgoing re-INVITE?

>> (I also see that in 12 and trunk chan_pjsip does not have a send_html
>> entry in its chan_pjsip_tech structure, and is therefore less capable.)

No, it is not less capable.

As Dennis pointed out, you can add whatever header you want to your
outgoing INVITE requests using SIPAddHeader or - in the PJSIP stack -
PJSIP_HEADER. That includes the Access-URL header, with whatever
contents you want.

The ability to add whatever header you want to your outbound INVITE
requests is a much more powerful abstraction then forcing a URL into a
specific header. The notion of the send_html channel callback most
likely predates the availability of these applications/functions.

>> My understanding is that some sip phones will fetch and display a url
>> when INVITEd, and I'd like to use that to show the callee more data
>> about the incoming call, such as the remote sip proxy/endpoint, the
>> details about the INVITEd number, et cetera.  In particular, I want to
>> do this will dials generated as a result of followme, queuesand the
>> like.
>>

Since this is device specific, you will need to investigate how the
phone wants to consume the information - that is, what header it wants
to extract the URL from.

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org



More information about the asterisk-dev mailing list