Paging/intercom issue

Hi,

I don’t know when this ‘broke’ but… now when I use *80 that extension rings briefly and paging doesn’t work. The extension works fine as part of a paging group though.

Here’s what I see in my log - I’ve also recently updated to 1.4.9 also:

Thanks,

C.

[size=9] – Executing [*80101@from-internal:1] Set(“SIP/102-b7d01ed0”, “dialnumber=101”) in new stack
– Executing [*80101@from-internal:2] Set(“SIP/102-b7d01ed0”, “user-intercom=”) in new stack
– Executing [*80101@from-internal:3] GotoIf(“SIP/102-b7d01ed0”, “0?nointercom”) in new stack
– Executing [*80101@from-internal:4] SIPAddHeader(“SIP/102-b7d01ed0”, “Call-Info: ;answer-after=0”) in new stack
– Executing [*80101@from-internal:5] SIPAddHeader(“SIP/102-b7d01ed0”, “Alert-Info: Ring Answer”) in new stack
– Executing [*80101@from-internal:6] Set(“SIP/102-b7d01ed0”, “__SIP_URI_OPTIONS=intercom=true”) in new stack
– Executing [*80101@from-internal:7] Dial(“SIP/102-b7d01ed0”, “Local/101@from-internal/n|”) in new stack
– Called 101@from-internal/n
– Executing [101@from-internal:1] Macro(“Local/101@from-internal-b028,2”, “exten-vm|101|101”) in new stack
– Executing [s@macro-exten-vm:1] Macro(“Local/101@from-internal-b028,2”, “user-callerid”) in new stack
– Executing [s@macro-user-callerid:1] NoOp(“Local/101@from-internal-b028,2”, “user-callerid: device 102”) in new stack
– Executing [s@macro-user-callerid:2] Set(“Local/101@from-internal-b028,2”, “AMPUSER=102”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“Local/101@from-internal-b028,2”, “1?report”) in new stack
– Goto (macro-user-callerid,s,13)
– Executing [s@macro-user-callerid:13] NoOp(“Local/101@from-internal-b028,2”, “TTL: ARG1: 101”) in new stack
– Executing [s@macro-user-callerid:14] GotoIf(“Local/101@from-internal-b028,2”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:15] Set(“Local/101@from-internal-b028,2”, “__TTL=64”) in new stack
– Executing [s@macro-user-callerid:16] GotoIf(“Local/101@from-internal-b028,2”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,23)
– Executing [s@macro-user-callerid:23] NoOp(“Local/101@from-internal-b028,2”, “Using CallerID “device” <102>”) in new stack
– Executing [s@macro-exten-vm:2] Set(“Local/101@from-internal-b028,2”, “FROMCONTEXT=exten-vm”) in new stack
– Executing [s@macro-exten-vm:3] Set(“Local/101@from-internal-b028,2”, “VMBOX=101”) in new stack
– Executing [s@macro-exten-vm:4] Set(“Local/101@from-internal-b028,2”, “EXTTOCALL=101”) in new stack
– Executing [s@macro-exten-vm:5] Set(“Local/101@from-internal-b028,2”, “CFUEXT=”) in new stack
– Executing [s@macro-exten-vm:6] Set(“Local/101@from-internal-b028,2”, “CFBEXT=”) in new stack
– Executing [s@macro-exten-vm:7] Set(“Local/101@from-internal-b028,2”, “RT=15”) in new stack
– Executing [s@macro-exten-vm:8] Macro(“Local/101@from-internal-b028,2”, “record-enable|101|IN”) in new stack
– Executing [s@macro-record-enable:1] GotoIf(“Local/101@from-internal-b028,2”, “0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [s@macro-record-enable:4] DeadAGI(“Local/101@from-internal-b028,2”, “recordingcheck|20070727-085251|1185522771.15”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20070727-085251|1185522771.15: Inbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing [s@macro-record-enable:5] NoOp(“Local/101@from-internal-b028,2”, “No recording needed”) in new stack
– Executing [s@macro-exten-vm:9] Macro(“Local/101@from-internal-b028,2”, “dial|15|trw|101”) in new stack
– Executing [s@macro-dial:1] AGI(“Local/101@from-internal-b028,2”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
dialparties.agi: priority is 1
dialparties.agi: Caller ID name is ‘device’ number is ‘102’
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 101 to extension map
– dialparties.agi: Extension 101 cf is disabled
– dialparties.agi: Extension 101 do not disturb is disabled
> dialparties.agi: extnum: 101
> dialparties.agi: exthascw: 1
> dialparties.agi: exthascfb: 0
> dialparties.agi: extcfb:
> dialparties.agi: exthascfu: 0
> dialparties.agi: extcfu:
> dialparties.agi: ExtensionState: 0
– dialparties.agi: dbset CALLTRACE/101 to 102
== Manager ‘admin’ logged off from 127.0.0.1
– AGI Script dialparties.agi completed, returning 0
– Executing [s@macro-dial:10] Dial(“Local/101@from-internal-b028,2”, “SIP/101|15|trw”) in new stack
– Called 101
– Local/101@from-internal-b028,1 is ringing
– SIP/101-088e0440 is ringing
== Spawn extension (from-internal, *80101, 7) exited non-zero on ‘SIP/102-b7d01ed0’
– Executing [h@from-internal:1] Macro(“SIP/102-b7d01ed0”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] ResetCDR(“SIP/102-b7d01ed0”, “w”) in new stack
– Executing [s@macro-hangupcall:2] NoCDR(“SIP/102-b7d01ed0”, “”) in new stack
– Executing [s@macro-hangupcall:3] GotoIf(“SIP/102-b7d01ed0”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing [s@macro-hangupcall:6] GotoIf(“SIP/102-b7d01ed0”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] GotoIf(“SIP/102-b7d01ed0”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing [s@macro-hangupcall:11] Hangup(“SIP/102-b7d01ed0”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/102-b7d01ed0’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/102-b7d01ed0’
== Spawn extension (macro-dial, s, 10) exited non-zero on ‘Local/101@from-internal-b028,2’ in macro ‘dial’
== Spawn extension (macro-dial, s, 10) exited non-zero on ‘Local/101@from-internal-b028,2’ in macro ‘exten-vm’
== Spawn extension (macro-dial, s, 10) exited non-zero on ‘Local/101@from-internal-b028,2’
– Executing [h@macro-dial:1] Macro(“Local/101@from-internal-b028,2”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] ResetCDR(“Local/101@from-internal-b028,2”, “w”) in new stack
– Executing [s@macro-hangupcall:2] NoCDR(“Local/101@from-internal-b028,2”, “”) in new stack
– Executing [s@macro-hangupcall:3] GotoIf(“Local/101@from-internal-b028,2”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing [s@macro-hangupcall:6] GotoIf(“Local/101@from-internal-b028,2”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] GotoIf(“Local/101@from-internal-b028,2”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing [s@macro-hangupcall:11] Hangup(“Local/101@from-internal-b028,2”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘Local/101@from-internal-b028,2’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘Local/101@from-internal-b028,2’
– Saved useragent “Linksys/SPA3102-5.1.7(GW)” for peer 715180
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
– Saved useragent “Linksys/SPA962-5.1.7” for peer 101
[/size]

file a bug - the issue is that Asterisk 1.4 does not inherit sip settings and the fix to intercom should not have been made (paging is proper) plus dialparties.agi needs to be modified to deal with __SIPADDHEADER

try the following two patches:

dialparties.agi:

[code:1]
Index: dialparties.agi

— dialparties.agi (revision 4547)
+++ dialparties.agi (working copy)
@@ -86,12 +86,19 @@
$dialopts = get_var( $AGI, “ARG2” );
$rgmethod = get_var( $AGI, “RingGroupMethod” );

-$alertinfo = get_var( $AGI, “ALERT_INFO”);
+$alertinfo = get_var( $AGI, “ALERT_INFO” );
if ($alertinfo) {
debug(“Setting Alert-Info: $alertinfo”, 4);
$AGI->set_alertinfo($alertinfo);
}

+$sippheader = get_var( $AGI, “SIPADDHEADER” );
+if ($sippheader) {

  •   $fields = explode(':',$sippheader,2);
    
  •   debug("Setting sipheader ".$fields[0].": ".$fields[1], 4);
    
  •   $AGI->exec_sipaddheader($fields[0], $fields[1]);
    

+}
+
$pr_dialstatus = get_var( $AGI, “PR_DIALSTATUS” );

$fmgrp = get_var( $AGI, “FMGRP” );
[/code:1]
in paging: functions.inc.php:

[code:1]
Index: functions.inc.php

— functions.inc.php (revision 4522)
+++ functions.inc.php (working copy)
@@ -131,15 +131,16 @@
$code = $fcc->getCodeActive();
unset($fcc);

  •                   // Since these are going down channel local, set ALERT_INFO and SIPADDHEADER which will be set in dialparties.agi
    
  •                   // no point in even setting the headers here they will get lost in channel local
    
  •                   //
                      if (!empty($code)) {
                              $ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('dialnumber', '${EXTEN:'.strlen($code).'}'));
                              $ext->add('ext-intercom', '_'.$code.'.', '', new ext_dbget('user-intercom','AMPUSER/${dialnumber}/intercom'));
                              $ext->add('ext-intercom', '_'.$code.'.', '', new ext_gotoif('$["${user-intercom}" = "disabled" ]', 'nointercom'));
    
  •                           $ext->add('ext-intercom', '_'.$code.'.', '', new ext_sipaddheader('Call-Info','\;answer-after=0'));
    
  •                           $ext->add('ext-intercom', '_'.$code.'.', '', new ext_alertinfo('Ring Answer'));
    
  •                           $ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('__SIPADDHEADER', 'Call-Info: \;answer-after=0'));
    
  •                           $ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('__ALERT_INFO', 'Ring Answer'));
                              $ext->add('ext-intercom', '_'.$code.'.', '', new ext_setvar('__SIP_URI_OPTIONS', 'intercom=true'));
    
  •                           $ext->add('ext-intercom', '_'.$code.'.', '', new ext_dial('Local/${dialnumber}@from-internal/n','',''));
                              $ext->add('ext-intercom', '_'.$code.'.', '', new ext_busy());
                              $ext->add('ext-intercom', '_'.$code.'.', '', new ext_macro('hangupcall'));
    

[/code:1]

of course make backups first - let me know if this fixes it so I can get these in.

Man you are fast! Thank you! However…

I am having trouble with patch (I don’t really use it) - I could patch it manually but it would be useful to get patch to work…

I get the following when I try to patch - any help appreciated…

[size=9][i][root@asterisk1 agi-bin]# patch dialparties.agi dp.patch
patching file dialparties.agi
Hunk #1 FAILED at 86.
1 out of 1 hunk FAILED – saving rejects to file dialparties.agi.rej
[root@asterisk1 agi-bin]# cat *rej


*** 86,97 ****
$dialopts = get_var( $AGI, “ARG2” );
$rgmethod = get_var( $AGI, “RingGroupMethod” );

  • $alertinfo = get_var( $AGI, “ALERT_INFO”);
    if ($alertinfo) {
    debug(“Setting Alert-Info: $alertinfo”, 4);
    $AGI->set_alertinfo($alertinfo);
    }

    $pr_dialstatus = get_var( $AGI, “PR_DIALSTATUS” );

    $fmgrp = get_var( $AGI, “FMGRP” );
    — 86,104 ----
    $dialopts = get_var( $AGI, “ARG2” );
    $rgmethod = get_var( $AGI, “RingGroupMethod” );

  • $alertinfo = get_var( $AGI, “ALERT_INFO” );
    if ($alertinfo) {
    debug(“Setting Alert-Info: $alertinfo”, 4);
    $AGI->set_alertinfo($alertinfo);
    }

  • $sippheader = get_var( $AGI, “SIPADDHEADER” );

  • if ($sippheader) {

  •    $fields = explode(':',$sippheader,2);
    
  •    debug("Setting sipheader ".$fields[0].": ".$fields[1], 4);
    
  •    $AGI->exec_sipaddheader($feilds[0], $feilds[1]);
    
  • }

  • $pr_dialstatus = get_var( $AGI, “PR_DIALSTATUS” );

    $fmgrp = get_var( $AGI, “FMGRP” );
    [/i][/size]

did you make sure you have the most up-to-date dialparties.agi file? I made the patch off of svn - so it should just apply?

Nope - I’ve been trying to stick to updating via module admin but I can pull the current copy and try again. Would you mind reminding me of the SVN syntax (sorry, feeling very lazy today, it’s Friday).

C.

that’s what I mean - updating via module admin. In any event - if you want to do it by hand so you can test this for me, here are the step for dialparties.agi where it did not apply properly:

you will see a section towards the top of dialparties.agi (roughly line 89):

[code:1]
$alertinfo = get_var( $AGI, “ALERT_INFO”);
if ($alertinfo) {
debug(“Setting Alert-Info: $alertinfo”, 4);
$AGI->set_alertinfo($alertinfo);
}
[/code:1]
right after that section, add the following:

[code:1]
$sippheader = get_var( $AGI, “SIPADDHEADER” );
if ($sippheader) {
$fields = explode(’:’,$sippheader,2);
debug("Setting sipheader “.$fields[0].”: ".$fields[1], 4);
$AGI->exec_sipaddheader($fields[0], $fields[1]);
}
[/code:1]
and assuming you patched the paging module with the other file, you should be able to test. Also - I just noticed a typo in the first patch anyhow, I’m going to edit that post to correct it.

Please go post bug against this (if you already did thanks)

Phillipe,

I guess my functions.inc.php is out of line with yours for sure. I don’t see ‘getCodeActive()’ even…

I would pull the current SVN but I’m trying to keep things relatively stable to avoid the wrath of kahn (wife).

I’m not sure your diff is against the same version we all have (or at least I have, even after an update).

If I’m being a bit stoopid tell me and I’ll try harder but it has been a long day :frowning:

C.

the functions.inc.php file you need to patch is in:

/var/www/html/admin/modules/paging

[quote=“p_lindheimer”]the functions.inc.php file you need to patch is in:

/var/www/html/admin/modules/paging[/quote]

Doh!

[quote=“p_lindheimer”]the functions.inc.php file you need to patch is in:

/var/www/html/admin/modules/paging[/quote]

OK - I patched both by hand, I have no idea why patch doesn’t work on my system :frowning:

It works! … Ticket #2168.

Thanks VERY much for your continued support and tolerance of the likes of me.

C.