Summary: | ASTERISK-02789: [patch] New app in chan_sip: sipgetheader() | ||
Reporter: | Olle Johansson (oej) | Labels: | |
Date Opened: | 2004-11-11 15:28:18.000-0600 | Date Closed: | 2008-01-15 15:15:30.000-0600 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) sipgetheader.txt | |
Description: | With this app, you can pick any header from an incoming invite and stuff it into a channel variable. It is a generic way of supporting any header a vendor or service provider may add that you want to use in your dial plan. ****** ADDITIONAL INFORMATION ****** Disclaimer on file | ||
Comments: | By: Mark Spencer (markster) 2004-11-11 16:14:25.000-0600 This doesn't check for n+101 even existing.... You must have some idea how GROSS this sounds to me right? :) By: Olle Johansson (oej) 2004-11-12 03:45:03.000-0600 Big OOOOPS on my behalf. You Huntsvillemen are sooooo touchy. By: pkubat (pkubat) 2004-11-12 22:28:31.000-0600 check for content should be ast_strlen_zero? - if (content) { + if (!ast_strlen_zero(content)) { log line agrs did not match - ast_log(LOG_WARNING,"SIP Header %s not found\n", header, varname); + ast_log(LOG_WARNING,"SIP Header '%s' not found to place into variable '%s'\n", header, varname); edited on: 11-12-04 22:29 By: Olle Johansson (oej) 2004-11-13 03:44:07.000-0600 Thank you very much for finding those bugs! New version uploaded. By: Mark Spencer (markster) 2004-11-20 11:57:20.000-0600 What headers need to be pulled here? By: Olle Johansson (oej) 2004-11-20 14:56:36.000-0600 Markster, it could be anything... Providers often add headers internally between SIP servers in the network - like account codes. By: petersv (petersv) 2004-11-29 01:45:07.000-0600 Or incoming distinctive ring from sip. See the bug ASTERISK-2872. The SipGetHeader application seems like a nice generic way of handling some sip data. By: khb (khb) 2004-11-29 02:04:59.000-0600 Seconded. OEJ: please change (char*)NULL to (char*)0 or just NULL on some systems NULL might already be defined as a pointer cast of 0 By: zoa (zoa) 2004-11-29 03:51:25.000-0600 im also testing and using this, looks good so far. By: petersv (petersv) 2004-11-29 04:13:28.000-0600 Khb is correct. For C (but not C++) NULL is of type (void *). All compilers should implement NULL tihs way. The extra cast is not needed. For C++ it is the other way around, NULL must be of integral type, not pointer type since void* is _not_ assignable to all pointer types but 0 is. Since Asterisk is C and not C++ this is just trivia. By: Mark Spencer (markster) 2004-12-02 18:52:57.000-0600 Added to CVS.... I had to hold my nose, but thanks. By: Russell Bryant (russell) 2004-12-02 19:14:08.000-0600 not in 1.0 By: Digium Subversion (svnbot) 2008-01-15 15:15:30.000-0600 Repository: asterisk Revision: 4374 U trunk/channels/chan_sip.c ------------------------------------------------------------------------ r4374 | markster | 2008-01-15 15:15:30 -0600 (Tue, 15 Jan 2008) | 2 lines Add nasty sip get header, too (bug ASTERISK-2789) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=4374 |