[asterisk-users] Extract user part from SIP URI

Jonathan González jonathan.gsc at gmail.com
Tue Jun 15 16:21:11 CDT 2010


Hi there,

I am using the user part of a SIP URI to know the mailbox number that I have
to use on my dialplan. This SIP URI is stored in the History Info of the SIP
Header so I am extracting that user part right now using the CUT function
against that part of the header.

I would like to know if there's any simple method to get that part of the
SIP URI using regular expression or something easy and consolidated.

Right now what I am doing is (NUMBER contains the history info):
  exten => 1234,1,Set(NUMBER=${CUT(NUMBER, \:, 2)})
  exten => 1234,2,Set(NUMBER=${CUT(NUMBER, @, 1)})

I am just interested in the first occurrence of the SIP URI.

Thanks in advance,
Jonathan

-- 
Personal webpage - www.jonbaraq.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100615/92ffbe89/attachment.htm 


More information about the asterisk-users mailing list