[Gelöst] DID abgeschnitten

DOCaCola

Neuer User
Mitglied seit
12 Mai 2005
Beiträge
11
Punkte für Reaktionen
0
Punkte
1
hat jemand eine idee weshalb ich bei eingehenden anrufen immer nur [912@isdn-in:1] bekomme und nicht [912345678@isdn-in:1] (siehe folgenden output)
die did scheint zu stimmen die ich bekomme (laut chan_capi debug output wie zu sehen), allerdings wird diese nicht richtig in den asterisk context übertragen

Code:
    -- CONNECT_IND (PLCI=0x401,DID=912345678,CID=03098765,CIP=0x4,CONTROLLER=0x1)
  == Started pbx on channel CAPI/ISDN1#02/912345678-5
    -- Executing [912@isdn-in:1] Answer("CAPI/ISDN1#02/912345678-5", "") in new stack
    -- Executing [912@isdn-in:2] Playback("CAPI/ISDN1#02/912345678-5", "vm-goodbye") in new stack
    -- <CAPI/ISDN1#02/912345678-5> Playing 'vm-goodbye.alaw' (language 'de')
    -- Executing [912@isdn-in:3] Hangup("CAPI/ISDN1#02/912345678-5", "") in new stack
  == Spawn extension (isdn-in, 912, 3) exited non-zero on 'CAPI/ISDN1#02/912345678-5'
    -- Executing [h@isdn-in:1] Answer("CAPI/ISDN1#02/912345678-5", "") in new stack
  == Spawn extension (isdn-in, h, 1) exited non-zero on 'CAPI/ISDN1#02/912345678-5'
    -- ISDN1#02: activehangingup (cause=16) for PLCI=0x401
  == ISDN1#02: Interface cleanup PLCI=0x401


hier meine capi_conf
Code:
[general]
nationalprefix=0        ; or for example "+49"
internationalprefix=00  ; or for example "+"
;subscriberprefix=+4969 ; prefix including area code (some lines need this)
rxgain=1.0       ;linear receive gain (1.0 = no change)
txgain=1.0       ;linear transmit gain (1.0 = no change)
language=de	 ;set default language
;ulaw=yes        ;set this, if you live in u-law world instead of a-law

;jb.....         ;with Asterisk 1.4 you can configure jitterbuffer,
                 ;see Asterisk documentation for all jb* setting available.
;mohinterpret=default ;Asterisk 1.4: default music on hold class when placed on hold.
[ISDN1]          ;this example interface gets name 'ISDN1' and may be any
                 ;name not starting with 'g' or 'contr'.
                 ;Use one interface section for each ISDN port!
ntmode=no      ;if the ISDN card operates in NT-mode, set this to 'yes'
isdnmode=did     ;'MSN' (point-to-multipoint) or 'DID' (direct inward dial)
                 ;when using NT-mode, 'DID' should be set in any case
incomingmsn=*    ;allow incoming calls to this list of MSNs/DIDs, * = any
;defaultcid=123  ;set a default caller ID to that interface for dial-out,
                 ;this caller ID will be used when the dial option 'd' is set.
;controller=0    ;ISDN4BSD default
;controller=7    ;ISDN4BSD USB default
controller=1     ;CAPI controller number of this interface/port
group=1          ;dialout group
;prefix=0        ;set a prefix to the calling number on incoming calls
softdtmf=on	 ;enable/disable software DTMF detection, recommended for AVM cards
relaxdtmf=on     ;in addition to softdtmf, you can use relaxed DTMF detection
faxdetect=off    ;enable faxdetection and redirection to EXTEN 'fax' for incoming and/or
                 ;outgoing calls. (default='off', possible values: 'incoming','outgoing','both')
faxdetecttime=0  ;Only detect faxes during the first 'n' seconds of the call.
                 ;(default '0' meaning for the whole duration of the call)
faxdestination=custom-fax,fax,1 ;Set custom context, exten and priority to jump to on faxdetect.
                 ;Default is "<current-context>,fax,1".
accountcode=     ;PBX accountcode to use in CDRs
;amaflags=default;AMA flags for CDR ('default', 'omit', 'billing', or 'documentation')
context=isdn-in  ;context for incoming calls
;holdtype=hold   ;when the PBX puts the call on hold, ISDN HOLD will be used. If
                 ;set to 'local' (default value), no hold is done and the PBX may
                 ;play MOH.
