Review Board 1.7.16


Dahdi FXS line polarity reversal when remote party Answers and/or Hangups

Review Request #797 - Created July 22, 2010 and submitted

Alec Davis
trunk
17318
Reviewers
asterisk-dev
Asterisk
Quoting armeniki:
"FXS lines normally connect to a telephone. However, when FXS lines are routed to an external PBX or Key System to act as "external" or "CO" lines, it is extremely difficult, if not impossible for the external PBX to know when the call has been disconnected without receiving a polarity reversal on the line."

Implementation was to use existing keywords as used for FXO modules 'answeronpolityswitch' and 'hanguponpolarityswitch', with a similar function for the FXS module but from the Legacy PBX's point of view.
Using TDM800P FXS modules:

Inbound and outbound calls, using answeronpolarityswitch and hanguponpolarityswitch 

Changes between revision 2 and 3

1 2 3 4 5
1 2 3 4 5

  1. trunk/channels/chan_dahdi.c: Loading...
  2. trunk/channels/sig_analog.c: Loading...
trunk/channels/chan_dahdi.c
Diff Revision 2 Diff Revision 3
[20] 1889 lines
[+20] [+] static int my_callwait(void *pvt)
1890
static int my_send_callerid(void *pvt, int cwcid, struct ast_party_caller *caller)
1890
static int my_send_callerid(void *pvt, int cwcid, struct ast_party_caller *caller)
1891
{
1891
{
1892
	struct dahdi_pvt *p = pvt;
1892
	struct dahdi_pvt *p = pvt;
1893

    
   
1893

   
1894
	ast_debug(2, "Starting cid spill\n");
1894
	ast_debug(2, "Starting cid spill\n");
1895
	ast_verb(0, "ALEC Starting cid spill on channel=%d\n", p->channel);

   
1896

    
   
1895

   
1897
	if (p->cidspill) {
1896
	if (p->cidspill) {
1898
		ast_log(LOG_WARNING, "cidspill already exists??\n");
1897
		ast_log(LOG_WARNING, "cidspill already exists??\n");
1899
		ast_free(p->cidspill);
1898
		ast_free(p->cidspill);
1900
	}
1899
	}
[+20] [20] 851 lines
[+20] [+] static void my_set_polarity(void *pvt, int value)
2752

    
   
2751

   
2753
	if (p->channel == CHAN_PSEUDO)
2752
	if (p->channel == CHAN_PSEUDO)
2754
		return;
2753
		return;
2755
	p->polarity = value;
2754
	p->polarity = value;
2756
	res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETPOLARITY, &value);
2755
	res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETPOLARITY, &value);
2757
	ast_verb(0, "ALEC set polarity=%d channel=%d res=%d\n", value, p->channel, res);

   
2758
}
2756
}
2759

    
   
2757

   
2760
static void my_start_polarityswitch(void *pvt)
2758
static void my_start_polarityswitch(void *pvt)
2761
{
2759
{
2762
	struct dahdi_pvt *p = pvt;
2760
	struct dahdi_pvt *p = pvt;
[+20] [20] 15156 lines
trunk/channels/sig_analog.c
Diff Revision 2 Diff Revision 3
 
  1. trunk/channels/chan_dahdi.c: Loading...
  2. trunk/channels/sig_analog.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.