Re: [asterisk-users] Parsing custom SIP headers

2009-12-01 Thread Alex Balashov
Steve Howes wrote:

> On 1 Dec 2009, at 09:20, Benny Amorsen wrote:
>> I do believe that we have run out of brackets...
> 
> Could always do it vertically and useV and ^  ;)

And before you know it, we'll be here:

http://www.catonmat.net/blog/secret-perl-operators/

:)

-- 
Alex Balashov - Principal
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct  : (+1) (678) 954-0671

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Parsing custom SIP headers

2009-12-01 Thread Steve Howes

On 1 Dec 2009, at 09:20, Benny Amorsen wrote:
> I do believe that we have run out of brackets...

Could always do it vertically and useV and ^  ;)

S

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Parsing custom SIP headers

2009-12-01 Thread Benny Amorsen
Philipp Kempgen  writes:

> Just to be sure: Is there a dialplan function in Asterisk that
> parses custom "name-addr"-style SIP headers for me?

No.

> so I guess SIP_PARSE_HEADER() would need an index argument, just
> like SIP_HEADER().

Yes, Asterisk array handling leaves a bit to be desired as well. A good
start would be first class arrays in the dial plan, but that would
probably involve adding another type of brackets, and I do believe that
we have run out of brackets...


/Benny


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Parsing custom SIP headers

2009-11-30 Thread Philipp Kempgen
Leif Madsen schrieb:
> Philipp Kempgen wrote:
>> Just to be sure: Is there a dialplan function in Asterisk that
>> parses custom "name-addr"-style SIP headers for me?
> 
> Try this:  https://issues.asterisk.org/view.php?id=16268

Thanks but I don't see the connection.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  ->  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 ->  http://www.amoocon.de
-- 

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Parsing custom SIP headers

2009-11-30 Thread Leif Madsen
Philipp Kempgen wrote:
> Just to be sure: Is there a dialplan function in Asterisk that
> parses custom "name-addr"-style SIP headers for me?

Try this:  https://issues.asterisk.org/view.php?id=16268

Leif Madsen.

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Parsing custom SIP headers

2009-11-29 Thread Philipp Kempgen
Hi,

Just to be sure: Is there a dialplan function in Asterisk that
parses custom "name-addr"-style SIP headers for me?

If I wanted to do it right the syntax
name-addr *(SEMI generic-param)
is quite complex to parse in the dialplan using nothing but CUT().
It's so easy to make false assumtions about angle brackets (< >),
whitespace (LWS), quotes (") around the display-name, character
escaping etc. All of the applications of CUT() I have seen are
way too simplistic.

Example of how it could work:
Set(addr=${SIP_PARSE_HEADER(${SIP_HEADER(P-Asserted-Identity)},addr-spec)});

Interesting parts include:
name-addr, display-name, addr-spec, scheme, userinfo, user,
telephone-subscriber, host, hostname, port, ...

Actually headers like P-Asserted-Identity can even have more then
one value.
---cut---
  PAssertedID = "P-Asserted-Identity" HCOLON PAssertedID-value
  *(COMMA PAssertedID-value)
  PAssertedID-value = name-addr / addr-spec
---cut---
so I guess SIP_PARSE_HEADER() would need an index argument, just
like SIP_HEADER().

Proper parsing could be done in an AGI() script of course but that
involves a big overhead especially since the code to parse name-addr
is already in Asterisk. It's just not available in the dialplan.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  ->  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 ->  http://www.amoocon.de
-- 

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users