immediate=no   ;DID: immediate start of PBX with extension 's' if no digits were
                 ;     received on incoming call (no destination number yet)
                 ;MSN: start PBX on CONNECT_IND and do not wait for SETUP/SENDING-COMPLETE.
                 ;     info like REDIRECTINGNUMBER may be lost, but this is necessary for
                 ;     drivers/pbx/telco which does not send SETUP or SENDING-COMPLETE.
;echosquelch=1   ;_VERY_PRIMITIVE_ echo suppression. Disable it before you start recording voicemail
                 ;or your files may get choppy. (you can use capicommand(echosquelch|no) for this)
;echocancel=yes  ;Dialogic(R) Diva(R) (CAPI) echo cancellation (yes=g165)
                 ;(possible values: 'no', 'yes', 'force', 'g164', 'g165')
;echocancelpath=1;Dialogic(R) Diva(R) (CAPI) echo cancellation path
                 ;(possible values: default '1' - E.1/T.1/S0, '2' - IP, '3' - both)
echocancelold=yes;use facility selector 6 instead of correct 8 (necessary for older eicon drivers)
;echotail=64     ;echo cancel tail setting (default=0 for maximum)
;echocancelnlp=1 ;activate non-linear-processing; this improves echo cancel ratio, but might
                 ;incorporate variable gain in the signal path.
;bridge=yes	 ;native bridging (CAPI line interconnect) if available
;callgroup=1     ;PBX call group
;pickupgroup=1   ;PBX pickup group (which call groups are we allowed to pickup)
;transfergroup=1 ;Controller(s) where a transfer on native bridge is allowed to.
;language=de     ;set language for this device (overwrites default language)
;disallow=all    ;RTP codec selection (valid with Dialogic(R) Diva(R) Media Boards only)
;allow=all	 ;RTP codec selection (valid with Dialogic(R) Diva(R) Media Boards only)
devices=2        ;number of concurrent calls (B-Channels) on this controller
                 ;(2 makes sense for single BRI, 30/23 for PRI/T1)
;jb.....         ;with Asterisk 1.4 you can configure jitterbuffer,
                 ;see Asterisk documentation for all jb* setting available.
;mohinterpret=default ;Asterisk 1.4: default music on hold class when placed on hold.
;qsig=1           ;enable use of Q.SIG extensions. ECMA Variant
;qsig_prnum=1234  ;enable inbound bridging - this should be an QSIG-network-wide unique number
;divaqsig=on	  ;enable Diva QSIG and protocol independent implementation
;mwifacptynrtype=0;type of MWI facility party number, 0 - unknown (default), 1 - public
;mwifacptynrton=0 ;MWI facility party number type of number and numbering plan identification
;                  (coding as for byte 0 of the calling party number).
;                  This byte is only valid if byte mwifacptynrtype contains the value 1
;mwifacptynrpres=0;MWI facility party number type presentation and screening indicator
;                  (coding as for byte 1 of the calling party number).
;                  This byte is only valid if byte mwifacptynrtype contains the value 1
;mwibasicservice=1;MWI basic Service, coded in accordance with ETS 300 196 [D.5]
;mwiinvocation=2  ;MWI invocation mode, 0 - deferred, 1 - immediate, 2 - combined,
;                  65535 - suppres invocation code
;mwimailbox=12345 ;',' separated list of mailboxes for MWI in format:
;                  mailbox[:controlling user number[:controlling user provided number]][@context]
;hlimit=10        ;Do not use this controller for outgoing calls if less than 'hlimit' free channels is
                  ;left on this controller.
;slimit=10        ;Try to use for outgoing calls other controller in group if less than 'slimit' free

und der test context
Code:
[isdn-in]
exten => _.,1,Answer()
exten => _.,2,Playback(vm-goodbye)
exten => _.,3,Hangup()
 
Zuletzt bearbeitet:
Welche chan_capi-Sourcen hast Du für welche Asterisk Version benutzt ?
Der aktuelle Trunk-Stand hat - incl. dem im Forum verlinkten Patch - unter Asterisk 11 einen Bug mit genau dem Fehlerbild.

Du kannst mal in chan_capi.c die Methode search_did komplett mit Folgendem ersetzen und dann das capi-Modul neu übersetzen, dann sollte es gehen:

