Re: [asterisk-users] Checking SIP Headers existence and content

2010-10-07 Thread Administrator TOOTAI
Le 05/10/2010 05:13, VoIP Question a écrit :
 Hello,

Hi


 I would like to verify if a specific SIP header exists, and if yes, 
 extract the partial content from another header.

 1. Is there a way to verify if a specific header exists?
 2. How do I extract data that is between the first : and the following 
 @? Specifically, The data looks like sip:1234567...@10.0.0.1:5060 
 http://sip:1234567...@10.0.0.1:5060 and I would like to get only 
 the 1234567890

Something like

exten = s,1,Set(__DIALEDNUMBER=${SIP_HEADER(TO):5})
exten = s,n,Set(__DIALEDNUMBER=${CUT(DIALEDNUMBER,@,1)})
exten = s,n,GotoIf($[${DIALEDNUMBER:0:1} != +]?numberIsOK)
exten = s,n,Set(__DIALEDNUMBER=${CUT(DIALEDNUMBER,+,2)})

Take a look here

http://www.voip-info.org/wiki/view/Asterisk+func+sip_header

voip-info.org should be in your favorites ;-)

-- 
Daniel

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] Checking SIP Headers existence and content

2010-10-07 Thread Jayson Baker
Favorites?  voip-info.org should be your homepage.

On Thu, Oct 7, 2010 at 9:26 AM, Administrator TOOTAI ad...@tootai.netwrote:

 Le 05/10/2010 05:13, VoIP Question a écrit :
  Hello,

 Hi

 
  I would like to verify if a specific SIP header exists, and if yes,
  extract the partial content from another header.
 
  1. Is there a way to verify if a specific header exists?
  2. How do I extract data that is between the first : and the following
  @? Specifically, The data looks like sip:1234567...@10.0.0.1:5060
  http://sip:1234567...@10.0.0.1:5060 and I would like to get only
  the 1234567890

 Something like

 exten = s,1,Set(__DIALEDNUMBER=${SIP_HEADER(TO):5})
 exten = s,n,Set(__DIALEDNUMBER=${CUT(DIALEDNUMBER,@,1)})
 exten = s,n,GotoIf($[${DIALEDNUMBER:0:1} != +]?numberIsOK)
 exten = s,n,Set(__DIALEDNUMBER=${CUT(DIALEDNUMBER,+,2)})

 Take a look here

 http://www.voip-info.org/wiki/view/Asterisk+func+sip_header

 voip-info.org should be in your favorites ;-)

 --
 Daniel

 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

[asterisk-users] Checking SIP Headers existence and content

2010-10-04 Thread VoIP Question
Hello,

I would like to verify if a specific SIP header exists, and if yes, extract
the partial content from another header.

1. Is there a way to verify if a specific header exists?
2. How do I extract data that is between the first : and the following @?
Specifically, The data looks like sip:1234567...@10.0.0.1:5060 and I would
like to get only the 1234567890

I tried to use the CUT() command, but without success.

Thank you.

Michael
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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