Merged revisions 68733 via svnmerge from
authorChristian Richter <christian.richter@beronet.com>
Mon, 11 Jun 2007 17:05:48 +0000 (17:05 +0000)
committerChristian Richter <christian.richter@beronet.com>
Mon, 11 Jun 2007 17:05:48 +0000 (17:05 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r68733 | crichter | 2007-06-11 18:57:59 +0200 (Mo, 11 Jun 2007) | 9 lines

Merged revisions 68732 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68732 | crichter | 2007-06-11 18:49:00 +0200 (Mo, 11 Jun 2007) | 1 line

added check for NULL Pointer when calling misdn_new. Asterisk does not allow us to create channels anymore when stop gracefully is used :). also modified the restart_indicator to 0
........

................

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68740 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_misdn.c
channels/misdn/isdn_msg_parser.c

index d47eb3c..450ee6c 100644 (file)
@@ -3057,7 +3057,12 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
        cl->bc = newbc;
        
        tmp = misdn_new(cl, AST_STATE_RESERVED, ext, NULL, format, port, channel);
-       cl->ast = tmp;
+       if (!tmp) {
+               ast_log(LOG_ERROR,"Could not create Asterisk object\n");
+               return NULL;
+       }
+
+       cl->ast=tmp;
        
        /* register chan in local list */
        cl_queue_chan(&cl_te, cl) ;
@@ -3959,6 +3964,13 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
                ch->originator = ORG_MISDN;
 
                chan = misdn_new(ch, AST_STATE_RESERVED, bc->dad, bc->oad, AST_FORMAT_ALAW, bc->port, bc->channel);
+
+               if (!chan) {
+                       misdn_lib_send_event(bc,EVENT_RELEASE_COMPLETE);
+                       ast_log(LOG_ERROR, "cb_events: misdn_new failed !\n"); 
+                       return 0;
+               }
+
                ch->ast = chan;
 
                if ((exceed = add_in_calls(bc->port))) {
index de39741..289454d 100644 (file)
@@ -839,7 +839,7 @@ static msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc,
        printf("Building RESTART Msg\n"); 
 #endif
        enc_ie_channel_id(&restart->CHANNEL_ID, msg, 1,bc->channel, nt,bc);
-       enc_ie_restart_ind(&restart->RESTART_IND, msg, 0x80, nt, bc);
+       enc_ie_restart_ind(&restart->RESTART_IND, msg, 0, nt, bc);
 
        cb_log(0,bc->port, "Restarting channel %d\n", bc->channel);
        return msg;