Code:
static int search_did(struct ast_channel *c)
{
	/*
	 * Returns 
	 * -1 = Failure 
	 *  0 = Match
	 *  1 = possible match 
	 */
	struct capi_pvt *i = CC_CHANNEL_PVT(c);
	char *exten;
    
	if (!strlen(i->dnid) && (i->immediate)) {
		exten = "s";
		cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: %s: %s matches in context %s for immediate\n",
			#ifdef CC_AST_HAS_VERSION_11_0
			i->vname, ast_channel_name(c), exten, ast_channel_context(c));
			#else
			i->vname, c->name, exten, c->context);
			#endif
	} else {
		if (strlen(i->dnid) < strlen(i->incomingmsn))
			return 0;
		exten = i->dnid;
	}

	#ifdef CC_AST_HAS_VERSION_11_0
	if (ast_exists_extension(NULL, ast_channel_context(c), exten, 1, i->cid)) {
		ast_channel_priority_set(c, 1);
		ast_channel_exten_set(c, exten);
		cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: %s: %s matches in context %s\n",
                        i->vname, ast_channel_name(c), ast_channel_exten(c), ast_channel_context(c));
	#else
	if (ast_exists_extension(NULL, c->context, exten, 1, i->cid)) {
		c->priority = 1;
		cc_copy_string(c->exten, exten, sizeof(c->exten));
		cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: %s: %s matches in context %s\n",
			i->vname, c->name, exten, c->context);
	#endif
		return 0;
	}

	#ifdef CC_AST_HAS_VERSION_11_0
	if (ast_canmatch_extension(NULL, ast_channel_context(c), exten, 1, i->cid)) {
		cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: %s: %s would possibly match in context %s\n",
			i->vname, ast_channel_name(c), exten, ast_channel_context(c));
	#else
	if (ast_canmatch_extension(NULL, c->context, exten, 1, i->cid)) {
		cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: %s: %s would possibly match in context %s\n",
			i->vname, c->name, exten, c->context);
	#endif
		return 1;
	}

	return -1;
}

Damit klappt es zumindest hier.
 
Tja, leider ist der Patch gegen Asterisk 11 zwar so, dass man chan_capi übersetzen kann, aber er enthält halt Fehlerchen - zumindest der hier für MSN-basierte DID-Auswertung mit immediate=no - ist mit obenstehendem Code behebbar.

Wahrscheinlich gibt es noch mehr Probleme, die sind mir dann aber selbst auch noch nicht untergekommen ...
 
der ISDN port klappt ziemlich gut. probleme habe ich aber nun mit dem anderen channel, nämlich dem sip/gsm/whatever port (channel 5) der fritzbox
auf diesem port schaffe ich es nicht

