summaryrefslogtreecommitdiff
path: root/channels/sig_ss7.c
AgeCommit message (Collapse)Author
2012-03-07Change directly setting _softhangup in sig_ss7.c to use ast_softhangup_nolock().Richard Mudgett
Update to: (issue ASTERISK-19372) ........ Merged revisions 358530 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358531 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-05Drop SS7 call if not connected yet when INCOMPLETE/BUSY/CONGESTION.Richard Mudgett
SS7 is a trunk protocol and should clear a failed call as soon as possible. * Made SS7 hangup a call immediately if it has not connected yet for INCOMPLETE/BUSY/CONGESTION causes. Otherwise, play an appropriate inband tone. (closes issue ASTERISK-19372) Reported by: Igor Nikolaev ........ Merged revisions 358278 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358284 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-05Setup DSP when SS7 call is connected or early media is available.Richard Mudgett
Outgoing SS7 calls fail to detect incoming DTMF so any bridged channel that requires out-of-band DTMF will not work. * Added sig_ss7_open_media() calls at appropriate places in sig_ss7.c. The new call converts conditionaled out unconverted code and shows that the code really did something useful. * Improved some chan_dahdi DTMF debug messages to help track DTMF handling. (closes issue ASTERISK-19312) Reported by: Igor Nikolaev ........ Merged revisions 358260 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358261 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-01Opaquify ast_channel typedefs, fd arrays, and softhangup flagTerry Wilson
Review: https://reviewboard.asterisk.org/r/1784/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29Opaquify ast_channel structs and listsTerry Wilson
Review: https://reviewboard.asterisk.org/r/1773/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20ast_channel opaquification of pointers and integral typesTerry Wilson
Review: https://reviewboard.asterisk.org/r/1753/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-18push 'outgoing' flag from sig_XXX up to chan_dahdiAlec L Davis
'p->outgoing' in chan_dahdi and sig_analog wern't kept in sync, particulary FXS ast_hangup didn't clear the 'outgoing' flag. sig_pri and sig_ss7 were keeping 'outgoing' flag insync. Now provides a callback for all the low level sig_XXX modules. (issue ASTERISK-19316) alecdavis (license 585) Reported by: Jeremy Pepper Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/1747/ ........ Merged revisions 355850 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 355851 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01Constify some more channel driver technology callback parameters.Richard Mudgett
Review: https://reviewboard.asterisk.org/r/1707/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09Replace direct access to channel name with accessor functionsTerry Wilson
There are many benefits to making the ast_channel an opaque handle, from increasing maintainability to presenting ways to kill masquerades. This patch kicks things off by taking things a field at a time, renaming the field to '__do_not_use_${fieldname}' and then writing setters/getters and converting the existing code to using them. When all fields are done, we can move ast_channel to a C file from channel.h and lop off the '__do_not_use_'. This patch sets up main/channel_interal_api.c to be the only file that actually accesses the ast_channel's fields directly. The intent would be for any API functions in channel.c to use the accessor functions. No more monkeying around with channel internals. We should use our own APIs. The interesting changes in this patch are the addition of channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to use accessor functions when ast_channel is really opaque), and some re-working of the way channel iterators/callbacks are handled so as to avoid creating fake ast_channels on the stack to pass in matching data by directly accessing fields (since "name" is a stringfield and the fake channel doesn't init the stringfields, you can't use the ast_channel_name_set() function). I went with ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a setter. The majority of the grunt-work for this change was done by writing a semantic patch using Coccinelle ( http://coccinelle.lip6.fr/ ). Review: https://reviewboard.asterisk.org/r/1655/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-11Add protection for SS7 channel allocation and better glare handling.Richard Mudgett
* Added a CLI "ss7 show channels" command that might prove useful for future debugging. * Made the incoming SS7 channel event check and gripe message uniform. * Made sure that the DNID string for an incoming call is always initialized. (issue ASTERISK-17966) Reported by: Kenneth Van Velthoven Patches: jira_asterisk_17966_v1.8_glare.patch (license #5621) patch uploaded by rmudgett ........ Merged revisions 340365 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 340366 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20Merged revisions 337008 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r337008 | rmudgett | 2011-09-20 14:12:24 -0500 (Tue, 20 Sep 2011) | 22 lines Merged revisions 337007 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r337007 | rmudgett | 2011-09-20 14:10:30 -0500 (Tue, 20 Sep 2011) | 15 lines Check if a channel was created before using the pointer in sig_ss7_new_ast_channel(). Fixes the crash in ASTERISK-17955 gdb-11918.txt backtrace. * Added some missing libss7 access lock protection. * Prevent cancelling the ss7_linkset() thread at inoportune times just like the pri_dchannel() thread. (issue ASTERISK-17955) Reported by: Ian M Sherman Patches: jira_asterisk_17955_v1.8.patch (license #5621) patch uploaded by rmudgett (attached to related ASTERISK-17966) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20Merged revisions 336978 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r336978 | rmudgett | 2011-09-20 13:14:40 -0500 (Tue, 20 Sep 2011) | 28 lines Merged revisions 336977 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r336977 | rmudgett | 2011-09-20 13:12:17 -0500 (Tue, 20 Sep 2011) | 21 lines Fix deadlock from not releasing SS7 linkset lock. sig_ss7_hangup() failed to release the SS7 linkset lock if the call had the alreadyhungup flag set. * Made unlock the SS7 linkset lock in sig_ss7_hangup() if the alreadyhungup flag is set. * Made ss7_start_call() not hold any locks while creating the channel for an incoming call to prevent deadlock. * Made ss7_grab() a void function, since it could never fail, to simplify calling code. * Made obtain the channel lock to do softhangup in some places. Patches: jira_ast_668_v1.8.patch (license #5621) patch uploaded by rmudgett JIRA AST-668 ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09Merged revisions 335078 via svnmerge from Matthew Jordan
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r335078 | mjordan | 2011-09-09 11:27:01 -0500 (Fri, 09 Sep 2011) | 29 lines Merged revisions 335064 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r335064 | mjordan | 2011-09-09 11:09:09 -0500 (Fri, 09 Sep 2011) | 23 lines Updated SIP 484 handling; added Incomplete control frame When a SIP phone uses the dial application and receives a 484 Address Incomplete response, if overlapped dialing is enabled for SIP, then the 484 Address Incomplete is forwarded back to the SIP phone and the HANGUPCAUSE channel variable is set to 28. Previously, the Incomplete application dialplan logic was automatically triggered; now, explicit dialplan usage of the application is required. Additionally, this patch adds a new AST_CONTOL_FRAME type called AST_CONTROL_INCOMPLETE. If a channel driver receives this control frame, it is an indication that the dialplan expects more digits back from the device. If the device supports overlap dialing it should attempt to notify the device that the dialplan is waiting for more digits; otherwise, it can handle the frame in a manner appropriate to the channel driver. (closes issue ASTERISK-17288) Reported by: Mikael Carlsson Tested by: Matthew Jordan Review: https://reviewboard.asterisk.org/r/1416/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-10Merged revisions 318499 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r318499 | rmudgett | 2011-05-10 18:41:08 -0500 (Tue, 10 May 2011) | 15 lines Unable to pickup DAHDI/PRI call because call state is reported as DIALING. The channel state is not updated to RINGING when an ALERTING message is received. Regression caused when sig_pri.c (also sig_ss7.c) extracted from chan_dahdi.c. * Added missing channel state update to RINGING when the AST_CONTROL_RINGING frame is queued for ISDN and SS7. (closes issue #19257) Reported by: alecdavis Patches: issue19257_v1.8_v2.patch uploaded by rmudgett (license 664) Tested by: alecdavis, rmudgett ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-08Add private lock deadlock avoidance callback to PRI and SS7.Richard Mudgett
Factor out the equivalent function for analog. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@313100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-25Merged revisions 303771 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r303771 | rmudgett | 2011-01-25 11:49:20 -0600 (Tue, 25 Jan 2011) | 54 lines Merged revisions 303769 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r303769 | rmudgett | 2011-01-25 11:42:42 -0600 (Tue, 25 Jan 2011) | 47 lines Merged revisions 303765 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r303765 | rmudgett | 2011-01-25 11:36:50 -0600 (Tue, 25 Jan 2011) | 40 lines Sending out unnecessary PROCEEDING messages breaks overlap dialing. Issue #16789 was a good idea. Unfortunately, it breaks overlap dialing through Asterisk. There is not enough information available at this point to know if dialing is complete. The ast_exists_extension(), ast_matchmore_extension(), and ast_canmatch_extension() calls are not adequate to detect a dial through extension pattern of "_9!". Workaround is to use the dialplan Proceeding() application early in non-dial through extensions. * Effectively revert issue #16789. * Allow outgoing overlap dialing to hear dialtone and other early media. A PROGRESS "inband-information is now available" message is now sent after the SETUP_ACKNOWLEDGE message for non-digital calls. An AST_CONTROL_PROGRESS is now generated for incoming SETUP_ACKNOWLEDGE messages for non-digital calls. * Handling of the AST_CONTROL_CONGESTION in chan_dahdi/sig_pri was inconsistent with the cause codes. * Added better protection from sending out of sequence messages by combining several flags into a single enum value representing call progress level. * Added diagnostic messages for deferred overlap digits handling corner cases. (closes issue #17085) Reported by: shawkris (closes issue #18509) Reported by: wimpy Patches: issue18509_early_media_v1.8_v3.patch uploaded by rmudgett (license 664) Expanded upon issue18509_early_media_v1.8_v3.patch to include analog and SS7 because of backporting requirements. Tested by: wimpy, rmudgett ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@303772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14Expand the caller ANI field to an ast_party_idRichard Mudgett
Expand the ani field in ast_party_caller and ast_party_connected_line to an ast_party_id. This is an extension to the ast_callerid restructuring patch in review: https://reviewboard.asterisk.org/r/702/ Review: https://reviewboard.asterisk.org/r/744/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14ast_callerid restructuringRichard Mudgett
The purpose of this patch is to eliminate struct ast_callerid since it has turned into a miscellaneous collection of various party information. Eliminate struct ast_callerid and replace it with the following struct organization: struct ast_party_name { char *str; int char_set; int presentation; unsigned char valid; }; struct ast_party_number { char *str; int plan; int presentation; unsigned char valid; }; struct ast_party_subaddress { char *str; int type; unsigned char odd_even_indicator; unsigned char valid; }; struct ast_party_id { struct ast_party_name name; struct ast_party_number number; struct ast_party_subaddress subaddress; char *tag; }; struct ast_party_dialed { struct { char *str; int plan; } number; struct ast_party_subaddress subaddress; int transit_network_select; }; struct ast_party_caller { struct ast_party_id id; char *ani; int ani2; }; The new organization adds some new information as well. * The party name and number now have their own presentation value that can be manipulated independently. ISDN supplies the presentation value for the name and number at different times with the possibility that they could be different. * The party name and number now have a valid flag. Before this change the name or number string could be empty if the presentation were restricted. Most channel drivers assume that the name or number is then simply not available instead of indicating that the name or number was restricted. * The party name now has a character set value. SIP and Q.SIG have the ability to indicate what character set a name string is using so it could be presented properly. * The dialed party now has a numbering plan value that could be useful to have available. The various channel drivers will need to be updated to support the new core features as needed. They have simply been converted to supply current functionality at this time. The following items of note were either corrected or enhanced: * The CONNECTEDLINE() and REDIRECTING() dialplan functions were consolidated into func_callerid.c to share party id handling code. * CALLERPRES() is now deprecated because the name and number have their own presentation values. * Fixed app_alarmreceiver.c write_metadata(). The workstring[] could contain garbage. It also can only contain the caller id number so using ast_callerid_parse() on it is silly. There was also a typo in the CALLERNAME if test. * Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id number string. ast_callerid_parse() alters the given buffer which in this case is the channel's caller id number string. Then using ast_shrink_phone_number() could alter it even more. * Fixed caller ID name and number memory leak in chan_usbradio.c. * Fixed uninitialized char arrays cid_num[] and cid_name[] in sig_analog.c. * Protected access to a caller channel with lock in chan_sip.c. * Clarified intent of code in app_meetme.c sla_ring_station() and dial_trunk(). Also made save all caller ID data instead of just the name and number strings. * Simplified cdr.c set_one_cid(). It hand coded the ast_callerid_merge() function. * Corrected some weirdness with app_privacy.c's use of caller presentation. Review: https://reviewboard.asterisk.org/r/702/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-14Extract sig_ss7_init_linkset() to sig_ss7.Richard Mudgett
Also found a place where sig_pri_init_pri() was inlined and called it instead. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-09Add missing API function to sig_ss7: sig_ss7_fixup().Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-07Extract sig_ss7 out of chan_dahdi.Richard Mudgett
Extract the SS7 specific code out of chan_dahdi like what was done to ISDN/PRI and analog signaling. The new SS7 structures were modeled on sig_pri. The changes to sig_pri are an enhancement and a bug fix made possible because SS7 was extracted. 1) The sig_pri TRANSFERCAPABILITY channel variable should have been set unconditionally in sig_pri_new_ast_channel(). 2) SS7/PRI transfer capability interaction in dahdi_new() fixed because of SS7 extraction. 3) Module ref count error in dahdi_new() if startpbx failed to start the PBX for some reason. Review: https://reviewboard.asterisk.org/r/661/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268774 65c4cc65-6c06-0410-ace0-fbb531ad65f3