das merkwürdige ist, dass bei der DID er mir ein komisches 99# vornedran stellt. Das könnte aber auch so direkt von der Fritzbox kommen. Allerdings konnte ich von dieser 99 nirgendwo sonst etwas im internet ergooglen. Auch wenn die 99 nicht so schlimm ist, so schaffe ich es allerdings nicht, den anruf von einem context handlen zu lassen
anruf von meinem handy 017781234567 auf den gsm stick 0152912345678 sieht im log so aus:
Code:
    -- CONNECT_IND (PLCI=0xb05,DID=99#0152912345678,CID=017781234567,CIP=0x10,CONTROLLER=0x5)
[2014-06-01 01:01:19] WARNING[8373]: chan_capi.c:5803 capidev_handle_connect_indication: did not find device for msn = 99#0152912345678
       > CAPI: Command=CONNECT_IND,0x8482: no interface for PLCI=0xb05, MSGNUM=0x15c2!
       > CAPI: Command=INFO_IND,0x8492: no interface for PLCI=0xb05, MSGNUM=0x15c3!
       > CAPI: Command=INFO_IND,0x8492: no interface for PLCI=0xb05, MSGNUM=0x15c4!
       > CAPI: Command=INFO_IND,0x8492: no interface for PLCI=0xb05, MSGNUM=0x15c5!
       > CAPI: Command=INFO_IND,0x8492: no interface for PLCI=0xb05, MSGNUM=0x15c6!
       > CAPI: Command=DISCONNECT_IND,0x848c: no interface for PLCI=0xb05, MSGNUM=0x15c8!
    -- CONNECT_IND (PLCI=0xe05,DID=,CID=**0017781234567,CIP=0,CONTROLLER=0x5)
[2014-06-01 01:01:19] WARNING[8373]: chan_capi.c:5803 capidev_handle_connect_indication: did not find device for msn =
       > CAPI: Command=CONNECT_IND,0x8482: no interface for PLCI=0xe05, MSGNUM=0x15cf!
       > CAPI: Command=INFO_IND,0x8492: no interface for PLCI=0xe05, MSGNUM=0x15d0!
       > CAPI: Command=INFO_IND,0x8492: no interface for PLCI=0xe05, MSGNUM=0x15d1!
       > CAPI: Command=INFO_IND,0x8492: no interface for PLCI=0xe05, MSGNUM=0x15d2!
       > CAPI: Command=DISCONNECT_IND,0x848c: no interface for PLCI=0xe05, MSGNUM=0x15d8!

capi.conf auszug
Code:
[MOBIL]
isdnmode=msn
incomingmsn=*
controller=5
group=2
softdtmf=on
relaxdtmf=on
faxdetect=off
faxdetecttime=0
faxdestination=custom-fax,fax,1
accountcode=
context=gsm-in
immediate=no
chocancelold=yes

extensions_custom.conf auszug
Code:
[gsm-in]
exten => _.,1,Answer()
exten => _.,2,Playback(vm-goodbye)
exten => _.,3,Hangup()

beim rauswählen über CAPI/MOBIL/$OUTNUM$
Code:
      > data = MOBIL/017781234567 format=(alaw)
       > capi request for interface 'MOBIL'
    -- didn't find capi device for interface 'MOBIL'
[2014-06-01 01:12:07] WARNING[8425][C-00000033]: app_dial.c:2437 dial_exec_full: Unable to create channel of type 'CAPI' (cause 44 - Requested channel not available)
  == Everyone is busy/congested at this time (1:0/0/1)
 
Zuletzt bearbeitet:
Da findet die CAPI zunächst mal kein DEVICE, respektive kein Gerät (eingehend wie ausgehend). Insoweit solltest Du Deine Frage in Richtung der Fritzbox-Fraktion stellen: Es geht ja hier soweit ich es verstehe um den USB-Port und ein dort zugeschaltetes GSM-Modem.
Was das 99# bei Inbound betrifft, so kommt das irgendwo von der fritzbox, wäre aber - sofern das Grundproblem: Über welche Technik kann ich wie mit dem USB-Modem reden? geklärt wird - eher nebensächlich, das könnte man dann im extensions-Bereich ausregeln.
 
ah, in Ordnung.
Die FritzBox stellt über die Remote CAPI fünf controller zur Verfügung. Controller 1 ist für Gespräche über die normale ISDN Leitung. Controller Nr 5 ist so eine art Sammelcontroller für alles übrige. Also SIP/UMTS sticks... Ich habe auch noch weiter getestet.
Gespräche die über SIP in die FritzBox gelangen werden mit 0# vorangestellt angezeigt.
Code:
[2014-06-02 10:09:39] WARNING[5747]: chan_capi.c:5803 capidev_handle_connect_indication: did not find device for msn = 0#333
und eben die über das gsm modul mit 99#
Code:
[2014-06-01 01:01:19] WARNING[8373]: chan_capi.c:5803 capidev_handle_connect_indication: did not find device for msn = 99#0152912345678
Im Internet konnte ich zu diesen vorrangestellten Nummer aber auch nichts finden. Im Prinzip aber auch egal, denn was ich nicht verstehe ist, dass Asterisk diese Gespräche nicht annimmt, trotz meiner generell gehaltenen gsm-in Regel. Was bedeutet dieser Fehler genau? Ist es ein Fehler in der CAPI oder worauf bezieht sich dieses "device"?

EDIT: ich hab es herausgefunden. ganz einfach, ich hab in der capi.conf für den "MOBIL" Eintrag devices=2 vergessen (siehe oben)... so kommen jetzt schonmal die Gespräche in asterisk auch an.
EDIT2:
ausgehende gespräche klappen auch wie gewünscht. das entscheidende war das devices :)
 
Zuletzt bearbeitet:
Jepp, das war mir - neben meinem Unwissen darüber, dass die Fritzbox das so macht - untergegangen: Fehlt devices oder ist es kleiner als die tatsächliche Anzahl Sprachkanäle auf dem Controller, dann funktioniert mal eben nichts.
Aber ist ja schön, wenn es jetzt wie gewünscht funktioniert.
BTW: Es wäre nett, wenn Du dem Threadtitel jetzt ein Gelöst voranstellen könntest. (1. Beitrag, Bearbeiten, Erweitert)
 
Danke! Genau der Code-Schnipsel hat mir auch gefehlt!! Die beiden Patches hatte ich, aber das nicht. ...und natürlich hat das auch mir das Problem mit den abgeschnittenen DID's behoben.

Für alle, die nach uns kommen habe ich hier mal die aktuellen Sourcen inkl. Patches und Abänderung der Methode search_did zusammen gepackt und stelle sie hier bereit: http://www.comfine.de/download/chan_capi_asterisk11.tar.gz
Weiss jemand warum die patches nicht in's trunk eingecheckt werden?
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.